1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,183226,(e,t,a)=>{"use strict";var n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,d=(e,t)=>{for(var a in t)n(e,a,{get:t[a],enumerable:!0})},s=(e,t,a)=>t.has(e)?(e=>{throw TypeError(e)})("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),l={};d(l,{Decimal:()=>ta,Public:()=>u,getRuntime:()=>D,makeStrictEnum:()=>S,objectEnumValues:()=>f}),t.exports=((e,t,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let d of r(t))i.call(e,d)||void 0===d||n(e,d,{get:()=>t[d],enumerable:!(a=o(t,d))||a.enumerable});return e})(n({},"__esModule",{value:!0}),l);var u={};function c(){return e=>e}d(u,{validator:()=>c});var m,p=Symbol(),I=new WeakMap,g=class{constructor(e){e===p?I.set(this,"Prisma.".concat(this._getName())):I.set(this,"new Prisma.".concat(this._getNamespace(),".").concat(this._getName(),"()"))}_getName(){return this.constructor.name}toString(){return I.get(this)}},h=class extends g{_getNamespace(){return"NullTypes"}},y=class extends h{constructor(){super(...arguments),s(this,m)}};m=new WeakMap,b(y,"DbNull");var C,A=class extends h{constructor(){super(...arguments),s(this,C)}};C=new WeakMap,b(A,"JsonNull");var E,N=class extends h{constructor(){super(...arguments),s(this,E)}};E=new WeakMap,b(N,"AnyNull");var f={classes:{DbNull:y,JsonNull:A,AnyNull:N},instances:{DbNull:new y(p),JsonNull:new A(p),AnyNull:new N(p)}};function b(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var w=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function S(e){return new Proxy(e,{get(e,t){if(t in e)return e[t];if(!w.has(t))throw TypeError("Invalid enum value: ".concat(String(t)))}})}var T=()=>{var e,t;return(null==(t=null==(e=globalThis.process)?void 0:e.release)?void 0:t.name)==="node"},R=()=>{var e,t;return!!globalThis.Bun||!!(null!=(t=null==(e=globalThis.process)?void 0:e.versions)&&t.bun)},v=()=>!!globalThis.Deno,k=()=>"object"==typeof globalThis.Netlify,M=()=>"object"==typeof globalThis.EdgeRuntime,O=()=>{var e;return(null==(e=globalThis.navigator)?void 0:e.userAgent)==="Cloudflare-Workers"},P={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function D(){var e;let t=null!=(e=[[k,"netlify"],[M,"edge-light"],[O,"workerd"],[v,"deno"],[R,"bun"],[T,"node"]].flatMap(e=>e[0]()?[e[1]]:[]).at(0))?e:"";return{id:t,prettyName:P[t]||t,isEdge:["workerd","deno","netlify","edge-light"].includes(t)}}var L,$,F="0123456789abcdef",U="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",B="3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943305727036575959195309218611738193261179310511854807446237996274956735188575272489122793818301194912983367336244065664308602139494639522473719070217986094370277053921717629317675238467481846766940513200056812714526356082778577134275778960917363717872146844090122495343014654958537105079227968925892354201995611212902196086403441815981362977477130996051870721134999999837297804995105973173281609631859502445945534690830264252230825334468503526193
111881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",W={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},H=!0,z="[DecimalError] ",_=z+"Invalid argument: ",V=z+"Precision limit exceeded",Y=z+"crypto unavailable",x="[object Decimal]",J=Math.floor,j=Math.pow,q=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,G=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,K=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Q=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,X=U.length-1,Z=B.length-1,ee={toStringTag:x};function et(e){var t,a,n,o=e.length-1,r="",i=e[0];if(o>0){for(r+=i,t=1;t<o;t++)(a=7-(n=e[t]+"").length)&&(r+=em(a)),r+=n;(a=7-(n=(i=e[t])+"").length)&&(r+=em(a))}else if(0===i)return"0";for(;i%10==0;)i/=10;return r+i}function ea(e,t,a){if(e!==~~e||e<t||e>a)throw Error(_+e)}function en(e,t,a,n){var o,r,i,d;for(r=e[0];r>=10;r/=10)--t;return--t<0?(t+=7,o=0):(o=Math.ceil((t+1)/7),t%=7),r=j(10,7-t),d=e[o]%r|0,null==n?t<3?(0==t?d=d/100|0:1==t&&(d=d/10|0),i=a<4&&99999==d||a>3&&49999==d||5e4==d||0==d):i=(a<4&&d+1==r||a>3&&d+1==r/2)&&(e[o+1]/r/100|0)==j(10,t-2)-1||(d==r/2||0==d)&&(e[o+1]/r/100|0)==0:t<4?(0==t?d=d/1e3|0:1==t?d=d/100|0:2==t&&(d=d/10|0),i=(n||a<4)&&9999==d||!n&&a>3&&4999==d):i=((n||a<4)&&d+1==r||!n&&a>3&&d+1==r/2)&&(e[o+1]/r/1e3|0)==j(10,t-3)-1,i}
1function eo(e,t,a){for(var n,o,r=[0],i=0,d=e.length;i<d;){for(o=r.length;o--;)r[o]*=t;for(r[0]+=F.indexOf(e.charAt(i++)),n=0;n<r.length;n++)r[n]>a-1&&(void 0===r[n+1]&&(r[n+1]=0),r[n+1]+=r[n]/a|0,r[n]%=a)}return r.reverse()}ee.absoluteValue=ee.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),ei(e)},ee.ceil=function(){return ei(new this.constructor(this),this.e+1,2)},ee.clampedTo=ee.clamp=function(e,t){var a=this.constructor;if(e=new a(e),t=new a(t),!e.s||!t.s)return new a(NaN);if(e.gt(t))throw Error(_+t);return 0>this.cmp(e)?e:this.cmp(t)>0?t:new a(this)},ee.comparedTo=ee.cmp=function(e){var t,a,n,o,r=this.d,i=(e=new this.constructor(e)).d,d=this.s,s=e.s;if(!r||!i)return d&&s?d!==s?d:r===i?0:!r^d<0?1:-1:NaN;if(!r[0]||!i[0])return r[0]?d:i[0]?-s:0;if(d!==s)return d;if(this.e!==e.e)return this.e>e.e^d<0?1:-1;for(n=r.length,o=i.length,t=0,a=n<o?n:o;t<a;++t)if(r[t]!==i[t])return r[t]>i[t]^d<0?1:-1;return n===o?0:n>o^d<0?1:-1},ee.cosine=ee.cos=function(){var e,t,a=this,n=a.constructor;return a.d?a.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(a.e,a.sd())+7,n.rounding=1,a=function(e,t){var a,n,o;if(t.isZero())return t;(n=t.d.length)<32?o=(1/eN(4,a=Math.ceil(n/3))).toString():(a=16,o="2.3283064365386962890625e-10"),e.precision+=a,t=eE(e,1,t.times(o),new e(1));for(var r=a;r--;){var i=t.times(t);t=i.times(i).minus(i).times(8).plus(1)}return e.precision-=a,t}(n,ef(n,a)),n.precision=e,n.rounding=t,ei(2==$||3==$?a.neg():a,e,t,!0)):new n(1):new n(NaN)},ee.cubeRoot=ee.cbrt=function(){var e,t,a,n,o,r,i,d,s,l,u=this.constructor;if(!this.isFinite()||this.isZero())return new u(this);for(H=!1,(r=this.s*j(this.s*this,1/3))&&Math.abs(r)!=1/0?n=new u(r.toString()):(a=et(this.d),(r=((e=this.e)-a.length+1)%3)&&(a+=1==r||-2==r?"0":"00"),r=j(a,1/3),e=J((e+1)/3)-(e%3==(e<0?-1:2)),(n=new u(a=r==1/0?"5e"+e:(a=r.toExponential()).slice(0,a.indexOf("e")+1)+e)).s=this.s),i=(e=u.precision)+3;;)if(n=er((l=(s=(d=n).times(d).times(d)).plus(this)).plus(this).times(d),l.plus(s),i+2,1),et(d.d).slice(0,i)===(a=et(n.d)).slice(0,i))if("9999"!=(a=a.slice(i-3,i+1))&&(o||"4999"!=a)){+a&&(+a.slice(1)||"5"!=a.charAt(0))||(ei(n,e+1,1),t=!n.times(n).times(n).eq(this));break}else{if(!o&&(ei(d,e+1,0),d.times(d).times(d).eq(this))){n=d;break}i+=4,o=1}return H=!0,ei(n,e,u.rounding,t)},ee.decimalPlaces=ee.dp=function(){var e,t=this.d,a=NaN;if(t){if(a=((e=t.length-1)-J(this.e/7))*7,e=t[e])for(;e%10==0;e/=10)a--;a<0&&(a=0)}return a},ee.dividedBy=ee.div=function(e){return er(this,new this.constructor(e))},ee.dividedToIntegerBy=ee.divToInt=function(e){var t=this.constructor;return ei(er(this,new t(e),0,1,1),t.precision,t.rounding)},ee.equals=ee.eq=function(e){return 0===this.cmp(e)},ee.floor=function(){return ei(new this.constructor(this),this.e+1,3)},ee.greaterThan=ee.gt=function(e){return this.cmp(e)>0},ee.greaterThanOrEqualTo=ee.gte=function(e){var t=this.cmp(e);return 1==t||0===t},ee.hyperbolicCosine=ee.cosh=function(){var e,t,a,n,o,r=this,i=r.constructor,d=new i(1);if(!r.isFinite())return new i(r.s?1/0:NaN);if(r.isZero())return d;a=i.precision,n=i.rounding,i.precision=a+Math.max(r.e,r.sd())+4,i.rounding=1,(o=r.d.length)<32?t=(1/eN(4,e=Math.ceil(o/3))).toString():(e=16,t="2.3283064365386962890625e-10"),r=eE(i,1,r.times(t),new i(1),!0);for(var s,l=e,u=new i(8);l--;)s=r.times(r),r=d.minus(s.times(u.minus(s.times(u))));return ei(r,i.precision=a,i.rounding=n,!0)},ee.hyperbolicSine=ee.sinh=function(){var e,t,a,n,o=this,r=o.constructor;if(!o.isFinite()||o.isZero())return new r(o);if(t=r.precision,a=r.rounding,r.precision=t+Math.max(o.e,o.sd())+4,r.rounding=1,(n=o.d.length)<3)o=eE(r,2,o,o,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,o=eE(r,2,o=o.times(1/eN(5,e)),o,!0);for(var i,d=new r(5),s=new r(16),l=new r(20);e--;)i=o.times(o),o=o.times(d.plus(i.times(s.times(i).plus(l))))}return r.precision=t,r.rounding=a,ei(o,t,a,!0)},ee.hyperbolicTangent=ee.tanh=function(){var e,t,a=this.constructor;return this.isFinite()?this.isZero()?new a(this):(e=a.precision,t=a.rounding,a.precision=e+7,a.rounding=1,er(this.sinh(),this.cosh(),a.precision=e,a.rounding=t)):new a(this.s)},ee.inverseCosine=ee.acos=function(){var e=this,t=e.constructor,a=e.abs().cmp(1),n=t.precision,o=t.rounding;return -1!==a?0===a?e.isNeg()?eu(t,n,o):new t(0):new t(NaN):e.isZero()?eu(t,n+4,o).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=o,e.times(2))},ee.inverseHyperbolicCosine=ee.acosh=function(){var e,t,a=this,n=a.constructor;return a.lte(1)?new n(a.eq(1)?0:NaN):a.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(a.e),a.sd())+4,n.rounding=1,H=!1,a=a.times(a).minus(1).sqrt().plus(a),H=!0,n.precision=e,n.rounding=t,a.ln()):new n(a)}
1,ee.inverseHyperbolicSine=ee.asinh=function(){var e,t,a=this,n=a.constructor;return!a.isFinite()||a.isZero()?new n(a):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(a.e),a.sd())+6,n.rounding=1,H=!1,a=a.times(a).plus(1).sqrt().plus(a),H=!0,n.precision=e,n.rounding=t,a.ln())},ee.inverseHyperbolicTangent=ee.atanh=function(){var e,t,a,n,o=this,r=o.constructor;return o.isFinite()?o.e>=0?new r(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=r.precision,t=r.rounding,Math.max(n=o.sd(),e)<-(2*o.e)-1?ei(new r(o),e,t,!0):(r.precision=a=n-o.e,o=er(o.plus(1),new r(1).minus(o),a+e,1),r.precision=e+4,r.rounding=1,o=o.ln(),r.precision=e,r.rounding=t,o.times(.5))):new r(NaN)},ee.inverseSine=ee.asin=function(){var e,t,a,n,o=this,r=o.constructor;return o.isZero()?new r(o):(t=o.abs().cmp(1),a=r.precision,n=r.rounding,-1!==t?0===t?((e=eu(r,a+4,n).times(.5)).s=o.s,e):new r(NaN):(r.precision=a+6,r.rounding=1,o=o.div(new r(1).minus(o.times(o)).sqrt().plus(1)).atan(),r.precision=a,r.rounding=n,o.times(2)))},ee.inverseTangent=ee.atan=function(){var e,t,a,n,o,r,i,d,s,l=this,u=l.constructor,c=u.precision,m=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&c+4<=Z)return(i=eu(u,c+4,m).times(.25)).s=l.s,i}else{if(!l.s)return new u(NaN);if(c+4<=Z)return(i=eu(u,c+4,m).times(.5)).s=l.s,i}for(u.precision=d=c+10,u.rounding=1,e=a=Math.min(28,d/7+2|0);e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(H=!1,t=Math.ceil(d/7),n=1,s=l.times(l),i=new u(l),o=l;-1!==e;)if(o=o.times(s),r=i.minus(o.div(n+=2)),o=o.times(s),void 0!==(i=r.plus(o.div(n+=2))).d[t])for(e=t;i.d[e]===r.d[e]&&e--;);return a&&(i=i.times(2<<a-1)),H=!0,ei(i,u.precision=c,u.rounding=m,!0)},ee.isFinite=function(){return!!this.d},ee.isInteger=ee.isInt=function(){return!!this.d&&J(this.e/7)>this.d.length-2},ee.isNaN=function(){return!this.s},ee.isNegative=ee.isNeg=function(){return this.s<0},ee.isPositive=ee.isPos=function(){return this.s>0},ee.isZero=function(){return!!this.d&&0===this.d[0]},ee.lessThan=ee.lt=function(e){return 0>this.cmp(e)},ee.lessThanOrEqualTo=ee.lte=function(e){return 1>this.cmp(e)},ee.logarithm=ee.log=function(e){var t,a,n,o,r,i,d,s=this.constructor,l=s.precision,u=s.rounding;if(null==e)e=new s(10),t=!0;else{if(a=(e=new s(e)).d,e.s<0||!a||!a[0]||e.eq(1))return new s(NaN);t=e.eq(10)}if(a=this.d,this.s<0||!a||!a[0]||this.eq(1))return new s(a&&!a[0]?-1/0:1!=this.s?NaN:a?0:1/0);if(t)if(a.length>1)o=!0;else{for(n=a[0];n%10==0;)n/=10;o=1!==n}if(H=!1,en((d=er(r=ey(this,i=l+5),t?el(s,i+10):ey(e,i),i,1)).d,n=l,u))do if(i+=10,d=er(r=ey(this,i),t?el(s,i+10):ey(e,i),i,1),!o){+et(d.d).slice(n+1,n+15)+1==1e14&&(d=ei(d,l+1,0));break}while(en(d.d,n+=10,u))return H=!0,ei(d,l,u)},ee.minus=ee.sub=function(e){var t,a,n,o,r,i,d,s,l,u,c,m,p=this.constructor;if(e=new p(e),!this.d||!e.d)return this.s&&e.s?this.d?e.s=-e.s:e=new p(e.d||this.s!==e.s?this:NaN):e=new p(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.plus(e);if(l=this.d,m=e.d,d=p.precision,s=p.rounding,!l[0]||!m[0]){if(m[0])e.s=-e.s;else{if(!l[0])return new p(3===s?-0:0);e=new p(this)}return H?ei(e,d,s):e}if(a=J(e.e/7),u=J(this.e/7),l=l.slice(),r=u-a){for((c=r<0)?(t=l,r=-r,i=m.length):(t=m,a=u,i=l.length),r>(n=Math.max(Math.ceil(d/7),i)+2)&&(r=n,t.length=1),t.reverse(),n=r;n--;)t.push(0);t.reverse()}else{for((c=(n=l.length)<(i=m.length))&&(i=n),n=0;n<i;n++)if(l[n]!=m[n]){c=l[n]<m[n];break}r=0}for(c&&(t=l,l=m,m=t,e.s=-e.s),i=l.length,n=m.length-i;n>0;--n)l[i++]=0;for(n=m.length;n>r;){if(l[--n]<m[n]){for(o=n;o&&0===l[--o];)l[o]=1e7-1;--l[o],l[n]+=1e7}l[n]-=m[n]}for(;0===l[--i];)l.pop();for(;0===l[0];l.shift())--a;return l[0]?(e.d=l,e.e=es(l,a),H?ei(e,d,s):e):new p(3===s?-0:0)},ee.modulo=ee.mod=function(e){var t,a=this.constructor;return e=new a(e),this.d&&e.s&&(!e.d||e.d[0])?e.d&&(!this.d||this.d[0])?(H=!1,9==a.modulo?(t=er(this,e.abs(),0,3,1),t.s*=e.s):t=er(this,e,0,a.modulo,1),t=t.times(e),H=!0,this.minus(t)):ei(new a(this),a.precision,a.rounding):new a(NaN)},ee.naturalExponential=ee.exp=function(){return eh(this)},ee.naturalLogarithm=ee.ln=function(){return ey(this)},ee.negated=ee.neg=function(){var e=new this.constructor(this);return e.s=-e.s,ei(e)},ee.plus=ee.add=function(e){var t,a,n,o,r,i,d,s,l,u,c=this.constructor;if(e=new c(e),!this.d||!e.d)return this.s&&e.s?this.d||(e=new c(e.d||this.s===e.s?this:NaN)):e=new c(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.minus(e);if(l=this.d,u=e.d,d=c.precision,s=c.rounding,!l[0]||!u[0])return u[0]||(e=new c(this)),H?ei(e,d,s):e;if(r=J(this.e/7),n=J(e.e/7),l=l.slice(),o=r-n){for(o<0?(a=l,o=-o,i=u.length):(a=u,n=r,i=l.length),o>(i=(r=Math.ceil(d/7))>i?r+1:i+1)&&(o=i,a.length=1),a.reverse();o--;)a.push(0);a.reverse()}for((i=l.length)-(o=u.length)<0&&(o=i,a=u,u=l,l=a),t=0;o;)t=(l[--o]=l[o]+u[o]+t)/1e7|0,l[o]%=1e7;for(t&&(l.unshift(t),++n),i=l.length;0==l[--i];)l.pop();return e.d=l,e.e=es(l,n),H?ei(e,d,s):e},ee.precision=ee.sd=function(e){var t;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(_+e);return this.d?(t=ec(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},ee.round=function(){var e=this.constructor;return ei(new e(this),this.e+1,e.rounding)},ee.sine=ee.sin=function(){var e,t,a=this,n=a.constructor;return a.isFinite()?a.isZero()?new n(a):(e=n.precision,t=n.rounding,n.precision=e+Math.max(a.e,a.sd())+7,n.rounding=1,a=function(e,t){var a,n=t.d.length;if(n<3)return t.isZero()?t:eE(e,2,t,t);a=(a=1.4*Math.sqrt(n))>16?16:0|a,t=eE(e,2,t=t.times(1/eN(5,a)),t);for(var o,r=new e(5),i=new e(16),d=new e(20);a--;)o=t.times(t),t=t.times(r.plus(o.times(i.times(o).minus(d))));return t}(n,ef(n,a)),n.precision=e,n.rounding=t,ei($>2?a.neg():a,e,t,!0)):new n(NaN)},ee.squareRoot=ee.sqrt=function(){var e,t,a,n,o,r,i=this.d,d=this.e,s=this.s,l=this.constructor;if(1!==s||!i||!i[0])return new l(!s||s<0&&(!i||i[0])?NaN:i?this:1/0);for(H=!1,0==(s=Math.sqrt(+this))||s==1/0?(((t=et(i)).length+d)%2==0&&(t+="0"),s=Math.sqrt(t),d=J((d+1)/2)-(d<0||d%2),n=new l(t=s==1/0?"5e"+d:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+d)):n=new l(s.toString()),a=(d=l.precision)+3;;)if(n=(r=n).plus(er(this,r,a+2,1)).times(.5),et(r.d).slice(0,a)===(t=et(n.d)).slice(0,a))if("9999"!=(t=t.slice(a-3,a+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(ei(n,d+1,1),e=!n.times(n).eq(this));break}
1else{if(!o&&(ei(r,d+1,0),r.times(r).eq(this))){n=r;break}a+=4,o=1}return H=!0,ei(n,d,l.rounding,e)},ee.tangent=ee.tan=function(){var e,t,a=this,n=a.constructor;return a.isFinite()?a.isZero()?new n(a):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,(a=a.sin()).s=1,a=er(a,new n(1).minus(a.times(a)).sqrt(),e+10,0),n.precision=e,n.rounding=t,ei(2==$||4==$?a.neg():a,e,t,!0)):new n(NaN)},ee.times=ee.mul=function(e){var t,a,n,o,r,i,d,s,l,u=this.constructor,c=this.d,m=(e=new u(e)).d;if(e.s*=this.s,!c||!c[0]||!m||!m[0])return new u(!e.s||c&&!c[0]&&!m||m&&!m[0]&&!c?NaN:!c||!m?e.s/0:0*e.s);for(a=J(this.e/7)+J(e.e/7),(s=c.length)<(l=m.length)&&(r=c,c=m,m=r,i=s,s=l,l=i),r=[],n=i=s+l;n--;)r.push(0);for(n=l;--n>=0;){for(t=0,o=s+n;o>n;)d=r[o]+m[n]*c[o-n-1]+t,r[o--]=d%1e7|0,t=d/1e7|0;r[o]=(r[o]+t)%1e7|0}for(;!r[--i];)r.pop();return t?++a:r.shift(),e.d=r,e.e=es(r,a),H?ei(e,u.precision,u.rounding):e},ee.toBinary=function(e,t){return eb(this,2,e,t)},ee.toDecimalPlaces=ee.toDP=function(e,t){var a=this,n=a.constructor;return a=new n(a),void 0===e?a:(ea(e,0,1e9),void 0===t?t=n.rounding:ea(t,0,8),ei(a,e+a.e+1,t))},ee.toExponential=function(e,t){var a,n=this,o=n.constructor;return void 0===e?a=ed(n,!0):(ea(e,0,1e9),void 0===t?t=o.rounding:ea(t,0,8),a=ed(n=ei(new o(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+a:a},ee.toFixed=function(e,t){var a,n,o=this.constructor;return void 0===e?a=ed(this):(ea(e,0,1e9),void 0===t?t=o.rounding:ea(t,0,8),a=ed(n=ei(new o(this),e+this.e+1,t),!1,e+n.e+1)),this.isNeg()&&!this.isZero()?"-"+a:a},ee.toFraction=function(e){var t,a,n,o,r,i,d,s,l,u,c,m,p=this.d,I=this.constructor;if(!p)return new I(this);if(l=a=new I(1),n=s=new I(0),i=(r=(t=new I(n)).e=ec(p)-this.e-1)%7,t.d[0]=j(10,i<0?7+i:i),null==e)e=r>0?t:l;else{if(!(d=new I(e)).isInt()||d.lt(l))throw Error(_+d);e=d.gt(t)?r>0?t:l:d}for(H=!1,d=new I(et(p)),u=I.precision,I.precision=r=7*p.length*2;c=er(d,t,0,1,1),1!=(o=a.plus(c.times(n))).cmp(e);)a=n,n=o,o=l,l=s.plus(c.times(o)),s=o,o=t,t=d.minus(c.times(o)),d=o;return o=er(e.minus(a),n,0,1,1),s=s.plus(o.times(l)),a=a.plus(o.times(n)),s.s=l.s=this.s,m=1>er(l,n,r,1).minus(this).abs().cmp(er(s,a,r,1).minus(this).abs())?[l,n]:[s,a],I.precision=u,H=!0,m},ee.toHexadecimal=ee.toHex=function(e,t){return eb(this,16,e,t)},ee.toNearest=function(e,t){var a=this,n=a.constructor;if(a=new n(a),null==e){if(!a.d)return a;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:ea(t,0,8),!a.d)return e.s?a:e;if(!e.d)return e.s&&(e.s=a.s),e}return e.d[0]?(H=!1,a=er(a,e,0,t,1).times(e),H=!0,ei(a)):(e.s=a.s,a=e),a},ee.toNumber=function(){return+this},ee.toOctal=function(e,t){return eb(this,8,e,t)},ee.toPower=ee.pow=function(e){var t,a,n,o,r,i,d=this,s=d.constructor,l=+(e=new s(e));if(!d.d||!e.d||!d.d[0]||!e.d[0])return new s(j(+d,l));if((d=new s(d)).eq(1))return d;if(n=s.precision,r=s.rounding,e.eq(1))return ei(d,n,r);if((t=J(e.e/7))>=e.d.length-1&&(a=l<0?-l:l)<=0x1fffffffffffff)return o=ep(s,d,a,n),e.s<0?new s(1).div(o):ei(o,n,r);if((i=d.s)<0){if(t<e.d.length-1)return new s(NaN);if((1&e.d[t])==0&&(i=1),0==d.e&&1==d.d[0]&&1==d.d.length)return d.s=i,d}return(t=0!=(a=j(+d,l))&&isFinite(a)?new s(a+"").e:J(l*(Math.log("0."+et(d.d))/Math.LN10+d.e+1)))>s.maxE+1||t<s.minE-1?new s(t>0?i/0:0):(H=!1,s.rounding=d.s=1,a=Math.min(12,(t+"").length),(o=eh(e.times(ey(d,n+a)),n)).d&&en((o=ei(o,n+5,1)).d,n,r)&&(t=n+10,+et((o=ei(eh(e.times(ey(d,t+a)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(o=ei(o,n+1,0))),o.s=i,H=!0,s.rounding=r,ei(o,n,r))},ee.toPrecision=function(e,t){var a,n=this,o=n.constructor;return void 0===e?a=ed(n,n.e<=o.toExpNeg||n.e>=o.toExpPos):(ea(e,1,1e9),void 0===t?t=o.rounding:ea(t,0,8),a=ed(n=ei(new o(n),e,t),e<=n.e||n.e<=o.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+a:a},ee.toSignificantDigits=ee.toSD=function(e,t){var a=this.constructor;return void 0===e?(e=a.precision,t=a.rounding):(ea(e,1,1e9),void 0===t?t=a.rounding:ea(t,0,8)),ei(new a(this),e,t)},ee.toString=function(){var e=this.constructor,t=ed(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()&&!this.isZero()?"-"+t:t},ee.truncated=ee.trunc=function(){return ei(new this.constructor(this),this.e+1,1)},ee.valueOf=ee.toJSON=function(){var e=this.constructor,t=ed(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()?"-"+t:t};var er=function(){function e(e,t,a){var n,o=0,r=e.length;for(e=e.slice();r--;)n=e[r]*t+o,e[r]=n%a|0,o=n/a|0;return o&&e.unshift(o),e}function t(e,t,a,n){var o,r;if(a!=n)r=a>n?1:-1;else for(o=r=0;o<a;o++)if(e[o]!=t[o]){r=e[o]>t[o]?1:-1;break}return r}function a(e,t,a,n){for(var o=0;a--;
vendor: 5,309 bytes, line 1
1)e[a]-=o,o=+(e[a]<t[a]),e[a]=o*n+e[a]-t[a];for(;!e[0]&&e.length>1;)e.shift()}return function(n,o,r,i,d,s){var l,u,c,m,p,I,g,h,y,C,A,E,N,f,b,w,S,T,R,v,k=n.constructor,M=n.s==o.s?1:-1,O=n.d,P=o.d;if(!O||!O[0]||!P||!P[0])return new k(!n.s||!o.s||(O?P&&O[0]==P[0]:!P)?NaN:O&&0==O[0]||!P?0*M:M/0);for(s?(p=1,u=n.e-o.e):(s=1e7,p=7,u=J(n.e/p)-J(o.e/p)),R=P.length,S=O.length,C=(y=new k(M)).d=[],c=0;P[c]==(O[c]||0);c++);if(P[c]>(O[c]||0)&&u--,null==r?(f=r=k.precision,i=k.rounding):f=d?r+(n.e-o.e)+1:r,f<0)C.push(1),I=!0;else{if(f=f/p+2|0,c=0,1==R){for(m=0,P=P[0],f++;(c<S||m)&&f--;c++)b=m*s+(O[c]||0),C[c]=b/P|0,m=b%P|0;I=m||c<S}else{for((m=s/(P[0]+1)|0)>1&&(P=e(P,m,s),O=e(O,m,s),R=P.length,S=O.length),w=R,E=(A=O.slice(0,R)).length;E<R;)A[E++]=0;(v=P.slice()).unshift(0),T=P[0],P[1]>=s/2&&++T;do m=0,(l=t(P,A,R,E))<0?(N=A[0],R!=E&&(N=N*s+(A[1]||0)),(m=N/T|0)>1?(m>=s&&(m=s-1),h=(g=e(P,m,s)).length,E=A.length,1==(l=t(g,A,h,E))&&(m--,a(g,R<h?v:P,h,s))):(0==m&&(l=m=1),g=P.slice()),(h=g.length)<E&&g.unshift(0),a(A,g,E,s),-1==l&&(E=A.length,(l=t(P,A,R,E))<1&&(m++,a(A,R<E?v:P,E,s))),E=A.length):0===l&&(m++,A=[0]),C[c++]=m,l&&A[0]?A[E++]=O[w]||0:(A=[O[w]],E=1);while((w++<S||void 0!==A[0])&&f--)I=void 0!==A[0]}C[0]||C.shift()}if(1==p)y.e=u,L=I;else{for(c=1,m=C[0];m>=10;m/=10)c++;y.e=c+u*p-1,ei(y,d?r+y.e+1:r,i,I)}return y}}();function ei(e,t,a,n){var o,r,i,d,s,l,u,c,m,p=e.constructor;e:if(null!=t){if(!(c=e.d))return e;for(o=1,d=c[0];d>=10;d/=10)o++;if((r=t-o)<0)r+=7,i=t,s=(u=c[m=0])/j(10,o-i-1)%10|0;else if((m=Math.ceil((r+1)/7))>=(d=c.length))if(n){for(;d++<=m;)c.push(0);u=s=0,o=1,r%=7,i=r-7+1}else break e;else{for(u=d=c[m],o=1;d>=10;d/=10)o++;r%=7,s=(i=r-7+o)<0?0:u/j(10,o-i-1)%10|0}if(n=n||t<0||void 0!==c[m+1]||(i<0?u:u%j(10,o-i-1)),l=a<4?(s||n)&&(0==a||a==(e.s<0?3:2)):s>5||5==s&&(4==a||n||6==a&&(r>0?i>0?u/j(10,o-i):0:c[m-1])%10&1||a==(e.s<0?8:7)),t<1||!c[0])return c.length=0,l?(t-=e.e+1,c[0]=j(10,(7-t%7)%7),e.e=-t||0):c[0]=e.e=0,e;if(0==r?(c.length=m,d=1,m--):(c.length=m+1,d=j(10,7-r),c[m]=i>0?(u/j(10,o-i)%j(10,i)|0)*d:0),l)for(;;)if(0==m){for(r=1,i=c[0];i>=10;i/=10)r++;for(i=c[0]+=d,d=1;i>=10;i/=10)d++;r!=d&&(e.e++,1e7==c[0]&&(c[0]=1));break}else{if(c[m]+=d,1e7!=c[m])break;c[m--]=0,d=1}for(r=c.length;0===c[--r];)c.pop()}return H&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function ed(e,t,a){if(!e.isFinite())return eC(e);var n,o=e.e,r=et(e.d),i=r.length;return t?(a&&(n=a-i)>0?r=r.charAt(0)+"."+r.slice(1)+em(n):i>1&&(r=r.charAt(0)+"."+r.slice(1)),r=r+(e.e<0?"e":"e+")+e.e):o<0?(r="0."+em(-o-1)+r,a&&(n=a-i)>0&&(r+=em(n))):o>=i?(r+=em(o+1-i),a&&(n=a-o-1)>0&&(r=r+"."+em(n))):((n=o+1)<i&&(r=r.slice(0,n)+"."+r.slice(n)),a&&(n=a-i)>0&&(o+1===i&&(r+="."),r+=em(n))),r}function es(e,t){var a=e[0];for(t*=7;a>=10;a/=10)t++;return t}function el(e,t,a){if(t>X)throw H=!0,a&&(e.precision=a),Error(V);return ei(new e(U),t,1,!0)}function eu(e,t,a){if(t>Z)throw Error(V);return ei(new e(B),t,a,!0)}function ec(e){var t=e.length-1,a=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)a--;for(t=e[0];t>=10;t/=10)a++}return a}function em(e){for(var t="";e--;)t+="0";return t}function ep(e,t,a,n){var o,r=new e(1),i=Math.ceil(n/7+4);for(H=!1;;){if(a%2&&ew((r=r.times(t)).d,i)&&(o=!0),0===(a=J(a/2))){a=r.d.length-1,o&&0===r.d[a]&&++r.d[a];break}ew((t=t.times(t)).d,i)}return H=!0,r}function eI(e){return 1&e.d[e.d.length-1]}function eg(e,t,a){for(var n,o,r=new e(t[0]),i=0;++i<t.length;){if(!(o=new e(t[i])).s){r=o;break}((n=r.cmp(o))===a||0===n&&r.s===a)&&(r=o)}return r}function eh(e,t){var a,n,o,r,i,d,s,l=0,u=0,c=0,m=e.constructor,p=m.rounding,I=m.precision;if(!e.d||!e.d[0]||e.e>17)return new m(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(H=!1,s=I):s=t,d=new m(.03125);e.e>-2;)e=e.times(d),c+=5;for(s+=n=Math.log(j(2,c))/Math.LN10*2+5|0,a=r=i=new m(1),m.precision=s;;){if(r=ei(r.times(e),s,1),a=a.times(++u),et((d=i.plus(er(r,a,s,1))).d).slice(0,s)===et(i.d).slice(0,s)){for(o=c;o--;)i=ei(i.times(i),s,1);if(null!=t)return m.precision=I,i;if(!(l<3&&en(i.d,s-n,p,l)))return ei(i,m.precision=I,p,H=!0);m.precision=s+=10,a=r=d=new m(1),u=0,l++}i=d}}function ey(e,t){var a,n,o,r,i,d,s,l,u,c,m,p=1,I=e,g=I.d,h=I.constructor,y=h.rounding,C=h.precision;if(I.s<0||!g||!g[0]||!I.e&&1==g[0]&&1==g.length)return new h(g&&!g[0]?-1/0:1!=I.s?NaN:g?0:I);if(null==t?(H=!1,u=C):u=t,h.precision=u+=10,n=(a=et(g)).charAt(0),!(15e14>Math.abs(r=I.e)))return l=el(h,u+2,C).times(r+""),I=ey(new h(n+"."+a.slice(1)),u-10).plus(l),h.precision=C,null==t?ei(I,C,y,H=!0):I;for(;n<7&&1!=n||1==n&&a.charAt(1)>3;)n=(a=et((I=I.times(e)).d)).charAt(0),p++;for(r=I.e,n>1?(I=new h("0."+a),r++):I=new h(n+"."+a.slice(1)),c=I,s=i=I=er(I.minus(1),I.plus(1),u,1),m=ei(I.times(I),u,1),o=3;;){if(i=ei(i.times(m),u,1),et((l=s.plus(er(i,new h(o),u,1))).d).slice(0,u)===et(s.d).slice(0,u))if(s=s.times(2),0!==r&&(s=s.plus(el(h,u+2,C).times(r+""))),s=er(s,new h(p),u,1),null!=t)return h.precision=C,s;else{if(!en(s.d,u-10,y,d))return ei(s,h.precision=C,y,H=!0);h.precision=u+=10,l=i=I=er(c.minus(1),c.plus(1),u,1),m=ei(I.times(I),u,1),o=d=1}s=l,o+=2}}function eC(e){return String(e.s*e.s/0)}function eA(e,t){var a,n,o;for((a=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(a<0&&(a=n),a+=+t.slice(n+1),t=t.substring(0,n)):a<0&&(a=t.length),n=0;48===t.charCodeAt(n);n++);for(o=t.length;48===t.charCodeAt(o-1);--o);
1if(t=t.slice(n,o)){if(o-=n,e.e=a=a-n-1,e.d=[],n=(a+1)%7,a<0&&(n+=7),n<o){for(n&&e.d.push(+t.slice(0,n)),o-=7;n<o;)e.d.push(+t.slice(n,n+=7));n=7-(t=t.slice(n)).length}else n-=o;for(;n--;)t+="0";e.d.push(+t),H&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function eE(e,t,a,n,o){var r,i,d,s,l=e.precision,u=Math.ceil(l/7);for(H=!1,s=a.times(a),d=new e(n);;){if(i=er(d.times(s),new e(t++*t++),l,1),d=o?n.plus(i):n.minus(i),n=er(i.times(s),new e(t++*t++),l,1),void 0!==(i=d.plus(n)).d[u]){for(r=u;i.d[r]===d.d[r]&&r--;);if(-1==r)break}r=d,d=n,n=i,i=r}return H=!0,i.d.length=u+1,i}function eN(e,t){for(var a=e;--t;)a*=e;return a}function ef(e,t){var a,n=t.s<0,o=eu(e,e.precision,1),r=o.times(.5);if((t=t.abs()).lte(r))return $=n?4:1,t;if((a=t.divToInt(o)).isZero())$=n?3:2;else{if((t=t.minus(a.times(o))).lte(r))return $=eI(a)?n?2:3:n?4:1,t;$=eI(a)?n?1:4:n?3:2}return t.minus(o).abs()}function eb(e,t,a,n){var o,r,i,d,s,l,u,c,m,p=e.constructor,I=void 0!==a;if(I?(ea(a,1,1e9),void 0===n?n=p.rounding:ea(n,0,8)):(a=p.precision,n=p.rounding),e.isFinite()){for(i=(u=ed(e)).indexOf("."),I?(o=2,16==t?a=4*a-3:8==t&&(a=3*a-2)):o=t,i>=0&&(u=u.replace(".",""),(m=new p(1)).e=u.length-i,m.d=eo(ed(m),10,o),m.e=m.d.length),r=s=(c=eo(u,10,o)).length;0==c[--s];)c.pop();if(c[0]){if(i<0?r--:((e=new p(e)).d=c,e.e=r,c=(e=er(e,m,a,n,0,o)).d,r=e.e,l=L),i=c[a],d=o/2,l=l||void 0!==c[a+1],l=n<4?(void 0!==i||l)&&(0===n||n===(e.s<0?3:2)):i>d||i===d&&(4===n||l||6===n&&1&c[a-1]||n===(e.s<0?8:7)),c.length=a,l)for(;++c[--a]>o-1;)c[a]=0,a||(++r,c.unshift(1));for(s=c.length;!c[s-1];--s);for(i=0,u="";i<s;i++)u+=F.charAt(c[i]);if(I){if(s>1)if(16==t||8==t){for(i=16==t?4:3,--s;s%i;s++)u+="0";for(s=(c=eo(u,o,t)).length;!c[s-1];--s);for(i=1,u="1.";i<s;i++)u+=F.charAt(c[i])}else u=u.charAt(0)+"."+u.slice(1);u=u+(r<0?"p":"p+")+r}else if(r<0){for(;++r;)u="0"+u;u="0."+u}else if(++r>s)for(r-=s;r--;)u+="0";else r<s&&(u=u.slice(0,r)+"."+u.slice(r))}else u=I?"0p+0":"0";u=(16==t?"0x":2==t?"0b":8==t?"0o":"")+u}else u=eC(e);return e.s<0?"-"+u:u}function ew(e,t){if(e.length>t)return e.length=t,!0}function eS(e){return new this(e).abs()}function eT(e){return new this(e).acos()}function eR(e){return new this(e).acosh()}function ev(e,t){return new this(e).plus(t)}function ek(e){return new this(e).asin()}function eM(e){return new this(e).asinh()}function eO(e){return new this(e).atan()}function eP(e){return new this(e).atanh()}function eD(e,t){e=new this(e),t=new this(t);var a,n=this.precision,o=this.rounding,r=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(a=t.s<0?eu(this,n,o):new this(0)).s=e.s:!e.d||t.isZero()?(a=eu(this,r,1).times(.5)).s=e.s:t.s<0?(this.precision=r,this.rounding=1,a=this.atan(er(e,t,r,1)),t=eu(this,r,1),this.precision=n,this.rounding=o,a=e.s<0?a.minus(t):a.plus(t)):a=this.atan(er(e,t,r,1)):(a=eu(this,r,1).times(t.s>0?.25:.75)).s=e.s:a=new this(NaN),a}function eL(e){return new this(e).cbrt()}function e$(e){return ei(e=new this(e),e.e+1,2)}function eF(e,t,a){return new this(e).clamp(t,a)}function eU(e){if(!e||"object"!=typeof e)throw Error(z+"Object expected");var t,a,n,o=!0===e.defaults,r=["precision",1,1e9,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,9e15,"maxE",0,9e15,"minE",-9e15,0,"modulo",0,9];for(t=0;t<r.length;t+=3)if(a=r[t],o&&(this[a]=W[a]),void 0!==(n=e[a]))if(J(n)===n&&n>=r[t+1]&&n<=r[t+2])this[a]=n;else throw Error(_+a+": "+n);if(a="crypto",o&&(this[a]=W[a]),void 0!==(n=e[a]))if(!0===n||!1===n||0===n||1===n)if(n)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[a]=!0;else throw Error(Y);else this[a]=!1;else throw Error(_+a+": "+n);return this}function eB(e){return new this(e).cos()}function eW(e){return new this(e).cosh()}function eH(e,t){return new this(e).div(t)}function ez(e){return new this(e).exp()}function e_(e){return ei(e=new this(e),e.e+1,3)}function eV(){var e,t,a=new this(0);for(H=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)a.d&&(a=a.plus(t.times(t)));else{if(t.s)return H=!0,new this(1/0);a=t}return H=!0,a.sqrt()}function eY(e){return e instanceof tt||e&&e.toStringTag===x||!1}function ex(e){return new this(e).ln()}function eJ(e,t){return new this(e).log(t)}function ej(e){return new this(e).log(2)}function eq(e){return new this(e).log(10)}function eG(){return eg(this,arguments,-1)}
1function eK(){return eg(this,arguments,1)}function eQ(e,t){return new this(e).mod(t)}function eX(e,t){return new this(e).mul(t)}function eZ(e,t){return new this(e).pow(t)}function e0(e){var t,a,n,o,r=0,i=new this(1),d=[];if(void 0===e?e=this.precision:ea(e,1,1e9),n=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));r<n;)(o=t[r])>=429e7?t[r]=crypto.getRandomValues(new Uint32Array(1))[0]:d[r++]=o%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);r<n;)(o=t[r]+(t[r+1]<<8)+(t[r+2]<<16)+((127&t[r+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,r):(d.push(o%1e7),r+=4);r=n/4}else throw Error(Y);else for(;r<n;)d[r++]=1e7*Math.random()|0;for(n=d[--r],e%=7,n&&e&&(o=j(10,7-e),d[r]=(n/o|0)*o);0===d[r];r--)d.pop();if(r<0)a=0,d=[0];else{for(a=-1;0===d[0];a-=7)d.shift();for(n=1,o=d[0];o>=10;o/=10)n++;n<7&&(a-=7-n)}return i.e=a,i.d=d,i}function e1(e){return ei(e=new this(e),e.e+1,this.rounding)}function e2(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function e3(e){return new this(e).sin()}function e5(e){return new this(e).sinh()}function e7(e){return new this(e).sqrt()}function e4(e,t){return new this(e).sub(t)}function e9(){var e=0,t=arguments,a=new this(t[0]);for(H=!1;a.s&&++e<t.length;)a=a.plus(t[e]);return H=!0,ei(a,this.precision,this.rounding)}function e6(e){return new this(e).tan()}function e8(e){return new this(e).tanh()}function te(e){return ei(e=new this(e),e.e+1,1)}ee[Symbol.for("nodejs.util.inspect.custom")]=ee.toString,ee[Symbol.toStringTag]="Decimal";var tt=ee.constructor=function e(t){var a,n,o;function r(e){var t,a,n;if(!(this instanceof r))return new r(e);if(this.constructor=r,eY(e)){this.s=e.s,H?!e.d||e.e>r.maxE?(this.e=NaN,this.d=null):e.e<r.minE?(this.e=0,this.d=[0]):(this.e=e.e,this.d=e.d.slice()):(this.e=e.e,this.d=e.d?e.d.slice():e.d);return}if("number"==(n=typeof e)){if(0===e){this.s=1/e<0?-1:1,this.e=0,this.d=[0];return}if(e<0?(e=-e,this.s=-1):this.s=1,e===~~e&&e<1e7){for(t=0,a=e;a>=10;a/=10)t++;H?t>r.maxE?(this.e=NaN,this.d=null):t<r.minE?(this.e=0,this.d=[0]):(this.e=t,this.d=[e]):(this.e=t,this.d=[e]);return}if(0*e!=0){e||(this.s=NaN),this.e=NaN,this.d=null;return}return eA(this,e.toString())}if("string"===n)return 45===(a=e.charCodeAt(0))?(e=e.slice(1),this.s=-1):(43===a&&(e=e.slice(1)),this.s=1),Q.test(e)?eA(this,e):function(e,t){var a,n,o,r,i,d,s,l,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Q.test(t))return eA(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(G.test(t))a=16,t=t.toLowerCase();else if(q.test(t))a=2;else if(K.test(t))a=8;else throw Error(_+t);for((r=t.search(/p/i))>0?(s=+t.slice(r+1),t=t.substring(2,r)):t=t.slice(2),i=(r=t.indexOf("."))>=0,n=e.constructor,i&&(r=(d=(t=t.replace(".","")).length)-r,o=ep(n,new n(a),r,2*r)),r=u=(l=eo(t,a,1e7)).length-1;0===l[r];--r)l.pop();return r<0?new n(0*e.s):(e.e=es(l,u),e.d=l,H=!1,i&&(e=er(e,o,4*d)),s&&(e=e.times(54>Math.abs(s)?j(2,s):tt.pow(2,s))),H=!0,e)}(this,e);if("bigint"===n)return e<0?(e=-e,this.s=-1):this.s=1,eA(this,e.toString());throw Error(_+e)}if(r.prototype=ee,r.ROUND_UP=0,r.ROUND_DOWN=1,r.ROUND_CEIL=2,r.ROUND_FLOOR=3,r.ROUND_HALF_UP=4,r.ROUND_HALF_DOWN=5,r.ROUND_HALF_EVEN=6,r.ROUND_HALF_CEIL=7,r.ROUND_HALF_FLOOR=8,r.EUCLID=9,r.config=r.set=eU,r.clone=e,r.isDecimal=eY,r.abs=eS,r.acos=eT,r.acosh=eR,r.add=ev,r.asin=ek,r.asinh=eM,r.atan=eO,r.atanh=eP,r.atan2=eD,r.cbrt=eL,r.ceil=e$,r.clamp=eF,r.cos=eB,r.cosh=eW,r.div=eH,r.exp=ez,r.floor=e_,r.hypot=eV,r.ln=ex,r.log=eJ,r.log10=eq,r.log2=ej,r.max=eG,r.min=eK,r.mod=eQ,r.mul=eX,r.pow=eZ,r.random=e0,r.round=e1,r.sign=e2,r.sin=e3,r.sinh=e5,r.sqrt=e7,r.sub=e4,r.sum=e9,r.tan=e6,r.tanh=e8,r.trunc=te,void 0===t&&(t={}),t&&!0!==t.defaults)for(o=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],a=0;a<o.length;)t.hasOwnProperty(n=o[a++])||(t[n]=this[n]);return r.config(t),r}(W);U=new tt(U),B=new tt(B);var ta=tt},269852,(e,t,a)=>{Object.defineProperty(a,"__esModule",{value:!0});let{Decimal:n,objectEnumValues:o,makeStrictEnum:r,Public:i,getRuntime:d,skip:s}=e.r(183226),l={};a.Prisma=l,a.$Enums={},l.prismaVersion={client:"6.13.0",engine:"361e86d0ea4987e9f53a565309b3eed797a6bcbd"},l.PrismaClientKnownRequestError=()=>{let e=d().prettyName;throw Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}). 2In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)}
2,l.PrismaClientUnknownRequestError=()=>{let e=d().prettyName;throw Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}). 3In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.PrismaClientRustPanicError=()=>{let e=d().prettyName;throw Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}). 4In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.PrismaClientInitializationError=()=>{let e=d().prettyName;throw Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}). 5In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.PrismaClientValidationError=()=>{let e=d().prettyName;throw Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${e}). 6In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.Decimal=n,l.sql=()=>{let e=d().prettyName;throw Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${e}). 7In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.empty=()=>{let e=d().prettyName;throw Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${e}). 8In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.join=()=>{let e=d().prettyName;throw Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${e}). 9In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.raw=()=>{let e=d().prettyName;throw Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${e}). 10In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.validator=i.validator,l.getExtensionContext=()=>{let e=d().prettyName;throw Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${e}). 11In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.defineExtension=()=>{let e=d().prettyName;throw Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${e}). 12In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`)},l.DbNull=o.instances.DbNull,l.JsonNull=o.instances.JsonNull,l.AnyNull=o.instances.AnyNull,l.NullTypes={DbNull:o.classes.DbNull,JsonNull:o.classes.JsonNull,AnyNull:o.classes.AnyNull},a.Prisma.TransactionIsolationLevel=r({ReadUncommitted:"ReadUncommitted",ReadCommitted:"ReadCommitted",RepeatableRead:"RepeatableRead",Serializable:"Serializable"}),a.Prisma.AccountScalarFieldEnum={id:"id",userId:"userId",type:"type",provider:"provider",providerAccountId:"providerAccountId",refresh_token:"refresh_token",access_token:"access_token",expires_at:"expires_at",token_type:"token_type",scope:"scope",id_token:"id_token",session_state:"session_state",metadata:"metadata"},a.Prisma.SessionScalarFieldEnum={id:"id",sessionToken:"sessionToken",userId:"userId",expires:"expires"},a.Prisma.SessionInvalidationScalarFieldEnum={userId:"userId",invalidatedAt:"invalidatedAt"},a.Prisma.UserReferralScalarFieldEnum={id:"id",userReferralCodeId:"userReferralCodeId",source:"source",landingPage:"landingPage",loginRedirectReason:"loginRedirectReason",createdAt:"createdAt",userId:"userId",note:"note",firstPaidAt:"firstPaidAt",paidMonthCount:"paidMonthCount"},a.Prisma.UserReferralCodeScalarFieldEnum={id:"id",userId:"userId",code:"code",note:"note",deletedAt:"deletedAt",createdAt:"createdAt"},a.Prisma.ReferralRewardScalarFieldEnum={id:"id",userId:"userId",refereeId:"refereeId",kind:"kind",status:"status",tokenAmount:"tokenAmount",buzzAmount:"buzzAmount",points:"points",tierGranted:"tierGranted",sourceEventId:"sourceEventId",metadata:"metadata",earnedAt:"earnedAt",settledAt:"settledAt",redeemedAt:"redeemedAt",expiresAt:"expiresAt",revokedAt:"revokedAt",revokedReason:"revokedReason"},a.Prisma.ReferralMilestoneScalarFieldEnum={id:"id",userId:"userId",threshold:"threshold",bonusAmount:"bonusAmount",awardedAt:"awardedAt"},a.Prisma.ReferralRedemptionScalarFieldEnum={id:"id",userId:"userId",tokensSpent:"tokensSpent",rewardType:"rewardType",metadata:"metadata",createdAt:"createdAt"},a.Prisma.ReferralAttributionScalarFieldEnum={id:"id",referralCodeId:"referralCodeId",refereeId:"refereeId",eventType:"eventType",sourceEventId:"sourceEventId",tier:"tier",amount:"amount",paymentProvider:"paymentProvider",stripePaymentIntentId:"stripePaymentIntentId",stripeInvoiceId:"stripeInvoiceId",stripeChargeId:"stripeChargeId",paymentMethodFingerprint:"paymentMethodFingerprint",ipAddress:"ipAddress",metadata:"metadata",createdAt:"createdAt"},a.Prisma.UserPaymentConfigurationScalarFieldEnum={userId:"userId",tipaltiAccountId:"tipaltiAccountId",tipaltiAccountStatus:"tipaltiAccountStatus",tipaltiPaymentsEnabled:"tipaltiPaymentsEnabled",tipaltiWithdrawalMethod:"tipaltiWithdrawalMethod",stripeAccountId:"stripeAccountId",stripeAccountStatus:"stripeAccountStatus",stripePaymentsEnabled:"stripePaymentsEnabled",meta:"meta"},a.Prisma.BuzzWithdrawalRequestHistoryScalarFieldEnum={id:"id",requestId:"requestId",updatedById:"updatedById",status:"status",note:"note",createdAt:"createdAt",metadata:"metadata"},a.Prisma.BuzzWithdrawalRequestScalarFieldEnum={id:"id",userId:"userId",requestedToProvider:"requestedToProvider",requestedToId:"requestedToId",buzzWithdrawalTransactionId:"buzzWithdrawalTransactionId",requestedBuzzAmount:"requestedBuzzAmount",platformFeeRate:"platformFeeRate",transferredAmount:"transferredAmount",transferId:"transferId",currency:"currency",metadata:"metadata",createdAt:"createdAt",updatedAt:"updatedAt",status:"status"},a.Prisma.CashWithdrawalScalarFieldEnum={id:"id",transactionId:"transactionId",userId:"userId",amount:"amount",method:"method",fee:"fee",status:"status",note:"note",metadata:"metadata",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.CryptoWalletScalarFieldEnum={userId:"userId",chain:"chain",wallet:"wallet",smartAccount:"smartAccount",payCurrency:"payCurrency"},a.Prisma.CryptoDepositScalarFieldEnum={paymentId:"paymentId",userId:"userId",status:"status",payCurrency:"payCurrency",payAmount:"payAmount",outcomeAmount:"outcomeAmount",buzzCredited:"buzzCredited",bonusBuzz:"bonusBuzz",multiplier:"multiplier",depositFee:"depositFee",serviceFee:"serviceFee",feeCurrency:"feeCurrency",paidFiat:"paidFiat",chain:"chain",retryCount:"retryCount",stuckNotifiedAt:"stuckNotifiedAt",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.CryptoTransactionScalarFieldEnum={key:"key",userId:"userId",status:"status",amount:"amount",currency:"currency",sweepTxHash:"sweepTxHash",note:"note",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.UserScalarFieldEnum={id:"id",name:"name",username:"username",email:"email",emailVerified:"emailVerified",image:"image",showNsfw:"showNsfw",blurNsfw:"blurNsfw",browsingLevel:"browsingLevel",onboarding:"onboarding",flags:"flags",isModerator:"isModerator",createdAt:"createdAt",deletedAt:"deletedAt",mutedAt:"mutedAt",muted:"muted",muteExpiresAt:"muteExpiresAt",bannedAt:"bannedAt",autoplayGifs:"autoplayGifs",filePreferences:"filePreferences",meta:"meta",leaderboardShowcase:"leaderboardShowcase",excludeFromLeaderboards:"excludeFromLeaderboards",rewardsEligibility:"rewardsEligibility",eligibilityChangedAt:"eligibilityChangedAt",customerId:"customerId",paddleCustomerId:"paddleCustomerId",profilePictureId:"profilePictureId",settings:"settings",publicSettings:"publicSettings"},a.Prisma.CustomerSubscriptionScalarFieldEnum={id:"id",userId:"userId",buzzType:"buzzType",metadata:"metadata",status:"status",priceId:"priceId",productId:"productId",cancelAtPeriodEnd:"cancelAtPeriodEnd",cancelAt:"cancelAt",canceledAt:"canceledAt",currentPeriodStart:"currentPeriodStart",currentPeriodEnd:"currentPeriodEnd",createdAt:"createdAt",endedAt:"endedAt",updatedAt:"updatedAt"},a.Prisma.MembershipGiftScalarFieldEnum={id:"id",gifterId:"gifterId",recipientId:"recipientId",tier:"tier",months:"months",amountCents:"amountCents",status:"status",message:"message",anonymous:"anonymous",stripeCheckoutSessionId:"stripeCheckoutSessionId",stripePaymentIntentId:"stripePaymentIntentId",stripeCouponId:"stripeCouponId",stripeSubscriptionId:"stripeSubscriptionId",fulfilledAt:"fulfilledAt",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ProductScalarFieldEnum={id:"id",active:"active",name:"name",description:"description",metadata:"metadata",defaultPriceId:"defaultPriceId",provider:"provider"},a.Prisma.PriceScalarFieldEnum={id:"id",productId:"productId",active:"active",currency:"currency",de
12scription:"description",type:"type",unitAmount:"unitAmount",interval:"interval",intervalCount:"intervalCount",metadata:"metadata",provider:"provider"},a.Prisma.PurchaseScalarFieldEnum={id:"id",userId:"userId",productId:"productId",priceId:"priceId",status:"status",createdAt:"createdAt"},a.Prisma.CreatorGalleryHiddenUserScalarFieldEnum={creatorId:"creatorId",userId:"userId",note:"note",createdAt:"createdAt"},a.Prisma.UserEngagementScalarFieldEnum={userId:"userId",targetUserId:"targetUserId",type:"type",createdAt:"createdAt"},a.Prisma.UserMetricScalarFieldEnum={userId:"userId",timeframe:"timeframe",followingCount:"followingCount",followerCount:"followerCount",reactionCount:"reactionCount",hiddenCount:"hiddenCount",uploadCount:"uploadCount",reviewCount:"reviewCount",answerCount:"answerCount",answerAcceptCount:"answerAcceptCount",updatedAt:"updatedAt"},a.Prisma.UserLinkScalarFieldEnum={id:"id",userId:"userId",url:"url",type:"type"},a.Prisma.VerificationTokenScalarFieldEnum={identifier:"identifier",token:"token",expires:"expires"},a.Prisma.ImportScalarFieldEnum={id:"id",userId:"userId",createdAt:"createdAt",startedAt:"startedAt",finishedAt:"finishedAt",source:"source",status:"status",data:"data",parentId:"parentId",importId:"importId"},a.Prisma.HuggingFaceImportScalarFieldEnum={id:"id",repo:"repo",revision:"revision",filename:"filename",groupName:"groupName",sourceUrl:"sourceUrl",sizeBytes:"sizeBytes",sourceSha256:"sourceSha256",status:"status",bytesTransferred:"bytesTransferred",uploadId:"uploadId",partSize:"partSize",parts:"parts",bucket:"bucket",key:"key",url:"url",error:"error",attempts:"attempts",nextAttemptAt:"nextAttemptAt",userId:"userId",modelVersionId:"modelVersionId",modelFileId:"modelFileId",attachVersionId:"attachVersionId",attachType:"attachType",claimedBy:"claimedBy",claimedAt:"claimedAt",heartbeatAt:"heartbeatAt",startedAt:"startedAt",completedAt:"completedAt",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ModelScalarFieldEnum={id:"id",name:"name",description:"description",type:"type",createdAt:"createdAt",updatedAt:"updatedAt",lastVersionAt:"lastVersionAt",nsfw:"nsfw",tosViolation:"tosViolation",poi:"poi",minor:"minor",userId:"userId",status:"status",publishedAt:"publishedAt",fromImportId:"fromImportId",meta:"meta",deletedAt:"deletedAt",deletedBy:"deletedBy",checkpointType:"checkpointType",uploadType:"uploadType",locked:"locked",underAttack:"underAttack",mode:"mode",unlisted:"unlisted",gallerySettings:"gallerySettings",availability:"availability",nsfwLevel:"nsfwLevel",lockedProperties:"lockedProperties",scannedAt:"scannedAt",sfwOnly:"sfwOnly",isOfficial:"isOfficial",allowNoCredit:"allowNoCredit",allowCommercialUse:"allowCommercialUse",allowDerivatives:"allowDerivatives",allowDifferentLicense:"allowDifferentLicense"},a.Prisma.ModelFlagScalarFieldEnum={modelId:"modelId",poi:"poi",minor:"minor",sfwOnly:"sfwOnly",nsfw:"nsfw",triggerWords:"triggerWords",poiName:"poiName",status:"status",details:"details",createdAt:"createdAt"},a.Prisma.LicenseScalarFieldEnum={id:"id",name:"name",url:"url"},a.Prisma.ModelInterestScalarFieldEnum={userId:"userId",modelId:"modelId",createdAt:"createdAt"},a.Prisma.ModelEngagementScalarFieldEnum={userId:"userId",modelId:"modelId",type:"type",createdAt:"createdAt"},a.Prisma.ModelVersionSponsorshipSettingsScalarFieldEnum={id:"id",modelVersionMonetizationId:"modelVersionMonetizationId",type:"type",currency:"currency",unitAmount:"unitAmount"},a.Prisma.ModelVersionMonetizationScalarFieldEnum={id:"id",modelVersionId:"modelVersionId",type:"type",currency:"currency",unitAmount:"unitAmount"},a.Prisma.ModelVersionScalarFieldEnum={id:"id",index:"index",name:"name",description:"description",modelId:"modelId",trainedWords:"trainedWords",steps:"steps",epochs:"epochs",clipSkip:"clipSkip",vaeId:"vaeId",createdAt:"createdAt",updatedAt:"updatedAt",publishedAt:"publishedAt",initialPublishedAt:"initialPublishedAt",status:"status",trainingStatus:"trainingStatus",trainingDetails:"trainingDetails",fromImportId:"fromImportId",inaccurate:"inaccurate",baseModel:"baseModel",baseModelType:"baseModelType",meta:"meta",requireAuth:"requireAuth",settings:"settings",availability:"availability",nsfwLevel:"nsfwLevel",uploadType:"uploadType",usageControl:"usageControl",earlyAccessTimeFrame:"earlyAccessTimeFrame",flags:"flags",generatorLoaded:"generatorLoaded",licensingFee:"licensingFee",licensingFeeType:"licensingFeeType",licensingFeeSettlementCurrency:"licensingFeeSettlementCurrency",licensingSourceVersionId:"licensingSourceVersionId"},a.Prisma.LicensingRootScalarFieldEnum={id:"id",baseModel:"baseModel",modelType:"modelType",modelVersionId:"modelVersionId",isDefault:"isDefault",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.PricingSlotScalarFieldEnum={entityType:"entityType",entityId:"entityId",ownerId:"ownerId",createdAt:"createdAt"},a.Prisma.ModelVersionEngagementScalarFieldEnum={userId:"userId",modelVersionId:"modelVersionId",type:"type",createdAt:"createdAt"},a.Prisma.RecommendedResourceScalarFieldEnum={id:"id",resourceId:"resourceId",sourceId:"sourceId",settings:"settings"},a.Prisma.ModelFileHashScalarFieldEnum={fileId:"fileId",type:"type",hash:"hash",createdAt:"createdAt"},a.Prisma.ModelFileScalarFieldEnum={id:"id",name:"name",overrideName:"overrideName",url:"url",sizeKB:"sizeKB",createdAt:"createdAt",type:"type",modelVersionId:"modelVersionId",pickleScanResult:"pickleScanResult",exists:"exists",pickleScanMessage:"pickleScanMessage",virusScanResult:"virusScanResult",virusScanMessage:"virusScanMessage",scannedAt:"scannedAt",scanRequestedAt:"scanRequestedAt",rawScanResult:"rawScanResult",metadata:"metadata",headerData:"headerData",visibility:"visibility",dataPurged:"dataPurged",replacedAt:"replacedAt"},a.Prisma.FileScalarFieldEnum={id:"id",name:"name",url:"url",sizeKB:"sizeKB",createdAt:"createdAt",entityId:"entityId",entityType:"entityType",metadata:"metadata"},a.Prisma.ModelMetricScalarFieldEnum={modelId:"modelId",downloadCount:"downloadCount",commentCount:"commentCount",collectedCount:"collectedCount",imageCount:"imageCount",tippedCount:"tippedCount",tippedAmountCount:"tippedAmountCount",generationCount:"generationCount",thumbsUpCount:"thumbsUpCount",thumbsDownCount:"thumbsDownCount",earnedAmount:"earnedAmount",updatedAt:"updatedAt",poi:"poi",minor:"minor",nsfwLevel:"nsfwLevel",userId:"userId",lastVersionAt:"lastVersionAt",mode:"mode",status:"status",availability:"availability"},a.Prisma.ModelVersionMetricScalarFieldEnum={modelVersionId:"modelVersionId",downloadCount:"downloadCount",commentCount:"commentCount",collectedCount:"collectedCount",imageCount:"imageCount",tippedCount:"tippedCount",tippedAmountCount:"tippedAmountCount",generationCount:"generationCount",thumbsUpCount:"thumbsUpCount",thumbsDownCount:"thumbsDownCount",earnedAmount:"earnedAmount",updatedAt:"updatedAt"},a.Prisma.ModelBaseModelMetricScalarFieldEnum={modelId:"modelId",baseModel:"baseModel",thumbsUpCount:"thumbsUpCount",downloadCount:"downloadCount",imageCount:"imageCount",status:"status",availability:"availability",nsfwLevel:"nsfwLevel",mode:"mode",poi:"poi",minor:"minor",updatedAt:"updatedAt"},a.Prisma.ModelMetricDailyScalarFieldEnum={modelId:"modelId",modelVersionId:"modelVersionId",type:"type",date:"date",count:"count"},a.Prisma.ModelAssociationsScalarFieldEnum={id:"id",fromModelId:"fromModelId",toModelId:"toModelId",toArticleId:"toArticleId",associatedById:"associatedById",createdAt:"createdAt",type:"type",index:"index"},a.Prisma.DownloadHistoryScalarFieldEnum={userId:"userId",modelVersionId:"modelVersionId",downloadAt:"downloadAt",hidden:"hidden"},a.Prisma.ModActivityScalarFieldEnum={id:"id",userId:"userId",activity:"activity",entityType:"entityType",entityId:"entityId",createdAt:"createdAt"},a.Prisma.ReportScalarFieldEnum={id:"id",userId:"userId",reason:"reason",createdAt:"createdAt",details:"details",internalNotes:"internalNotes",previouslyReviewedCount:"previouslyReviewedCount",alsoReportedBy:"alsoReportedBy",
12status:"status",statusSetAt:"statusSetAt",statusSetBy:"statusSetBy"},a.Prisma.ResourceReviewReportScalarFieldEnum={resourceReviewId:"resourceReviewId",reportId:"reportId"},a.Prisma.ModelReportScalarFieldEnum={modelId:"modelId",reportId:"reportId"},a.Prisma.CommentReportScalarFieldEnum={commentId:"commentId",reportId:"reportId"},a.Prisma.CommentV2ReportScalarFieldEnum={commentV2Id:"commentV2Id",reportId:"reportId"},a.Prisma.ImageReportScalarFieldEnum={imageId:"imageId",reportId:"reportId"},a.Prisma.ArticleReportScalarFieldEnum={articleId:"articleId",reportId:"reportId"},a.Prisma.PostReportScalarFieldEnum={postId:"postId",reportId:"reportId"},a.Prisma.UserReportScalarFieldEnum={userId:"userId",reportId:"reportId"},a.Prisma.CollectionReportScalarFieldEnum={collectionId:"collectionId",reportId:"reportId"},a.Prisma.BountyReportScalarFieldEnum={bountyId:"bountyId",reportId:"reportId"},a.Prisma.BountyEntryReportScalarFieldEnum={bountyEntryId:"bountyEntryId",reportId:"reportId"},a.Prisma.ChatReportScalarFieldEnum={chatId:"chatId",reportId:"reportId"},a.Prisma.ComicProjectReportScalarFieldEnum={comicProjectId:"comicProjectId",reportId:"reportId"},a.Prisma.ResourceReviewScalarFieldEnum={id:"id",modelId:"modelId",modelVersionId:"modelVersionId",rating:"rating",recommended:"recommended",details:"details",userId:"userId",createdAt:"createdAt",updatedAt:"updatedAt",exclude:"exclude",nsfw:"nsfw",tosViolation:"tosViolation",metadata:"metadata"},a.Prisma.ResourceReviewReactionScalarFieldEnum={id:"id",reviewId:"reviewId",userId:"userId",reaction:"reaction",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.PostScalarFieldEnum={id:"id",nsfw:"nsfw",title:"title",detail:"detail",userId:"userId",modelVersionId:"modelVersionId",model3dId:"model3dId",model3dReviewId:"model3dReviewId",createdAt:"createdAt",updatedAt:"updatedAt",publishedAt:"publishedAt",metadata:"metadata",tosViolation:"tosViolation",collectionId:"collectionId",unlisted:"unlisted",availability:"availability",nsfwLevel:"nsfwLevel"},a.Prisma.PostMetricScalarFieldEnum={postId:"postId",timeframe:"timeframe",likeCount:"likeCount",dislikeCount:"dislikeCount",laughCount:"laughCount",cryCount:"cryCount",heartCount:"heartCount",commentCount:"commentCount",collectedCount:"collectedCount",updatedAt:"updatedAt",ageGroup:"ageGroup"},a.Prisma.ImageScalarFieldEnum={id:"id",pHash:"pHash",name:"name",url:"url",userId:"userId",createdAt:"createdAt",updatedAt:"updatedAt",meta:"meta",hash:"hash",height:"height",width:"width",type:"type",metadata:"metadata",nsfw:"nsfw",nsfwLevel:"nsfwLevel",nsfwLevelLocked:"nsfwLevelLocked",tosViolation:"tosViolation",analysis:"analysis",generationProcess:"generationProcess",featuredAt:"featuredAt",postId:"postId",needsReview:"needsReview",hideMeta:"hideMeta",index:"index",scannedAt:"scannedAt",scanRequestedAt:"scanRequestedAt",mimeType:"mimeType",sizeKB:"sizeKB",ingestion:"ingestion",blockedFor:"blockedFor",scanJobs:"scanJobs",sortAt:"sortAt",minor:"minor",poi:"poi",acceptableMinor:"acceptableMinor"},a.Prisma.ImageTagForReviewScalarFieldEnum={imageId:"imageId",tagId:"tagId"},a.Prisma.ImageMetaFlagsScalarFieldEnum={imageId:"imageId",hasMeta:"hasMeta",onSite:"onSite"},a.Prisma.ImageFlagScalarFieldEnum={imageId:"imageId",promptNsfw:"promptNsfw",resourcesNsfw:"resourcesNsfw"},a.Prisma.BlockedImageScalarFieldEnum={hash:"hash",reason:"reason",createdAt:"createdAt"},a.Prisma.ImageConnectionScalarFieldEnum={imageId:"imageId",entityId:"entityId",entityType:"entityType"},a.Prisma.EntityModerationScalarFieldEnum={id:"id",entityType:"entityType",entityId:"entityId",workflowId:"workflowId",status:"status",retryCount:"retryCount",blocked:"blocked",triggeredLabels:"triggeredLabels",result:"result",contentHash:"contentHash",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ImageEngagementScalarFieldEnum={userId:"userId",imageId:"imageId",type:"type",createdAt:"createdAt"},a.Prisma.ImageResourceScalarFieldEnum={id:"id",modelVersionId:"modelVersionId",name:"name",hash:"hash",imageId:"imageId",strength:"strength",detected:"detected"},a.Prisma.ImageResourceNewScalarFieldEnum={imageId:"imageId",modelVersionId:"modelVersionId",strength:"strength",detected:"detected"},a.Prisma.ResourceOverrideScalarFieldEnum={hash:"hash",modelVersionId:"modelVersionId",type:"type",createdAt:"createdAt"},a.Prisma.ImageRatingRequestScalarFieldEnum={userId:"userId",imageId:"imageId",createdAt:"createdAt",nsfwLevel:"nsfwLevel",status:"status",weight:"weight"},a.Prisma.ArticleRatingReviewScalarFieldEnum={id:"id",articleId:"articleId",userId:"userId",createdAt:"createdAt",resolvedAt:"resolvedAt",resolvedBy:"resolvedBy",currentLevel:"currentLevel",suggestedLevel:"suggestedLevel",appliedLevel:"appliedLevel",userComment:"userComment",modComment:"modComment",status:"status"},a.Prisma.CollectionMetricScalarFieldEnum={collectionId:"collectionId",timeframe:"timeframe",followerCount:"followerCount",itemCount:"itemCount",contributorCount:"contributorCount",updatedAt:"updatedAt"},a.Prisma.TagScalarFieldEnum={id:"id",name:"name",displayName:"displayName",color:"color",createdAt:"createdAt",updatedAt:"updatedAt",target:"target",type:"type",nsfwTerm:"nsfwTerm",nsfwLevel:"nsfwLevel",unlisted:"unlisted",unfeatured:"unfeatured",isCategory:"isCategory",adminOnly:"adminOnly"},a.Prisma.TagsOnTagsScalarFieldEnum={fromTagId:"fromTagId",toTagId:"toTagId",type:"type",createdAt:"createdAt"},a.Prisma.TagsOnModelsScalarFieldEnum={modelId:"modelId",tagId:"tagId",createdAt:"createdAt"},a.Prisma.TagsOnModelsVoteScalarFieldEnum={modelId:"modelId",tagId:"tagId",userId:"userId",vote:"vote",createdAt:"createdAt"},a.Prisma.TagsOnQuestionsScalarFieldEnum={questionId:"questionId",tagId:"tagId"},a.Prisma.TagsOnImageNewScalarFieldEnum={imageId:"imageId",tagId:"tagId",attributes:"attributes"},a.Prisma.ShadowTagsOnImageScalarFieldEnum={imageId:"imageId",tagId:"tagId",confidence:"confidence"},a.Prisma.TagsOnImageVoteScalarFieldEnum={imageId:"imageId",tagId:"tagId",userId:"userId",vote:"vote",createdAt:"createdAt",applied:"applied"},a.Prisma.TagsOnPostScalarFieldEnum={postId:"postId",tagId:"tagId",createdAt:"createdAt",confidence:"confidence",disabled:"disabled",needsReview:"needsReview"},a.Prisma.TagsOnArticleScalarFieldEnum={articleId:"articleId",tagId:"tagId",createdAt:"createdAt"},a.Prisma.TagsOnBountyScalarFieldEnum={bountyId:"bountyId",tagId:"tagId",createdAt:"createdAt"},a.Prisma.TagsOnPostVoteScalarFieldEnum={postId:"postId",tagId:"tagId",userId:"userId",vote:"vote",createdAt:"createdAt"},a.Prisma.TagMetricScalarFieldEnum={tagId:"tagId",timeframe:"timeframe",modelCount:"modelCount",imageCount:"imageCount",postCount:"postCount",articleCount:"articleCount",hiddenCount:"hiddenCount",followerCount:"followerCount",updatedAt:"updatedAt"},a.Prisma.SavedModelScalarFieldEnum={modelId:"modelId",userId:"userId",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.RunStrategyScalarFieldEnum={modelVersionId:"modelVersionId",partnerId:"partnerId",url:"url",createdAt:"createdAt"},a.Prisma.PartnerScalarFieldEnum={id:"id",name:"name",homepage:"homepage",tos:"tos",privacy:"privacy",startupTime:"startupTime",onDemand:"onDemand",onDemandStrategy:"onDemandStrategy",onDemandTypes:"onDemandTypes",onDemandBaseModels:"onDemandBaseModels",stepsPerSecond:"stepsPerSecond",pricingModel:"pricingModel",price:"price",about:"about",createdAt:"createdAt",nsfw:"nsfw",poi:"poi",personal:"personal",token:"token",tier:"tier",logo:"logo",disabled:"disabled"},a.Prisma.KeyValueScalarFieldEnum={key:"key",value:"value"},a.Prisma.FeedbackScalarFieldEnum={id:"id",area:"area",userId:"userId",message:"message",context:"context",status:"status",createdAt:"createdAt",triageNote:"triageNote",handledById:"handledById",handledAt:"handledAt",bugId:"bugId"},a.Prisma.ApiKeyScalarFieldEnum={id:"id",key:"key",name:"name",tokenScope:"tokenScope",userId:"userId",createdAt:"createdAt",type:"type",expiresAt:"expiresAt",lastUsedAt:"lastUsedAt",clientId:"clientId",buzzLimit:"buzzLimit"},a.Prisma.OauthClientScalarFieldEnum={id:"id",secret:"secret",name:"name",description:"description",logoUrl:"logoUrl",redirectUris:"redirectUris",allowedOrigins:"allowedOrigins",grants:"grants",allowedScopes:"allowedScopes",isConfidential:"isConfidential",accessMode:"accessMode",userId:"userId",isVerified:"isVerified",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.UserRoleScalarFieldEnum={userId:"userId",role:"role",n
12ote:"note",addedById:"addedById",createdAt:"createdAt"},a.Prisma.RoleScalarFieldEnum={id:"id",description:"description",createdById:"createdById",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.UserMembershipOverrideScalarFieldEnum={userId:"userId",tier:"tier",note:"note",grantedById:"grantedById",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.AppBlockScalarFieldEnum={id:"id",appId:"appId",blockId:"blockId",version:"version",manifest:"manifest",status:"status",contentRating:"contentRating",promotionEligible:"promotionEligible",healthStatus:"healthStatus",healthCheckedAt:"healthCheckedAt",renderMode:"renderMode",trustTier:"trustTier",assetBundleUrl:"assetBundleUrl",assetBundleSha256:"assetBundleSha256",approvedScopes:"approvedScopes",currentVersionSha:"currentVersionSha",currentVersionDeployedAt:"currentVersionDeployedAt",repoUrl:"repoUrl",category:"category",featured:"featured",featuredOrder:"featuredOrder",screenshots:"screenshots",externalUrl:"externalUrl",spendTier:"spendTier",spendCapBuzzPerDay:"spendCapBuzzPerDay",spendVelocityMaxGens:"spendVelocityMaxGens",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.AppCollaboratorScalarFieldEnum={appListingId:"appListingId",userId:"userId",role:"role",status:"status",displayed:"displayed",invitedBy:"invitedBy",lastNotifiedAt:"lastNotifiedAt",createdAt:"createdAt",respondedAt:"respondedAt"},a.Prisma.AppOwnershipEventScalarFieldEnum={id:"id",appListingId:"appListingId",slug:"slug",action:"action",actorUserId:"actorUserId",targetUserId:"targetUserId",metadata:"metadata",createdAt:"createdAt"},a.Prisma.AppOwnershipTransferScalarFieldEnum={id:"id",appListingId:"appListingId",fromUserId:"fromUserId",toUserId:"toUserId",status:"status",expiresAt:"expiresAt",createdAt:"createdAt",respondedAt:"respondedAt"},a.Prisma.AppBlockPublishRequestScalarFieldEnum={id:"id",appBlockId:"appBlockId",slug:"slug",submittedByUserId:"submittedByUserId",submittedAt:"submittedAt",version:"version",manifest:"manifest",bundleKey:"bundleKey",bundleSha256:"bundleSha256",bundleSizeBytes:"bundleSizeBytes",fileSummary:"fileSummary",manifestDiffSummary:"manifestDiffSummary",status:"status",reviewedByUserId:"reviewedByUserId",reviewedAt:"reviewedAt",rejectionReason:"rejectionReason",approvalNotes:"approvalNotes",forgejoCommitSha:"forgejoCommitSha",sourceCommit:"sourceCommit",sourceDirty:"sourceDirty",deployState:"deployState",deployDetail:"deployDetail",deployUpdatedAt:"deployUpdatedAt",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.AppListingScalarFieldEnum={id:"id",serialId:"serialId",kind:"kind",slug:"slug",name:"name",tagline:"tagline",description:"description",iconId:"iconId",coverId:"coverId",category:"category",status:"status",contentRating:"contentRating",externalUrl:"externalUrl",sourceRepoUrl:"sourceRepoUrl",isBeta:"isBeta",betaMessage:"betaMessage",connectClientId:"connectClientId",connectRequestedScopes:"connectRequestedScopes",connectScopeJustifications:"connectScopeJustifications",appBlockId:"appBlockId",revisionOfId:"revisionOfId",featured:"featured",featuredOrder:"featuredOrder",userId:"userId",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.AppListingScreenshotScalarFieldEnum={id:"id",appListingId:"appListingId",imageId:"imageId",order:"order",caption:"caption",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.AppListingReviewScalarFieldEnum={id:"id",appListingId:"appListingId",userId:"userId",recommended:"recommended",details:"details",exclude:"exclude",tosViolation:"tosViolation",metadata:"metadata",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.AppListingMetricScalarFieldEnum={appListingId:"appListingId",thumbsUpCount:"thumbsUpCount",thumbsDownCount:"thumbsDownCount",installCount:"installCount",openCount:"openCount",connectCount:"connectCount",visitCount:"visitCount",tippedCount:"tippedCount",tippedAmountCount:"tippedAmountCount",updatedAt:"updatedAt"},a.Prisma.AppListingPublishRequestScalarFieldEnum={id:"id",appListingId:"appListingId",kind:"kind",slug:"slug",submittedByUserId:"submittedByUserId",submittedAt:"submittedAt",status:"status",reviewedByUserId:"reviewedByUserId",reviewedAt:"reviewedAt",rejectionReason:"rejectionReason",approvalNotes:"approvalNotes",changelog:"changelog",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.AppListingReportScalarFieldEnum={id:"id",appListingId:"appListingId",reporterUserId:"reporterUserId",reason:"reason",details:"details",status:"status",resolvedByUserId:"resolvedByUserId",resolvedAt:"resolvedAt",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.AppListingModerationEventScalarFieldEnum={id:"id",appListingId:"appListingId",slug:"slug",actorUserId:"actorUserId",reportId:"reportId",action:"action",reason:"reason",detail
12:"detail",before:"before",after:"after",createdAt:"createdAt"},a.Prisma.AppReviewAgentReportScalarFieldEnum={id:"id",publishRequestId:"publishRequestId",slug:"slug",kind:"kind",appBlockId:"appBlockId",oauthClientId:"oauthClientId",version:"version",bundleSha256:"bundleSha256",status:"status",model:"model",startedAt:"startedAt",completedAt:"completedAt",codeReview:"codeReview",securityAudit:"securityAudit",scopeVerdicts:"scopeVerdicts",summaryMd:"summaryMd",priorReportId:"priorReportId",tokenUsage:"tokenUsage",costUsd:"costUsd",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.BlockUserSettingsScalarFieldEnum={blockInstanceId:"blockInstanceId",userId:"userId",settings:"settings",updatedAt:"updatedAt"},a.Prisma.PlatformDefaultBlockScalarFieldEnum={appBlockId:"appBlockId",slotId:"slotId",targetModelTypes:"targetModelTypes",minContentRating:"minContentRating",maxContentRating:"maxContentRating",priority:"priority",enabled:"enabled",promotedAt:"promotedAt",promotedBy:"promotedBy"},a.Prisma.BlockUserSubscriptionScalarFieldEnum={id:"id",userId:"userId",appBlockId:"appBlockId",scope:"scope",targetModelTypes:"targetModelTypes",targetBaseModels:"targetBaseModels",targetModelIds:"targetModelIds",slotId:"slotId",pinnedVersion:"pinnedVersion",blockInstanceId:"blockInstanceId",installedByUserId:"installedByUserId",settings:"settings",enabled:"enabled",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.BlockBuzzAttributionScalarFieldEnum={id:"id",userId:"userId",buzzAmount:"buzzAmount",usdAmountCents:"usdAmountCents",buzzType:"buzzType",paymentProvider:"paymentProvider",paymentTransactionId:"paymentTransactionId",buzzTransactionId:"buzzTransactionId",appId:"appId",appBlockId:"appBlockId",blockInstanceId:"blockInstanceId",scope:"scope",modelId:"modelId",rateCardVersion:"rateCardVersion",appOwnerShareCents:"appOwnerShareCents",platformShareCents:"platformShareCents",providerFeeCents:"providerFeeCents",appOwnerUserId:"appOwnerUserId",status:"status",voidedReason:"voidedReason",holdReason:"holdReason",heldAt:"heldAt",entryType:"entryType",attributedAt:"attributedAt",confirmedAt:"confirmedAt",voidedAt:"voidedAt",paidOutAt:"paidOutAt",payoutId:"payoutId"},a.Prisma.BlockAttributionPayoutScalarFieldEnum={id:"id",appOwnerUserId:"appOwnerUserId",periodKey:"periodKey",totalCents:"totalCents",rowCount:"rowCount",createdAt:"createdAt"},a.Prisma.BlockSpendAttributionScalarFieldEnum={id:"id",userId:"userId",buzzAmount:"buzzAmount",buzzType:"buzzType",grossValueCents:"grossValueCents",workflowId:"workflowId",appId:"appId",appBlockId:"appBlockId",blockInstanceId:"blockInstanceId",modelId:"modelId",rateCardVersion:"rateCardVersion",spendSharePct:"spendSharePct",appOwnerShareCents:"appOwnerShareCents",appOwnerUserId:"appOwnerUserId",contentAuthorUserId:"contentAuthorUserId",sharedContentKey:"sharedContentKey",generationType:"generationType",status:"status",voidedReason:"voidedReason",attributedAt:"attributedAt",confirmedAt:"confirmedAt",voidedAt:"voidedAt",paidOutAt:"paidOutAt",payoutId:"payoutId"},a.Prisma.BlockAuthorFeeAccrualScalarFieldEnum={id:"id",workflowId:"workflowId",appId:"appId",appBlockId:"appBlockId",appOwnerUserId:"appOwnerUserId",viewerUserId:"viewerUserId",buzzType:"buzzType",feeBuzz:"feeBuzz",baseGenerationBuzz:"baseGenerationBuzz",flatLegBuzz:"flatLegBuzz",pctLegBuzz:"pctLegBuzz",governingLeg:"governingLeg",generationType:"generationType",status:"status",settlementKey:"settlementKey",accruedAt:"accruedAt",settledAt:"settledAt"},a.Prisma.BlockGoodPurchaseScalarFieldEnum={id:"id",userId:"userId",appId:"appId",appBlockId:"appBlockId",blockInstanceId:"blockInstanceId",goodId:"goodId",manifestVersion:"manifestVersion",priceBuzz:"priceBuzz",bluePaidBuzz:"bluePaidBuzz",appOwnerUserId:"appOwnerUserId",appOwnerShareBuzz:"appOwnerShareBuzz",platformShareBuzz:"platformShareBuzz",buzzTransactionId:"buzzTransactionId",payouts:"payouts",status:"status",refundReason:"refundReason",refundedAt:"refundedAt",createdAt:"createdAt"},a.Prisma.BlockGoodEntitlementScalarFieldEnum={id:"id",userId:"userId",appBlockId:"appBlockId",goodId:"goodId",kind:"kind",payload:"payload",purchaseId:"purchaseId",grantedAt:"grantedAt",revokedAt:"revokedAt",revokeReason:"revokeReason"},a.Prisma.BlockSubscriptionAttributionScalarFieldEnum={id:"id",userId:"userId",buzzAmount:"buzzAmount",buzzType:"buzzType",grossValueCents:"grossValueCents",paymentProvider:"paymentProvider",invoiceId:"invoiceId",subscriptionId:"subscriptionId",billingReason:"billingReason",periodStart:"peri
12odStart",periodEnd:"periodEnd",appId:"appId",appBlockId:"appBlockId",blockInstanceId:"blockInstanceId",scope:"scope",modelId:"modelId",tier:"tier",rateCardVersion:"rateCardVersion",subscriptionSharePct:"subscriptionSharePct",appOwnerShareCents:"appOwnerShareCents",platformShareCents:"platformShareCents",providerFeeCents:"providerFeeCents",appOwnerUserId:"appOwnerUserId",status:"status",entryType:"entryType",voidedReason:"voidedReason",attributedAt:"attributedAt",confirmedAt:"confirmedAt",voidedAt:"voidedAt",paidOutAt:"paidOutAt",payoutId:"payoutId"},a.Prisma.BlockScopeInvocationScalarFieldEnum={id:"id",userId:"userId",appBlockId:"appBlockId",syntheticAppId:"syntheticAppId",blockInstanceId:"blockInstanceId",oauthClientId:"oauthClientId",source:"source",scope:"scope",endpoint:"endpoint",statusCode:"statusCode",detail:"detail",invokedAt:"invokedAt"},a.Prisma.AppUserScopeGrantScalarFieldEnum={id:"id",userId:"userId",appBlockId:"appBlockId",version:"version",grantedScopes:"grantedScopes",grantedAt:"grantedAt",revokedAt:"revokedAt",revokedScopes:"revokedScopes",revokedScopesAt
12:"revokedScopesAt",buzzBudgetPerDay:"buzzBudgetPerDay"},a.Prisma.AppDevForgejoIdentityScalarFieldEnum={userId:"userId",forgejoUsername:"forgejoUsername",forgejoTokenEncrypted:"forgejoTokenEncrypted",createdAt:"createdAt"},a.Prisma.OauthConsentScalarFieldEnum={id:"id",userId:"userId",clientId:"clientId",scope:"scope",buzzLimit:"buzzLimit",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.TrustedSpokeDomainScalarFieldEnum={id:"id",domain:"domain",includeSubdomains:"includeSubdomains",label:"label",enabled:"enabled",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.AdTokenScalarFieldEnum={id:"id",token:"token",userId:"userId",createdAt:"createdAt",expiresAt:"expiresAt"},a.Prisma.CommentScalarFieldEnum={id:"id",content:"content",createdAt:"createdAt",updatedAt:"updatedAt",nsfw:"nsfw",tosViolation:"tosViolation",parentId:"parentId",userId:"userId",modelId:"modelId",locked:"locked",hidden:"hidden",pinnedAt:"pinnedAt"},a.Prisma.CommentReactionScalarFieldEnum={id:"id",commentId:"commentId",userId:"userId",reaction:"reaction",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.UserNotificationSettingsScalarFieldEnum={id:"id",userId:"userId",type:"type",disabledAt:"disabledAt"},a.Prisma.PushSubscriptionScalarFieldEnum={id:"id",userId:"userId",endpoint:"endpoint",p256dh:"p256dh",auth:"auth",userAgent:"userAgent",createdAt:"createdAt",lastSeenAt:"lastSeenAt",lastSuccessAt:"lastSuccessAt",failureCount:"failureCount"},a.Prisma.UserPushSettingScalarFieldEnum={userId:"userId",type:"type",createdAt:"createdAt"},a.Prisma.WebhookScalarFieldEnum={id:"id",url:"url",notifyOn:"notifyOn",active:"active",createdAt:"createdAt",updatedAt:"updatedAt",userId:"userId"},a.Prisma.QuestionScalarFieldEnum={id:"id",userId:"userId",createdAt:"createdAt",updatedAt:"updatedAt",title:"title",content:"content",selectedAnswerId:"selectedAnswerId"},a.Prisma.QuestionMetricScalarFieldEnum={questionId:"questionId",timeframe:"timeframe",heartCount:"heartCount",commentCount:"commentCount",answerCount:"answerCount"},a.Prisma.AnswerScalarFieldEnum={id:"id",questionId:"questionId",userId:"userId",content:"content",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.AnswerVoteScalarFieldEnum={answerId:"answerId",userId:"userId",vote:"vote",createdAt:"createdAt"},a.Prisma.AnswerMetricScalarFieldEnum={answerId:"answerId",timeframe:"timeframe",checkCount:"checkCount",crossCount:"crossCount",heartCount:"heartCount",commentCount:"commentCount"},a.Prisma.CommentV2ScalarFieldEnum={id:"id",content:"content",createdAt:"createdAt",updatedAt:"updatedAt",nsfw:"nsfw",tosViolation:"tosViolation",userId:"userId",threadId:"threadId",metadata:"metadata",hidden:"hidden",pinnedAt:"pinnedAt",reactionCount:"reactionCount"},a.Prisma.ThreadScalarFieldEnum={id:"id",locked:"locked",parentThreadId:"parentThreadId",rootThreadId:"rootThreadI
12d",questionId:"questionId",answerId:"answerId",imageId:"imageId",postId:"postId",reviewId:"reviewId",commentId:"commentId",modelId:"modelId",articleId:"articleId",bountyId:"bountyId",bountyEntryId:"bountyEntryId",clubPostId:"clubPostId",comicProjectId:"comicProjectId",comicChapterPosition:"comicChapterPosition",challengeId:"challengeId",model3dId:"model3dId",model3dReviewId:"model3dReviewId",appListingId:"appListingId",metadata:"metadata",commentCount:"commentCount"},a.Prisma.ThreadMuteScalarFieldEnum={userId:"userId",threadId:"threadId",mutedAt:"mutedAt"},a.Prisma.QuestionReactionScalarFieldEnum={id:"id",questionId:"questionId",userId:"userId",reaction:"reaction",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.AnswerReactionScalarFieldEnum={id:"id",answerId:"answerId",userId:"userId",reaction:"reaction",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.CommentV2ReactionScalarFieldEnum={id:"id",commentId:"commentId",userId:"userId",reaction:"reaction",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ImageReactionScalarFieldEnum={id:"id",imageId:"imageId",userId:"userId",reaction:"reaction",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.PostReactionScalarFieldEnum={id:"id",postId:"postId",userId:"userId",reaction:"reaction",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ArticleReactionScalarFieldEnum={id:"id",articleId:"articleId",userId:"userId",reaction:"reaction",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.TagEngagementScalarFieldEnum={userId:"userId",tagId:"tagId",type:"type",createdAt:"createdAt"},a.Prisma.AnnouncementScalarFieldEnum={id:"id",title:"title",content:"content",emoji:"emoji",color:"color",domain:"domain",createdAt:"createdAt",updatedAt:"updatedAt",startsAt:"startsAt",endsAt:"endsAt",metadata:"metadata",disabled:"disabled",userId:"userId",coverId:"coverId",profileOnly:"profileOnly"},a.Prisma.AnnouncementSpendScalarFieldEnum={id:"id",userId:"userId",announcementId:"announcementId",createdAt:"createdAt"},a.Prisma.UserAnnouncementMuteScalarFieldEnum={userId:"userId",creatorId:"creatorId",createdAt:"createdAt"},a.Prisma.AnnouncementUserScalarFieldEnum={announcementId:"announcementId",userId:"userId"},a.Prisma.AnnouncementDismissalScalarFieldEnum={announcementId:"announcementId",userId:"userId",dismissedAt:"dismissedAt"},a.Prisma.RewardsBonusEventScalarFieldEnum={id:"id",name:"name",description:"description",multiplier:"multiplier",articleId:"articleId",bannerLabel:"bannerLabel",enabled:"enabled",startsAt:"startsAt",endsAt:"endsAt",createdById:"createdById",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.CosmeticScalarFieldEnum={id:"id",name:"name",description:"description",videoUrl:"videoUrl",type:"type",source:"source",permanentUnlock:"permanentUnlock",data:"data",createdAt:"createdAt",updatedAt:"updatedAt",availableStart:"availableStart",availableEnd:"availableEnd",availableQuery:"availableQuery",productId:"productId",leaderboardId:"leaderboardId",leaderboardPosition:"leaderboardPosition",createdById:"createdById",pHash:"pHash",pHashUrl:"pHashUrl",pHashHex:"pHashHex",pHashVersion:"pHashVersion",pHashFailedAt:"pHashFailedAt",flags:"flags"},a.Prisma.UserCosmeticScalarFieldEnum={userId:"userId",cosmeticId:"cosmeticId",obtainedAt:"obtainedAt",equippedAt:"equippedAt",data:"data",claimKey:"claimKey",equippedToId:"equippedToId",equippedToType:"equippedToType",forId:"forId",forType:"forType",remaining:"remaining"},a.Prisma.CosmeticShopSectionScalarFieldEnum={id:"id",addedById:"addedById",title:"title",description:"description",placement:"placement",meta:"meta",imageId:"imageId",published:"published"},a.Prisma.CosmeticShopItemScalarFieldEnum={id:"id",cosmeticId:"cosmeticId",unitAmount:"unitAmount",addedById:"addedById",createdAt:"createdAt",availableFrom:"availableFrom",availableTo:"availableTo",availableQuantity:"availableQuantity",meta:"meta",title:"title",description:"description",archivedAt:"archivedAt",status:"status",reviewedById:"reviewedById",reviewedAt:"reviewedAt",rejectionReason:"rejectionReason",listed:"listed"},a.Prisma.UserCosmeticShopItemResaleScalarFieldEnum={userId:"userId",shopItemId:"shopItemId",sellerShare:"sellerShare",index:"index",createdAt:"createdAt"},a.Prisma.CosmeticShopItemCosmeticScalarFieldEnum={shopItemId:"shopItemId",cosmeticId:"cosmeticId",index:"index",floorAmou
12nt:"floorAmount"},a.Prisma.UserCosmeticShopItemWishlistScalarFieldEnum={userId:"userId",shopItemId:"shopItemId",createdAt:"createdAt"},a.Prisma.CosmeticShopSectionItemScalarFieldEnum={shopItemId:"shopItemId",shopSectionId:"shopSectionId",index:"index",createdAt:"createdAt"},a.Prisma.UserCosmeticShopPurchasesScalarFieldEnum={userId:"userId",cosmeticId:"cosmeticId",shopItemId:"shopItemId",unitAmount:"unitAmount",purchasedAt:"purchasedAt",buzzTransactionId:"buzzTransactionId",refunded:"refunded",meta:"meta"},a.Prisma.UserCosmeticShopPurchaseCosmeticScalarFieldEnum={buzzTransactionId:"buzzTransactionId",cosmeticId:"cosmeticId",unitAmount:"unitAmount",meta:"meta"},a.Prisma.BuzzClaimScalarFieldEnum={key:"key",title:"title",description:"description",transactionIdQuery:"transactionIdQuery",amount:"amount",availableStart:"availableStart",availableEnd:"availableEnd",claimed:"claimed",limit:"limit",accountType:"accountType",useMultiplier:"useMultiplier"},a.Prisma.ArticleScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",nsfw:"nsfw",tosViolation:"tosViolation",metadata:"metadata",title:"title",content:"content",cover:"cover",coverId:"coverId",publishedAt:"publishedAt",contentScannedAt:"contentScannedAt",ingestion:"ingestion",scanRequestedAt:"scanRequestedAt",userId:"userId",availability:"availability",unlisted:"unlisted",nsfwLevel:"nsfwLevel",userNsfwLevel:"userNsfwLevel",moderatorNsfwLevel:"moderatorNsfwLevel",moderatorNsfwLevelBasis:"moderatorNsfwLevelBasis",lockedProperties:"lockedProperties",isOfficial:"isOfficial",status:"status"},a.Prisma.PressMentionScalarFieldEnum={id:"id",title:"title",url:"url",source:"source",publishedAt:"publishedAt",createdAt:"createdAt"},a.Prisma.ArticleEngagementScalarFieldEnum={userId:"userId",articleId:"articleId",type:"type",createdAt:"createdAt"},a.Prisma.ArticleMetricScalarFieldEnum={articleId:"articleId",timeframe:"timeframe",likeCount:"likeCount",dislikeCount:"dislikeCount",laughCount:"laughCount",cryCount:"cryCount",heartCount:"heartCount",commentCount:"commentCount",viewCount:"viewCount",favoriteCount:"favoriteCount",hideCount:"hideCount",collectedCount:"collectedCount",tippedCount:"tippedCount",tippedAmountCount:"tippedAmountCount",updatedAt:"updatedAt"},a.Prisma.LeaderboardScalarFieldEnum={id:"id",index:"index",title:"title",description:"description",scoringDescription:"scoringDescription",query:"query",active:"active",public:"public",domain:"domain"},a.Prisma.LeaderboardResultScalarFieldEnum={leaderboardId:"leaderboardId",date:"date",position:"position",userId:"userId",score:"score",metrics:"metrics",createdAt:"createdAt"},a.Prisma.ModelVersionExplorationScalarFieldEnum={index:"index",name:"name",prompt:"prompt",modelVersionId:"modelVersionId"},a.Prisma.GenerationServiceProviderScalarFieldEnum={name:"name",schedulers:"schedulers"},a.Prisma.CollectionScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",name:"name",description:"description",nsfw:"nsfw",userId:"userId",imageId:"imageId",write:"write",read:"read",type:"type",mode:"mode",metadata:"metadata",availability:"availability",nsfwLevel:"nsfwLevel",collaborationDisabledAt:"collaborationDisabledAt"},a.Prisma.CollectionItemScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",collectionId:"collectionId",articleId:"articleId",postId:"postId",imageId:"imageId",modelId:"modelId",model3dId:"model3dId",addedById:"addedById",reviewedById:"reviewedById",reviewedAt:"reviewedAt",note:"note",status:"status",rejectionReason:"rejectionReason",rejectionDetail:"rejectionDetail",tagId:"tagId"},a.Prisma.CollectionItemScoreScalarFieldEnum={userId:"userId",collectionItemId:"collectionItemId",score:"score",createdAt:"createdAt"},a.Prisma.CollectionContributorScalarFieldEnum={createdAt:"createdAt",updatedAt:"updatedAt",userId:"userId",collectionId:"collectionId",permissions:"permissions"},a.Prisma.CollectionInviteScalarFieldEnum={id:"id",collectionId:"collectionId",userId:"userId",invitedById:"invitedById",role:"role",status:"status",createdAt:"createdAt",respondedAt:"respondedAt"},a.Prisma.TagsOnCollectionScalarFieldEnum={collectionId:"collectionId",tagId:"tagId",createdAt:"createdAt",filterableOnly:"filterableOnly"},a.Prisma.HomeBlockScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",userId:"userId",metadata:"metadata",index:"index",type:"type",permanent:"permanent",s
12ourceId:"sourceId"},a.Prisma.BuzzTipScalarFieldEnum={entityType:"entityType",entityId:"entityId",toUserId:"toUserId",fromUserId:"fromUserId",amount:"amount",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.BountyScalarFieldEnum={id:"id",userId:"userId",name:"name",description:"description",startsAt:"startsAt",expiresAt:"expiresAt",createdAt:"createdAt",updatedAt:"updatedAt",details:"details",mode:"mode",entryMode:"entryMode",type:"type",minBenefactorUnitAmount:"minBenefactorUnitAmount",maxBenefactorUnitAmount:"maxBenefactorUnitAmount",entryLimit:"entryLimit",nsfw:"nsfw",poi:"poi",complete:"complete",refunded:"refunded",availability:"availability",nsfwLevel:"nsfwLevel",lockedProperties:"lockedProperties"},a.Prisma.BountyEntryScalarFieldEnum={id:"id",userId:"userId",bountyId:"bountyId",createdAt:"createdAt",updatedAt:"updatedAt",locked:"locked",description:"description",nsfwLevel:"nsfwLevel"},a.Prisma.BountyEntryReactionScalarFieldEnum={bountyEntryId:"bountyEntryId",userId:"userId",reaction:"reaction",createdAt:"createdAt"},a.Prisma.BountyBenefactorScalarFieldEnum={userId:"userId",bountyId:"bountyId",unitAmount:"unitAmount",createdAt:"createdAt",updatedAt:"updatedAt",awardedAt:"awardedAt",awardedToId:"awardedToId",currency:"currency",buzzTransactionId:"buzzTransactionId"},a.Prisma.BountyEngagementScalarFieldEnum={userId:"userId",bountyId:"bountyId",type:"type",createdAt:"createdAt"},a.Prisma.TipConnectionScalarFieldEnum={transactionId:"transactionId",entityId:"entityId",entityType:"entityType"},a.Prisma.BountyMetricScalarFieldEnum={bountyId:"bountyId",timeframe:"timeframe",favoriteCount:"favoriteCount",trackCount:"trackCount",entryCount:"entryCount",benefactorCount:"benefactorCount",unitAmountCount:"unitAmountCount",commentCount:"commentCount",updatedAt:"updatedAt"},a.Prisma.BountyEntryMetricScalarFieldEnum={bountyEntryId:"bountyEntryId",timeframe:"timeframe",likeCount:"likeCount",dislikeCount:"dislikeCount",laughCount:"laughCount",cryCount:"cryCount",heartCount:"heartCount",unitAmountCount:"unitAmountCount",tippedCount:"tippedCount",tippedAmountCount:"tippedAmountCount",updatedAt:"updatedAt"},a.Prisma.CsamReportScalarFieldEnum={id:"id",userId:"userId",createdAt:"createdAt",reportedById:"reportedById",reportSentAt:"reportSentAt",archivedAt:"archivedAt",contentRemovedAt:"contentRemovedAt",reportId:"reportId",details:"details",images:"images",type:"type"},a.Prisma.LinkScalarFieldEnum={id:"id",url:"url",type:"type",entityId:"entityId",entityType:"entityType"},a.Prisma.EntityAccessScalarFieldEnum={accessToId:"accessToId",accessToType:"accessToType",accessorId:"accessorId",accessorType:"accessorType",addedById:"addedById",addedAt:"addedAt",permissions:"permissions",meta:"meta"},a.Prisma.PaidAccessScalarFieldEnum={entityType:"entityType",entityId:"entityId",ownerId:"ownerId",endsAt:"endsAt",timeframeDays:"timeframeDays",terms:"terms",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ModelVersionSaleScalarFieldEnum={id:"id",userId:"userId",name:"name",discountType:"discountType",discountAmount:"discountAmount",startsAt:"startsAt",endsAt:"endsAt",canceledAt:"canceledAt",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ModelVersionSaleItemScalarFieldEnum={saleId:"saleId",modelVersionId:"modelVersionId"},a.Prisma.EntityCollaboratorScalarFieldEnum={entityType:"entityType",entityId:"entityId",userId:"userId",status:"status",createdAt:"createdAt",createdBy:"createdBy",lastMessageSentAt:"lastMessageSentAt"},a.Prisma.EcosystemCheckpointsScalarFieldEnum={id:"id",name:"name"},a.Prisma.GenerationBaseModelScalarFieldEnum={baseModel:"baseModel"},a.Prisma.ClubScalarFieldEnum={id:"id",userId:"userId",coverImageId:"coverImageId",headerImageId:"headerImageId",avatarId:"avatarId",name:"name",description:"description",nsfw:"nsfw",billing:"billing",unlisted:"unlisted"},a.Prisma.ClubTierScalarFieldEnum={id:"id",clubId:"clubId",unitAmount:"unitAmount",currency:"currency",name:"name",description:"description",coverImageId:"coverImageId",unlisted:"unlisted",joinable:"joinable",createdAt:"createdAt",updatedAt:"updatedAt",memberLimit:"memberLimit",oneTimeFee:"oneTimeFee"},a.Prisma.ClubAdminInviteScalarFieldEnum={id:"id",expiresAt:"expiresAt",clubId:"clubId",createdAt:"createdAt",permissions:"permissions"},a.Prisma.ClubAdminScalarFieldEnum={userId:"userId",clubId:"clubId",createdAt:"createdAt",permissions:"permissions"},a.Prisma.ClubMembershipScalarFieldEnum={id:"id",userId:"userId",clubId:"clubId",clubTierId:"clubTierId",startedAt:"startedAt",expiresAt:"expiresAt",cancelledAt:"cancelledAt",nextBillingAt:"nextBillingAt",unitAmou
12nt:"unitAmount",currency:"currency",downgradeClubTierId:"downgradeClubTierId",billingPausedAt:"billingPausedAt"},a.Prisma.ClubMembershipChargeScalarFieldEnum={id:"id",userId:"userId",clubId:"clubId",clubTierId:"clubTierId",chargedAt:"chargedAt",status:"status",invoiceId:"invoiceId",unitAmount:"unitAmount",unitAmountPurchased:"unitAmountPurchased",currency:"currency"},a.Prisma.ClubPostScalarFieldEnum={id:"id",clubId:"clubId",createdById:"createdById",createdAt:"createdAt",membersOnly:"membersOnly",title:"title",description:"description",coverImageId:"coverImageId",entityId:"entityId",entityType:"entityType"},a.Prisma.ClubPostReactionScalarFieldEnum={id:"id",clubPostId:"clubPostId",userId:"userId",reaction:"reaction",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ClubPostMetricScalarFieldEnum={clubPostId:"clubPostId",timeframe:"timeframe",likeCount:"likeCount",dislikeCount:"dislikeCount",laughCount:"laughCount",cryCount:"cryCount",heartCount:"heartCount"},a.Prisma.ClubMetricScalarFieldEnum={clubId:"clubId",timeframe:"timeframe",memberCount:"memberCount",clubPostCount:"clubPostCount",resourceCount:"resourceCount"},a.Prisma.ChatScalarFieldEnum={id:"id",createdAt:"createdAt",hash:"hash",ownerId:"ownerId",isGroup:"isGroup",name:"name"},a.Prisma.ChatMemberScalarFieldEnum={id:"id",createdAt:"createdAt",userId:"userId",chatId:"chatId",isOwner:"isOwner",isMuted:"isMuted",status:"status",lastViewedMessageId:"lastViewedMessageId",joinedAt:"joinedAt",ignoredAt:"ignoredAt",leftAt:"leftAt",kickedAt:"kickedAt",unkickedAt:"unkickedAt",filteredAt:"filteredAt",notifyLevel:"notifyLevel",pinnedAt:"pinnedAt",clearedAt:"clearedAt"},a.Prisma.ChatMessageScalarFieldEnum={id:"id",createdAt:"createdAt",userId:"userId",chatId:"chatId",content:"content",contentType:"contentType",referenceMessageId:"referenceMessageId",editedAt:"editedAt",deletedAt:"deletedAt"},a.Prisma.BuildGuideScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",name:"name",message:"message",userId:"userId",components:"components",capabilities:"capabilities"},a.Prisma.PurchasableRewardScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",title:"title",unitPrice:"unitPrice",about:"about",redeemDetails:"redeemDetails",termsOfUse:"termsOfUse",usage:"usage",codes:"codes",archived:"archived",availableFrom:"availableFrom",availableTo:"availableTo",availableCount:"availableCount",addedById:"addedById",coverImageId:"coverImageId"},a.Prisma.UserPurchasedRewardsScalarFieldEnum={buzzTransactionId:"buzzTransactionId",userId:"userId",purchasableRewardId:"purchasableRewardId",createdAt:"createdAt",meta:"meta",code:"code"},a.Prisma.JobQueueScalarFieldEnum={type:"type",entityType:"entityType",entityId:"entityId",createdAt:"createdAt"},a.Prisma.VaultItemScalarFieldEnum={id:"id",vaultId:"vaultId",status:"status",files:"files",modelVersionId:"modelVersionId",modelId:"modelId",modelName:"modelName",versionName:"versionName",creatorId:"creatorId",creatorName:"creatorName",type:"type",baseModel:"baseModel",category:"category",createdAt:"createdAt",addedAt:"addedAt",refreshedAt:"refreshedAt",modelSizeKb:"modelSizeKb",detailsSizeKb:"detailsSizeKb",imagesSizeKb:"imagesSizeKb",notes:"notes",meta:"meta"},a.Prisma.VaultScalarFieldEnum={userId:"userId",storageKb:"storageKb",createdAt:"createdAt",updatedAt:"updatedAt",meta:"meta"},a.Prisma.UserStorageUsageScalarFieldEnum={userId:"userId",kind:"kind",publicStatus:"publicStatus",baseModel:"baseModel",month:"month",fileCount:"fileCount",bytes:"bytes",computedAt:"computedAt"},a.Prisma.UserStorageRollupScalarFieldEnum={userId:"userId",imagesRequestedAt:"imagesRequestedAt",imagesStartedAt:"imagesStartedAt",imagesComputedAt:"imagesComputedAt"},a.Prisma.UserStorageSnapshotScalarFieldEnum={userId:"userId",date:"date",kind:"kind",fileCount:"fileCount",bytes:"bytes"},a.Prisma.RedeemableCodeScalarFieldEnum={code:"code",unitValue:"unitValue",userId:"userId",createdAt:"createdAt",type:"type",expiresAt:"expiresAt",redeemedAt:"redeemedAt",transactionId:"transactionId",metadata:"metadata",priceId:"priceId"},a.Prisma.ToolScalarFieldEnum={id:"id",name:"name",icon:"icon",createdAt:"createdAt",enabled:"enabled",unlisted:"unlisted",type:"type",domain:"domain",priority:"priority",description:"description",supported:"supported",company:"company",metadata:"metadata",alias:"al
12ias"},a.Prisma.ImageToolScalarFieldEnum={imageId:"imageId",toolId:"toolId",notes:"notes",createdAt:"createdAt"},a.Prisma.TechniqueScalarFieldEnum={id:"id",name:"name",createdAt:"createdAt",enabled:"enabled",type:"type"},a.Prisma.ImageTechniqueScalarFieldEnum={imageId:"imageId",techniqueId:"techniqueId",notes:"notes",createdAt:"createdAt"},a.Prisma.DonationGoalScalarFieldEnum={id:"id",userId:"userId",title:"title",description:"description",goalAmount:"goalAmount",entityType:"entityType",entityId:"entityId",modelVersionId:"modelVersionId",createdAt:"createdAt",active:"active"},a.Prisma.DonationScalarFieldEnum={id:"id",userId:"userId",donationGoalId:"donationGoalId",amount:"amount",buzzTransactionId:"buzzTransactionId",notes:"notes",createdAt:"createdAt"},a.Prisma.BlocklistScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",type:"type",data:"data"},a.Prisma.AppealScalarFieldEnum={id:"id",userId:"userId",entityType:"entityType",entityId:"entityId",status:"status",appealMessage:"appealMessage",createdAt:"createdAt",updatedAt:"updatedAt",resolvedAt:"resolvedAt",resolvedBy:"resolvedBy",resolvedMessage:"resolvedMessage",internalNotes:"internalNotes",buzzTransactionId:"buzzTransactionId"},a.Prisma.AuctionBaseScalarFieldEnum={id:"id",type:"type",ecosystem:"ecosystem",name:"name",slug:"slug",quantity:"quantity",minPrice:"minPrice",active:"active",runForDays:"runForDays",validForDays:"validForDays",description:"description"},a.Prisma.AuctionScalarFieldEnum={id:"id",auctionBaseId:"auctionBaseId",startAt:"startAt",endAt:"endAt",quantity:"quantity",minPrice:"minPrice",validFrom:"validFrom",validTo:"validTo",finalized:"finalized"},a.Prisma.BidScalarFieldEnum={id:"id",auctionId:"auctionId",userId:"userId",entityId:"entityId",amount:"amount",createdAt:"createdAt",deleted:"deleted",transactionIds:"transactionIds",isRefunded:"isRefunded",fromRecurring:"fromRecurring",accountType:"accountType"},a.Prisma.BidRecurringScalarFieldEnum={id:"id",auctionBaseId:"auctionBaseId",userId:"userId",entityId:"entityId",amount:"amount",createdAt:"createdAt",startAt:"startAt",endAt:"endAt",isPaused:"isPaused",accountType:"accountType"},a.Prisma.FeaturedModelVersionScalarFieldEnum={id:"id",modelVersionId:"modelVersionId",validFrom:"validFrom",validTo:"validTo",position:"position"},a.Prisma.CoveredCheckpointScalarFieldEnum={model_id:"model_id",version_id:"version_id"},a.Prisma.ModerationRuleScalarFieldEnum={id:"id",entityType:"entityType",definition:"definition",action:"action",createdAt:"createdAt",updatedAt:"updatedAt",enabled:"enabled",order:"order",reason:"reason",createdById:"createdById"},a.Prisma.ChangelogScalarFieldEnum={id:"id",title:"title",content:"content",link:"link",cta:"cta",effectiveAt:"effectiveAt",createdAt:"createdAt",updatedAt:"updatedAt",type:"type",tags:"tags",disabled:"disabled",titleColor:"titleColor",sticky:"sticky",domain:"domain"},a.Prisma.BugScalarFieldEnum={id:"id",title:"title",summary:"summary",content:"content",status:"status",clickupUrl:"clickupUrl",firstSeenAt:"firstSeenAt",resolvedAt:"resolvedAt",publishedAt:"publishedAt",createdAt:"createdAt",updatedAt:"updatedAt",disabled:"disabled",domain:"domain",tags:"tags"},a.Prisma.NewOrderPlayerScalarFieldEnum={userId:"userId",rankType:"rankType",startAt:"startAt",exp:"exp",fervor:"fervor"},a.Prisma.NewOrderRankScalarFieldEnum={type:"type",name:"name",minExp:"minExp",createdAt:"createdAt",updatedAt:"updatedAt",iconUrl:"iconUrl"},a.Prisma.NewOrderSmiteScalarFieldEnum={id:"id",targetPlayerId:"targetPlayerId",givenById:"givenById",size:"size",remaining:"remaining",reason:"reason",createdAt:"createdAt",cleansedAt:"cleansedAt",cleansedReason:"cleansedReason"},a.Prisma.ReportAutomatedScalarFieldEnum={id:"id",reportId:"reportId",metadata:"metadata",createdAt:"createdAt"},a.Prisma.RestrictedBaseModelsScalarFieldEnum={baseModel:"baseModel"},a.Prisma.ChallengeScalarFieldEnum={id:"id",startsAt:"startsAt",endsAt:"endsAt",visibleAt:"visibleAt",title:"title",description:"description",theme:"theme",invitation:"invitation",coverImageId:"coverImageId",nsfwLevel:"nsfwLevel",modelVersionIds:"modelVersionIds",allowedNsfwLevel:"allowedNsfwLevel",judgingPrompt:"judgingPrompt",judgingCategories:"judgingCategories",reviewPercentage:"reviewPercentage",maxReviews:"maxReviews",judgingEngine:"judgingEngine",collectionId:"collectionId",maxEntriesPerUser:"maxEntriesPerUser",maxParticipants:"maxParticipants",prizes:"prizes",entryPrize:"entryPrize",entryPrizeRequirement:"entryPrizeRequirement",prizePool:"prizePool",prizeMode:"prizeMode",basePrizePool:"basePrizePool",buzzPerAction:"buzzPerAction",poolTrigger:"poolTrigger",maxPrizePool:"maxPrizePool",prizeDistribution:"prizeDistribution",operationBudget:"operationBudget",operationSpent:"operationSpent",reviewCostType:"reviewCostType",reviewCost:"reviewCost",entryFee:"entryFee",buzzType:"buzzType",createdById:"createdById",source:"source",judgeId:"judgeId",status:"status",ingestion:"ingestion",scannedAt:"scannedAt",metadata:"metadata",createdAt:"createdAt",updatedAt:"updatedAt",eventId:"eventId"},a.Prisma.ChallengeEntryStandingScalarFieldEnum={challengeId:"challengeId",imageId:"imageId",userId:"userId",rank:"rank",comparisons:"comparisons",winRate:"winRate",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ChallengeEntryComparisonScalarFieldEnum={id:"id",challengeId:"challengeId",phase:"phase",imageIdA:"imageIdA",imageIdB:"imageIdB",firstSeatImageId:"firstSeatImageId",winnerImageId:"winnerImageId",margin:"margin",model:"model",rerouted:"rerouted",perCategory:"perCategory",reason:"reason",buzzCost:"buzzCost",createdAt:"createdAt"},a.Prisma.ChallengeReportScalarFieldEnum={challengeId:"challengeId",reportId:"reportId"},a.Prisma.AnnouncementReportScalarFieldEnum={announcementId:"announcementId",reportId:"reportId"},a.Prisma.ChallengeJudgeScalarFieldEnum={id:"id",userId:"userId",name:"name",bio:"bio",sourceCollectionId:"sourceCollectionId",systemPrompt:"systemPrompt",collectionPrompt:"collectionPrompt",contentPrompt:"contentPrompt",reviewPrompt:"reviewPrompt",reviewTemplate:"reviewTemplate",winnerSelectionPrompt:"winnerSelectionPrompt",active:"active",userSelectable:"userSelectable",judgingEngine:"judgingEngine",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ChallengeCategoryScalarFieldEnum={key:"key",label:"label",group:"group",criteria:"criteria",rubric:"rubric",rubricNsfw:"rubricNsfw",sortOrder:"sortOrder",active:"active",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ChallengeEngagementScalarFieldEnum={userId:"userId",challengeId:"challengeId",type:"type",createdAt:"createdAt"},a.Prisma.ChallengeWinnerScalarFieldEnum={id:"id",challengeId:"challengeId",userId:"userId",imageId:"imageId",place:"place",buzzAwarded:"buzzAwarded",pointsAwarded:"pointsAwarded",reason:"reason",createdAt:"createdAt"}
12,a.Prisma.ChallengeEventScalarFieldEnum={id:"id",title:"title",description:"description",titleColor:"titleColor",startDate:"startDate",endDate:"endDate",active:"active",winnerCooldownDays:"winnerCooldownDays",coverImageId:"coverImageId",createdById:"createdById",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.QuestionRankScalarFieldEnum={questionId:"questionId",answerCountDay:"answerCountDay",answerCountWeek:"answerCountWeek",answerCountMonth:"answerCountMonth",answerCountYear:"answerCountYear",answerCountAllTime:"answerCountAllTime",heartCountDay:"heartCountDay",heartCountWeek:"heartCountWeek",heartCountMonth:"heartCountMonth",heartCountYear:"heartCountYear",heartCountAllTime:"heartCountAllTime",commentCountDay:"commentCountDay",commentCountWeek:"commentCountWeek",commentCountMonth:"commentCountMonth",commentCountYear:"commentCountYear",commentCountAllTime:"commentCountAllTime",answerCountDayRank:"answerCountDayRank",answerCountWeekRank:"answerCountWeekRank",answerCountMonthRank:"answerCountMonthRank",answerCountYearRank:"answerCountYearRank",answerCountAllTimeRank:"answerCountAllTimeRank",heartCountDayRank:"heartCountDayRank",heartCountWeekRank:"heartCountWeekRank",heartCountMonthRank:"heartCountMonthRank",heartCountYearRank:"heartCountYearRank",heartCountAllTimeRank:"heartCountAllTimeRank",commentCountDayRank:"commentCountDayRank",commentCountWeek
12Rank:"commentCountWeekRank",commentCountMonthRank:"commentCountMonthRank",commentCountYearRank:"commentCountYearRank",commentCountAllTimeRank:"commentCountAllTimeRank"},a.Prisma.AnswerRankScalarFieldEnum={answerId:"answerId",checkCountDay:"checkCountDay",checkCountWeek:"checkCountWeek",checkCountMonth:"checkCountMonth",checkCountYear:"checkCountYear",checkCountAllTime:"checkCountAllTime",crossCountDay:"crossCountDay",crossCountWeek:"crossCountWeek",crossCountMonth:"crossCountMonth",crossCountYear:"crossCountYear",crossCountAllTime:"crossCountAllTime",heartCountDay:"heartCountDay",heartCountWeek:"heartCountWeek",heartCountMonth:"heartCountMonth",heartCountYear:"heartCountYear",heartCountAllTime:"heartCountAllTime",commentCountDay:"commentCountDay",commentCountWeek:"commentCountWeek",commentCountMonth:"commentCountMonth",commentCountYear:"commentCountYear",commentCountAllTime:"commentCountAllTime",checkCountDayRank:"checkCountDayRank",checkCountWeekRank:"checkCountWeekRank",checkCountMonthRank:"checkCountMonthRank",checkCountYearRank:"checkCountYearRank",checkCountAllTimeRank:"checkCountAllTimeRank",crossCountDayRank:"crossCountDayRank",crossCountWeekRank:"crossCountWeekRank",crossCountMonthRank:"crossCountMonthRank",crossCountYearRank:"crossCountYearRank",crossCountAllTimeRank:"crossCountAllTimeRank",heartCountDayRank:"heartCountDayRank",heartCountWeekRank:"heartCountWeekRank",heartCountMonthRank:"heartCountMonthRank",heartCountYearRank:"heartCountYearRank",heartCountAllTimeRank:"heartCountAllTimeRank",commentCountDayRank:"commentCountDayRank",commentCountWeek
12Rank:"commentCountWeekRank",commentCountMonthRank:"commentCountMonthRank",commentCountYearRank:"commentCountYearRank",commentCountAllTimeRank:"commentCountAllTimeRank"},a.Prisma.ModelReportStatScalarFieldEnum={modelId:"modelId",tosViolationPending:"tosViolationPending",tosViolationUnactioned:"tosViolationUnactioned",tosViolationActioned:"tosViolationActioned",nsfwPending:"nsfwPending",nsfwUnactioned:"nsfwUnactioned",nsfwActioned:"nsfwActioned",ownershipPending:"ownershipPending",ownershipProcessing:"ownershipProcessing",ownershipActioned:"ownershipActioned",ownershipUnactioned:"ownershipUnactioned",adminAttentionPending:"adminAttentionPending",adminAttentionActioned:"adminAttentionActioned",adminAttentionUnactioned:"adminAttentionUnactioned",claimPending:"claimPending",claimActioned:"claimActioned",claimUnactioned:"claimUnactioned"},a.Prisma.ArticleStatScalarFieldEnum={articleId:"articleId",cryCountDay:"cryCountDay",cryCountWeek:"cryCountWeek",cryCountMonth:"cryCountMonth",cryCountYear:"cryCountYear",cryCountAllTime:"cryCountAllTime",dislikeCountDay:"dislikeCountDay",dislikeCountWeek:"dislikeCountWeek",dislikeCountMonth:"dislikeCountMonth",dislikeCountYear:"dislikeCountYear",dislikeCountAllTime:"dislikeCountAllTime",heartCountDay:"heartCountDay",heartCountWeek:"heartCountWeek",heartCountMonth:"heartCountMonth",heartCountYear:"heartCountYear",heartCountAllTime:"heartCountAllTime",laughCountDay:"laughCountDay",laughCountWeek:"laughCountWeek",laughCountMonth:"laughCountMonth",laughCountYear:"laughCountYear",laughCountAllTime:"laughCountAllTime",likeCountDay:"likeCountDay",likeCountWeek:"likeCountWeek",likeCountMonth:"likeCountMonth",likeCountYear:"likeCountYear",likeCountAllTime:"likeCountAllTime",commentCountDay:"commentCountDay",commentCountWeek:"commentCountWeek",commentCountMonth:"commentCountMonth",commentCountYear:"commentCountYear",commentCountAllTime:"commentCountAllTime",reactionCountDay:"reactionCountDay",reactionCountWeek:"reactionCountWeek",reactionCountMonth:"reactionCountMonth",reactionCountYear:"reactionCountYear",reactionCountAllTime:"reactionCountAllTime",viewCountDay:"viewCountDay",viewCountWeek:"viewCountWeek",viewCountMonth:"viewCountMonth",viewCountYear:"viewCountYear",viewCountAllTime:"viewCountAllTime",favoriteCountDay:"favoriteCountDay",favoriteCountWeek:"favoriteCountWeek",favoriteCountMonth:"favoriteCountMonth",favoriteCountYear:"favoriteCountYear",favoriteCountAllTime:"favoriteCountAllTime",collectedCountDay:"collectedCountDay",collectedCountWeek:"collectedCountWeek",collectedCountMonth:"collectedCountMonth",collectedCountYear:"collectedCountYear",collectedCountAllTime:"collectedCountAllTime",hideCountDay:"hideCountDay",hideCountWeek:"hideCountWeek",hideCountMonth:"hideCountMonth",hideCountYear:"hideCountYear",hideCountAllTime:"hideCountAllTime",tippedCountDay:"tippedCountDay",tippedCountWeek:"tippedCountWeek",tippedCountMonth:"tippedCountMonth",tippedCountYear:"tippedCountYear",tippedCountAllTime:"tippedCountAllTime",tippedAmountCountDay:"tippedAmountCountDay",tippedAmountCountWeek:"tippedAmountCountWeek",tippedAmountCountMonth:"tippedAmountCountMonth",tippedAmountCountYear:"tippedAmountCountYear",tippedAmountCountAllTime:"tippedAmountCountAllTime"},a.Prisma.ArticleRankScalarFieldEnum={articleId:"articleId",cryCountDayRank:"cryCountDayRank",cryCountWeekRank:"cryCountWeekRank",cryCountMonthRank:"cryCountMonthRank",cryCountYearRank:"cryCountYearRank",cryCountAllTimeRank:"cryCountAllTimeRank",dislikeCountDayRank:"dislikeCountDayRank",dislikeCountWeekRank:"dislikeCountWeekRank",dislikeCountMonthRank:"dislikeCountMonthRank",dislikeCountYearRank:"dislikeCountYearRank",dislikeCountAllTimeRank:"dislikeCountAllTimeRank",heartCountDayRank:"heartCountDayRank",heartCountWeekRank:"heartCountWeekRank",heartCountMonthRank:"heartCountMonthRank",heartCountYearRank:"heartCountYearRank",heartCountAllTimeRank:"heartCountAllTimeRank",laughCountDayRank:"laughCountDayRank",laughCountWeekRank:"laughCountWeekRank",laughCountMonthRank:"laughCountMonthRank",laughCountYearRank:"laughCountYearRank",laughCountAllTimeRank:"laughCountAllTimeRank",likeCountDayRank:"likeCountDayRank",likeCountWeek
12Rank:"likeCountWeekRank",likeCountMonthRank:"likeCountMonthRank",likeCountYearRank:"likeCountYearRank",likeCountAllTimeRank:"likeCountAllTimeRank",commentCountDayRank:"commentCountDayRank",commentCountWeekRank:"commentCountWeekRank",commentCountMonthRank:"commentCountMonthRank",commentCountYearRank:"commentCountYearRank",commentCountAllTimeRank:"commentCountAllTimeRank",reactionCountDayRank:"reactionCountDayRank",reactionCountWeekRank:"reactionCountWeekRank",reactionCountMonthRank:"reactionCountMonthRank",reactionCountYearRank:"reactionCountYearRank",reactionCountAllTimeRank:"reactionCountAllTimeRank",viewCountDayRank:"viewCountDayRank",viewCountWeekRank:"viewCountWeekRank",viewCountMonthRank:"viewCountMonthRank",viewCountYearRank:"viewCountYearRank",viewCountAllTimeRank:"viewCountAllTimeRank",favoriteCountDayRank:"favoriteCountDayRank",favoriteCountWeekRank:"favoriteCountWeekRank",favoriteCountMonthRank:"favoriteCountMonthRank",favoriteCountYearRank:"favoriteCountYearRank",favoriteCountAllTimeRank:"favoriteCountAllTimeRank",hideCountDayRank:"hideCountDayRank",hideCountWeekRank:"hideCountWeekRank",hideCountMonthRank:"hideCountMonthRank",hideCountYearRank:"hideCountYearRank",hideCountAllTimeRank:"hideCountAllTimeRank",collectedCountDayRank:"collectedCountDayRank",collectedCountWeekRank:"collectedCountWeekRank",collectedCountMonthRank:"collectedCountMonthRank",collectedCountYearRank:"collectedCountYearRank",collectedCountAllTimeRank:"collectedCountAllTimeRank",tippedCountDayRank:"tippedCountDayRank",tippedCountWeekRank:"tippedCountWeekRank",tippedCountMonthRank:"tippedCountMonthRank",tippedCountYearRank:"tippedCountYearRank",tippedCountAllTimeRank:"tippedCountAllTimeRank",tippedAmountCountDayRank:"tippedAmountCountDayRank",tippedAmountCountWeekRank:"tippedAmountCountWeekRank",tippedAmountCountMonthRank:"tippedAmountCountMonthRank",tippedAmountCountYearRank:"tippedAmountCountYearRank",tippedAmountCountAllTimeRank:"tippedAmountCountAllTimeRank"},a.Prisma.UserStatScalarFieldEnum={userId:"userId",uploadCountAllTime:"uploadCountAllTime",reviewCountAllTime:"reviewCountAllTime",downloadCountAllTime:"downloadCountAllTime",generationCountAllTime:"generationCountAllTime",followingCountAllTime:"followingCountAllTime",followerCountAllTime:"followerCountAllTime",hiddenCountAllTime:"hiddenCountAllTime",answerCountAllTime:"answerCountAllTime",answerAcceptCountAllTime:"answerAcceptCountAllTime",thumbsUpCountAllTime:"thumbsUpCountAllTime",thumbsDownCountAllTime:"thumbsDownCountAllTime",reactionCountAllTime:"reactionCountAllTime"},a.Prisma.UserRankScalarFieldEnum={userId:"userId",leaderboardRank:"leaderboardRank",leaderboardId:"leaderboardId",leaderboardTitle:"leaderboardTitle",leaderboardCosmetic:"leaderboardCosmetic"},a.Prisma.TagStatScalarFieldEnum={tagId:"tagId",followerCountDay:"followerCountDay",followerCountWeek:"followerCountWeek",followerCountMonth:"followerCountMonth",followerCountYear:"followerCountYear",followerCountAllTime:"followerCountAllTime",hiddenCountDay:"hiddenCountDay",hiddenCountWeek:"hiddenCountWeek",hiddenCountMonth:"hiddenCountMonth",hiddenCountYear:"hiddenCountYear",hiddenCountAllTime:"hiddenCountAllTime",modelCountDay:"modelCountDay",modelCountWeek:"modelCountWeek",modelCountMonth:"modelCountMonth",modelCountYear:"modelCountYear",modelCountAllTime:"modelCountAllTime",imageCountDay:"imageCountDay",imageCountWeek:"imageCountWeek",imageCountMonth:"imageCountMonth",imageCountYear:"imageCountYear",imageCountAllTime:"imageCountAllTime",postCountDay:"postCountDay",postCountWeek:"postCountWeek",postCountMonth:"postCountMonth",postCountYear:"postCountYear",postCountAllTime:"postCountAllTime"},a.Prisma.TagRankScalarFieldEnum={tagId:"tagId",followerCountDayRank:"followerCountDayRank",followerCountWeekRank:"followerCountWeekRank",followerCountMonthRank:"followerCountMonthRank",followerCountYearRank:"followerCountYearRank",followerCountAllTimeRank:"followerCountAllTimeRank",hiddenCountDayRank:"hiddenCountDayRank",hiddenCountWeekRank:"hiddenCountWeekRank",hiddenCountMonthRank:"hiddenCountMonthRank",hiddenCountYearRank:"hiddenCountYearRank",hiddenCountAllTimeRank:"hiddenCountAllTimeRank",modelCountDayRank:"modelCountDayRank",modelCountWeek
12Rank:"modelCountWeekRank",modelCountMonthRank:"modelCountMonthRank",modelCountYearRank:"modelCountYearRank",modelCountAllTimeRank:"modelCountAllTimeRank",imageCountDayRank:"imageCountDayRank",imageCountWeekRank:"imageCountWeekRank",imageCountMonthRank:"imageCountMonthRank",imageCountYearRank:"imageCountYearRank",imageCountAllTimeRank:"imageCountAllTimeRank",postCountDayRank:"postCountDayRank",postCountWeekRank:"postCountWeekRank",postCountMonthRank:"postCountMonthRank",postCountYearRank:"postCountYearRank",postCountAllTimeRank:"postCountAllTimeRank",articleCountDayRank:"articleCountDayRank",articleCountWeekRank:"articleCountWeekRank",articleCountMonthRank:"articleCountMonthRank",articleCountYearRank:"articleCountYearRank",articleCountAllTimeRank:"articleCountAllTimeRank"},a.Prisma.ImageModHelperScalarFieldEnum={imageId:"imageId",assessedNSFW:"assessedNSFW",nsfwReportCount:"nsfwReportCount"},a.Prisma.ModelHashScalarFieldEnum={modelId:"modelId",modelVersionId:"modelVersionId",hashType:"hashType",fileType:"fileType",hash:"hash"},a.Prisma.PostHelperScalarFieldEnum={postId:"postId",scanned:"scanned"},a.Prisma.PostStatScalarFieldEnum={postId:"postId",cryCountDay:"cryCountDay",cryCountWeek:"cryCountWeek",cryCountMonth:"cryCountMonth",cryCountYear:"cryCountYear",cryCountAllTime:"cryCountAllTime",dislikeCountDay:"dislikeCountDay",dislikeCountWeek:"dislikeCountWeek",dislikeCountMonth:"dislikeCountMonth",dislikeCountYear:"dislikeCountYear",dislikeCountAllTime:"dislikeCountAllTime",heartCountDay:"heartCountDay",heartCountWeek:"heartCountWeek",heartCountMonth:"heartCountMonth",heartCountYear:"heartCountYear",heartCountAllTime:"heartCountAllTime",laughCountDay:"laughCountDay",laughCountWeek:"laughCountWeek",laughCountMonth:"laughCountMonth",laughCountYear:"laughCountYear",laughCountAllTime:"laughCountAllTime",likeCountDay:"likeCountDay",likeCountWeek:"likeCountWeek",likeCountMonth:"likeCountMonth",likeCountYear:"likeCountYear",likeCountAllTime:"likeCountAllTime",commentCountDay:"commentCountDay",commentCountWeek:"commentCountWeek",commentCountMonth:"commentCountMonth",commentCountYear:"commentCountYear",commentCountAllTime:"commentCountAllTime",reactionCountDay:"reactionCountDay",reactionCountWeek:"reactionCountWeek",reactionCountMonth:"reactionCountMonth",reactionCountYear:"reactionCountYear",reactionCountAllTime:"reactionCountAllTime"},a.Prisma.CollectionStatScalarFieldEnum={collectionId:"collectionId",followerCountDay:"followerCountDay",followerCountWeek:"followerCountWeek",followerCountMonth:"followerCountMonth",followerCountYear:"followerCountYear",followerCountAllTime:"followerCountAllTime",itemCountDay:"itemCountDay",itemCountWeek:"itemCountWeek",itemCountMonth:"itemCountMonth",itemCountYear:"itemCountYear",itemCountAllTime:"itemCountAllTime",contributorCountDay:"contributorCountDay",contributorCountWeek:"contributorCountWeek",contributorCountMonth:"contributorCountMonth",contributorCountYear:"contributorCountYear",contributorCountAllTime:"contributorCountAllTime"},a.Prisma.CollectionRankScalarFieldEnum={collectionId:"collectionId",followerCountDayRank:"followerCountDayRank",followerCountWeekRank:"followerCountWeekRank",followerCountMonthRank:"followerCountMonthRank",followerCountYearRank:"followerCountYearRank",followerCountAllTimeRank:"followerCountAllTimeRank",itemCountDayRank:"itemCountDayRank",itemCountWeekRank:"itemCountWeekRank",itemCountMonthRank:"itemCountMonthRank",itemCountYearRank:"itemCountYearRank",itemCountAllTimeRank:"itemCountAllTimeRank",contributorCountDayRank:"contributorCountDayRank",contributorCountWeek
12Rank:"contributorCountWeekRank",contributorCountMonthRank:"contributorCountMonthRank",contributorCountYearRank:"contributorCountYearRank",contributorCountAllTimeRank:"contributorCountAllTimeRank"},a.Prisma.ImageTagScalarFieldEnum={imageId:"imageId",tagId:"tagId",tagName:"tagName",tagType:"tagType",tagNsfwLevel:"tagNsfwLevel",automated:"automated",confidence:"confidence",score:"score",upVotes:"upVotes",downVotes:"downVotes",needsReview:"needsReview",concrete:"concrete",lastUpvote:"lastUpvote",source:"source"},a.Prisma.ModelTagScalarFieldEnum={modelId:"modelId",tagId:"tagId",tagName:"tagName",tagType:"tagType",score:"score",upVotes:"upVotes",downVotes:"downVotes",needsReview:"needsReview"},a.Prisma.ImageResourceHelperScalarFieldEnum={imageId:"imageId",reviewId:"reviewId",reviewRating:"reviewRating",reviewDetails:"reviewDetails",reviewCreatedAt:"reviewCreatedAt",name:"name",modelVersionId:"modelVersionId",modelVersionName:"modelVersionName",modelVersionCreatedAt:"modelVersionCreatedAt",modelId:"modelId",modelName:"modelName",modelDownloadCount:"modelDownloadCount",modelCommentCount:"modelCommentCount",modelThumbsUpCount:"modelThumbsUpCount",modelThumbsDownCount:"modelThumbsDownCount",modelType:"modelType",modelVersionBaseModel:"modelVersionBaseModel",detected:"detected"},a.Prisma.PostResourceHelperScalarFieldEnum={postId:"postId",reviewId:"reviewId",reviewRating:"reviewRating",reviewRecommended:"reviewRecommended",reviewDetails:"reviewDetails",reviewCreatedAt:"reviewCreatedAt",name:"name",imageId:"imageId",modelVersionId:"modelVersionId",modelVersionName:"modelVersionName",modelVersionCreatedAt:"modelVersionCreatedAt",modelId:"modelId",modelName:"modelName",modelDownloadCount:"modelDownloadCount",modelCommentCount:"modelCommentCount",modelThumbsUpCount:"modelThumbsUpCount",modelThumbsDownCount:"modelThumbsDownCount",modelType:"modelType"},a.Prisma.PostImageTagScalarFieldEnum={postId:"postId",tagId:"tagId"},a.Prisma.PostTagScalarFieldEnum={postId:"postId",tagId:"tagId",tagName:"tagName",tagType:"tagType",score:"score",upVotes:"upVotes",downVotes:"downVotes"},a.Prisma.ResourceReviewHelperScalarFieldEnum={resourceReviewId:"resourceReviewId",imageCount:"imageCount"},a.Prisma.GenerationCoverageScalarFieldEnum={modelId:"modelId",modelVersionId:"modelVersionId",covered:"covered",coveredNext:"coveredNext"},a.Prisma.UserProfileScalarFieldEnum={userId:"userId",coverImageId:"coverImageId",bio:"bio",message:"message",messageAddedAt:"messageAddedAt",sfwCoverImageId:"sfwCoverImageId",sfwBio:"sfwBio",sfwMessage:"sfwMessage",sfwMessageAddedAt:"sfwMessageAddedAt",location:"location",nsfw:"nsfw",privacySettings:"privacySettings",profileSectionsSettings:"profileSectionsSettings",showcaseItems:"showcaseItems"},a.Prisma.BountyStatScalarFieldEnum={bountyId:"bountyId",favoriteCountDay:"favoriteCountDay",favoriteCountWeek:"favoriteCountWeek",favoriteCountMonth:"favoriteCountMonth",favoriteCountYear:"favoriteCountYear",favoriteCountAllTime:"favoriteCountAllTime",trackCountDay:"trackCountDay",trackCountWeek:"trackCountWeek",trackCountMonth:"trackCountMonth",trackCountYear:"trackCountYear",trackCountAllTime:"trackCountAllTime",entryCountDay:"entryCountDay",entryCountWeek:"entryCountWeek",entryCountMonth:"entryCountMonth",entryCountYear:"entryCountYear",entryCountAllTime:"entryCountAllTime",benefactorCountDay:"benefactorCountDay",benefactorCountWeek:"benefactorCountWeek",benefactorCountMonth:"benefactorCountMonth",benefactorCountYear:"benefactorCountYear",benefactorCountAllTime:"benefactorCountAllTime",unitAmountCountDay:"unitAmountCountDay",unitAmountCountWeek:"unitAmountCountWeek",unitAmountCountMonth:"unitAmountCountMonth",unitAmountCountYear:"unitAmountCountYear",unitAmountCountAllTime:"unitAmountCountAllTime",commentCountDay:"commentCountDay",commentCountWeek:"commentCountWeek",commentCountMonth:"commentCountMonth",commentCountYear:"commentCountYear",commentCountAllTime:"commentCountAllTime"},a.Prisma.BountyRankScalarFieldEnum={bountyId:"bountyId",favoriteCountDayRank:"favoriteCountDayRank",favoriteCountWeekRank:"favoriteCountWeekRank",favoriteCountMonthRank:"favoriteCountMonthRank",favoriteCountYearRank:"favoriteCountYearRank",favoriteCountAllTimeRank:"favoriteCountAllTimeRank",trackCountDayRank:"trackCountDayRank",trackCountWeek
12Rank:"trackCountWeekRank",trackCountMonthRank:"trackCountMonthRank",trackCountYearRank:"trackCountYearRank",trackCountAllTimeRank:"trackCountAllTimeRank",entryCountDayRank:"entryCountDayRank",entryCountWeekRank:"entryCountWeekRank",entryCountMonthRank:"entryCountMonthRank",entryCountYearRank:"entryCountYearRank",entryCountAllTimeRank:"entryCountAllTimeRank",benefactorCountDayRank:"benefactorCountDayRank",benefactorCountWeekRank:"benefactorCountWeekRank",benefactorCountMonthRank:"benefactorCountMonthRank",benefactorCountYearRank:"benefactorCountYearRank",benefactorCountAllTimeRank:"benefactorCountAllTimeRank",unitAmountCountDayRank:"unitAmountCountDayRank",unitAmountCountWeekRank:"unitAmountCountWeekRank",unitAmountCountMonthRank:"unitAmountCountMonthRank",unitAmountCountYearRank:"unitAmountCountYearRank",unitAmountCountAllTimeRank:"unitAmountCountAllTimeRank",commentCountDayRank:"commentCountDayRank",commentCountWeekRank:"commentCountWeekRank",commentCountMonthRank:"commentCountMonthRank",commentCountYearRank:"commentCountYearRank",commentCountAllTimeRank:"commentCountAllTimeRank"},a.Prisma.BountyEntryStatScalarFieldEnum={bountyEntryId:"bountyEntryId",cryCountDay:"cryCountDay",cryCountWeek:"cryCountWeek",cryCountMonth:"cryCountMonth",cryCountYear:"cryCountYear",cryCountAllTime:"cryCountAllTime",dislikeCountDay:"dislikeCountDay",dislikeCountWeek:"dislikeCountWeek",dislikeCountMonth:"dislikeCountMonth",dislikeCountYear:"dislikeCountYear",dislikeCountAllTime:"dislikeCountAllTime",heartCountDay:"heartCountDay",heartCountWeek:"heartCountWeek",heartCountMonth:"heartCountMonth",heartCountYear:"heartCountYear",heartCountAllTime:"heartCountAllTime",laughCountDay:"laughCountDay",laughCountWeek:"laughCountWeek",laughCountMonth:"laughCountMonth",laughCountYear:"laughCountYear",laughCountAllTime:"laughCountAllTime",likeCountDay:"likeCountDay",likeCountWeek:"likeCountWeek",likeCountMonth:"likeCountMonth",likeCountYear:"likeCountYear",likeCountAllTime:"likeCountAllTime",reactionCountDay:"reactionCountDay",reactionCountWeek:"reactionCountWeek",reactionCountMonth:"reactionCountMonth",reactionCountYear:"reactionCountYear",reactionCountAllTime:"reactionCountAllTime",unitAmountCountDay:"unitAmountCountDay",unitAmountCountWeek:"unitAmountCountWeek",unitAmountCountMonth:"unitAmountCountMonth",unitAmountCountYear:"unitAmountCountYear",unitAmountCountAllTime:"unitAmountCountAllTime",tippedCountDay:"tippedCountDay",tippedCountWeek:"tippedCountWeek",tippedCountMonth:"tippedCountMonth",tippedCountYear:"tippedCountYear",tippedCountAllTime:"tippedCountAllTime",tippedAmountCountDay:"tippedAmountCountDay",tippedAmountCountWeek:"tippedAmountCountWeek",tippedAmountCountMonth:"tippedAmountCountMonth",tippedAmountCountYear:"tippedAmountCountYear",tippedAmountCountAllTime:"tippedAmountCountAllTime"},a.Prisma.BountyEntryRankScalarFieldEnum={bountyEntryId:"bountyEntryId",cryCountDayRank:"cryCountDayRank",cryCountWeekRank:"cryCountWeekRank",cryCountMonthRank:"cryCountMonthRank",cryCountYearRank:"cryCountYearRank",cryCountAllTimeRank:"cryCountAllTimeRank",dislikeCountDayRank:"dislikeCountDayRank",dislikeCountWeekRank:"dislikeCountWeekRank",dislikeCountMonthRank:"dislikeCountMonthRank",dislikeCountYearRank:"dislikeCountYearRank",dislikeCountAllTimeRank:"dislikeCountAllTimeRank",heartCountDayRank:"heartCountDayRank",heartCountWeekRank:"heartCountWeekRank",heartCountMonthRank:"heartCountMonthRank",heartCountYearRank:"heartCountYearRank",heartCountAllTimeRank:"heartCountAllTimeRank",laughCountDayRank:"laughCountDayRank",laughCountWeekRank:"laughCountWeekRank",laughCountMonthRank:"laughCountMonthRank",laughCountYearRank:"laughCountYearRank",laughCountAllTimeRank:"laughCountAllTimeRank",likeCountDayRank:"likeCountDayRank",likeCountWeekRank:"likeCountWeekRank",likeCountMonthRank:"likeCountMonthRank",likeCountYearRank:"likeCountYearRank",likeCountAllTimeRank:"likeCountAllTimeRank",reactionCountDayRank:"reactionCountDayRank",reactionCountWeekRank:"reactionCountWeekRank",reactionCountMonthRank:"reactionCountMonthRank",reactionCountYearRank:"reactionCountYearRank",reactionCountAllTimeRank:"reactionCountAllTimeRank",unitAmou
12ntCountDayRank:"unitAmountCountDayRank",unitAmountCountWeekRank:"unitAmountCountWeekRank",unitAmountCountMonthRank:"unitAmountCountMonthRank",unitAmountCountYearRank:"unitAmountCountYearRank",unitAmountCountAllTimeRank:"unitAmountCountAllTimeRank",tippedCountDayRank:"tippedCountDayRank",tippedCountWeekRank:"tippedCountWeekRank",tippedCountMonthRank:"tippedCountMonthRank",tippedCountYearRank:"tippedCountYearRank",tippedCountAllTimeRank:"tippedCountAllTimeRank",tippedAmountCountDayRank:"tippedAmountCountDayRank",tippedAmountCountWeekRank:"tippedAmountCountWeekRank",tippedAmountCountMonthRank:"tippedAmountCountMonthRank",tippedAmountCountYearRank:"tippedAmountCountYearRank",tippedAmountCountAllTimeRank:"tippedAmountCountAllTimeRank"},a.Prisma.ClubStatScalarFieldEnum={clubId:"clubId",memberCountDay:"memberCountDay",memberCountWeek:"memberCountWeek",memberCountMonth:"memberCountMonth",memberCountYear:"memberCountYear",memberCountAllTime:"memberCountAllTime",resourceCountDay:"resourceCountDay",resourceCountWeek:"resourceCountWeek",resourceCountMonth:"resourceCountMonth",resourceCountYear:"resourceCountYear",resourceCountAllTime:"resourceCountAllTime",clubPostCountDay:"clubPostCountDay",clubPostCountWeek:"clubPostCountWeek",clubPostCountMonth:"clubPostCountMonth",clubPostCountYear:"clubPostCountYear",clubPostCountAllTime:"clubPostCountAllTime"},a.Prisma.ClubRankScalarFieldEnum={clubId:"clubId",memberCountDayRank:"memberCountDayRank",memberCountWeekRank:"memberCountWeekRank",memberCountMonthRank:"memberCountMonthRank",memberCountYearRank:"memberCountYearRank",memberCountAllTimeRank:"memberCountAllTimeRank",resourceCountDayRank:"resourceCountDayRank",resourceCountWeekRank:"resourceCountWeekRank",resourceCountMonthRank:"resourceCountMonthRank",resourceCountYearRank:"resourceCountYearRank",resourceCountAllTimeRank:"resourceCountAllTimeRank",clubPostCountDayRank:"clubPostCountDayRank",clubPostCountWeekRank:"clubPostCountWeekRank",clubPostCountMonthRank:"clubPostCountMonthRank",clubPostCountYearRank:"clubPostCountYearRank",clubPostCountAllTimeRank:"clubPostCountAllTimeRank"},a.Prisma.EntityMetricScalarFieldEnum={entityType:"entityType",entityId:"entityId",metricType:"metricType",metricValue:"metricValue"},a.Prisma.EntityMetricImageScalarFieldEnum={imageId:"imageId",reactionLike:"reactionLike",reactionHeart:"reactionHeart",reactionLaugh:"reactionLaugh",reactionCry:"reactionCry",reactionTotal:"reactionTotal",comment:"comment",collection:"collection",buzz:"buzz"},a.Prisma.TagsOnImageDetailsScalarFieldEnum={imageId:"imageId",tagId:"tagId",source:"source",automated:"automated",disabled:"disabled",needsReview:"needsReview",reserved_1:"reserved_1",reserved_2:"reserved_2",confidence:"confidence"},a.Prisma.ComicProjectScalarFieldEnum={id:"id",userId:"userId",name:"name",description:"description",coverImageId:"coverImageId",heroImageId:"heroImageId",heroImagePosition:"heroImagePosition",status:"status",tosViolation:"tosViolation",meta:"meta",baseModel:"baseModel",genre:"genre",nsfwLevel:"nsfwLevel",publishedAt:"publishedAt",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ComicProjectMetricScalarFieldEnum={comicProjectId:"comicProjectId",updatedAt:"updatedAt",tippedCount:"tippedCount",tippedAmountCount:"tippedAmountCount",followerCount:"followerCount",hiddenCount:"hiddenCount",readerCount:"readerCount",chapterReadCount:"chapterReadCount"},a.Prisma.ComicChapterScalarFieldEnum={id:"id",projectId:"projectId",name:"name",position:"position",status:"status",availability:"availability",earlyAccessConfig:"earlyAccessConfig",earlyAccessEndsAt:"earlyAccessEndsAt",publishedAt:"publishedAt",initialPublishedAt:"initialPublishedAt",nsfwLevel:"nsfwLevel",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ComicChapterReadScalarFieldEnum={userId:"userId",chapterId:"chapterId",unread:"unread",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ComicReferenceScalarFieldEnum={id:"id",userId:"userId",name:"name",type:"type",description:"description",status:"status",errorMessage:"errorMessage",buzzCost:"buzzCost",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ComicReferenceImageScalarFieldEnum={referenceId:"referenceId",imageId:"imageId",position:"position",createdAt:"createdAt"},a.Prisma.ComicProjectReferenceScalarFieldEnum={projectId:"projectId",referenceId:"referenceId",createdAt:"createdAt"},a.Prisma.ComicPanelScalarFieldEnum={id:"id",projectId:"projectId",chapterPosition:"chapterPosition",imageId:"imageId",prompt:"prompt",enhancedPrompt:"enhancedPrompt",imageUrl:"imageUrl",position:"position",status:"status",workflowId:"workflowId",civitaiJobId:"civitaiJobId",errorMessage:"errorMessage",metadata:"metadata",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ComicProjectEngagementScalarFieldEnum={userId:"userId",projectId:"projectId",type:"type",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ComicPanelReferenceScalarFieldEnum={panelId:"panelId",referenceId:"referenceId"},a.Prisma.UserRestrictionScalarFieldEnum={id:"id",userId:"userId",type:"type",status:"status",triggers:"triggers",createdAt:"createdAt",updatedAt:"updatedAt",resolvedAt:"resolvedAt",resolvedBy:"resolvedBy",resolvedMessage:"resolvedMessage",userMe
12ssage:"userMessage",userMessageAt:"userMessageAt"},a.Prisma.UserStrikeScalarFieldEnum={id:"id",userId:"userId",reason:"reason",status:"status",points:"points",description:"description",internalNotes:"internalNotes",entityType:"entityType",entityId:"entityId",reportId:"reportId",createdAt:"createdAt",expiresAt:"expiresAt",voidedAt:"voidedAt",voidedBy:"voidedBy",voidReason:"voidReason",issuedBy:"issuedBy"},a.Prisma.GenerationPresetScalarFieldEnum={id:"id",userId:"userId",name:"name",description:"description",ecosystem:"ecosystem",values:"values",sortOrder:"sortOrder",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.WildcardSetScalarFieldEnum={id:"id",kind:"kind",modelVersionId:"modelVersionId",ownerUserId:"ownerUserId",name:"name",auditStatus:"auditStatus",auditRuleVersion:"auditRuleVersion",auditedAt:"auditedAt",nsfw:"nsfw",usable:"usable",isInvalidated:"isInvalidated",invalidationReason:"invalidationReason",invalidatedAt:"invalidatedAt",metadata:"metadata",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.WildcardSetCategoryScalarFieldEnum={id:"id",wildcardSetId:"wildcardSetId",name:"name",values:"values",valueCount:"valueCount",auditStatus:"auditStatus",auditRuleVersion:"auditRuleVersion",auditedAt:"auditedAt",auditNote:"auditNote",nsfw:"nsfw",blocked:"blocked",metadata:"metadata",displayOrder:"displayOrder",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.ScannerLabelReviewScalarFieldEnum={id:"id",contentHash:"contentHash",version:"version",label:"label",reviewedBy:"reviewedBy",reviewedAt:"reviewedAt",verdict:"verdict",note:"note"},a.Prisma.ScannerContentSnapshotScalarFieldEnum={contentHash:"contentHash",scanner:"scanner",content:"content",createdAt:"createdAt"},a.Prisma.Model3DLicenseScalarFieldEnum={id:"id",name:"name",description:"description",allowCommercialUse:"allowCommercialUse",allowPrintFarm:"allowPrintFarm",allowDerivatives:"allowDerivatives",allowRedistribution:"allowRedistribution",requireAttribution:"requireAttribution",isCustom:"isCustom",createdAt:"createdAt"},a.Prisma.Model3DScalarFieldEnum={id:"id",name:"name",description:"description",userId:"userId",thumbnailImageId:"thumbnailImageId",licenseId:"licenseId",licenseDetails:"licenseDetails",workflowId:"workflowId",sourceImageId:"sourceImageId",generationParams:"generationParams",status:"status",nsfw:"nsfw",tosViolation:"tosViolation",poi:"poi",minor:"minor",unlisted:"unlisted",lockedProperties:"lockedProperties",availability:"availability",nsfwLevel:"nsfwLevel",meta:"meta",gallerySettings:"gallerySettings",createdAt:"createdAt",updatedAt:"updatedAt",publishedAt:"publishedAt",deletedAt:"deletedAt",deletedBy:"deletedBy"},a.Prisma.Model3DFileScalarFieldEnum={id:"id",model3dId:"model3dId",name:"name",url:"url",sizeKB:"sizeKB",format:"format",variant:"variant",isPrimary:"isPrimary",metadata:"metadata",virusScanResult:"virusScanResult",virusScanMessage:"virusScanMessage",rawScanResult:"rawScanResult",scannedAt:"scannedAt",scanRequestedAt:"scanRequestedAt",exists:"exists",createdAt:"createdAt"},a.Prisma.TagsOnModel3DScalarFieldEnum={model3dId:"model3dId",tagId:"tagId",createdAt:"createdAt"},a.Prisma.Model3DEngagementScalarFieldEnum={userId:"userId",model3dId:"model3dId",type:"type",createdAt:"createdAt"},a.Prisma.Model3DReportScalarFieldEnum={model3dId:"model3dId",reportId:"reportId"},a.Prisma.Model3DReviewScalarFieldEnum={id:"id",model3dId:"model3dId",userId:"userId",recommended:"recommended",details:"details",nsfw:"nsfw",tosViolation:"tosViolation",exclude:"exclude",metadata:"metadata",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.Model3DReviewReportScalarFieldEnum={model3dReviewId:"model3dReviewId",reportId:"reportId"},a.Prisma.Model3DMetricScalarFieldEnum={model3dId:"model3dId",downloadCount:"downloadCount",commentCount:"commentCount",collectedCount:"collectedCount",imageCount:"imageCount",tippedCount:"tippedCount",tippedAmountCount:"tippedAmountCount",ratingCount:"ratingCount",recommendedCount:"recommendedCount",reactionCount:"reactionCount",earnedAmount:"earnedAmount",updatedAt:"updatedAt",nsfwLevel:"nsfwLevel",userId:"userId",status:"status",availability:"availability",poi:"poi",minor:"minor"},a.Prisma.ShopifyCustomerLinkScalarFieldEnum={id:"id",shopifyCustomerId:"shopifyCustomerId",email:"email",userId:"userId",createdAt:"createdAt"},a.Prisma.ShopifyMerchOrderScalarFieldEnum={id:"id",shopifyOrderId:"shopifyOrderId",email:"email",shopifyCustomerId:"shopifyCustomerId",subtotal:"subtotal",couponCodes:"couponCodes",buzzAmount:"buzzAmount",status:"status",userId:"userId",grantedAt:"grantedAt",createdAt:"createdAt"},a.Prisma.OutboxScalarFieldEnum={id:"id",event:"event",entityType:"entityType",entityId:"entityId",createdAt:"createdAt",details:"details",attempts:"attempts"},a.Prisma.AppPageAccessScalarFieldEnum={app:"app",path:"path",roles:"roles",updatedById:"updatedById",updatedAt:"updatedAt"},a.Prisma.PlacementSpaceScalarFieldEnum={id:"id",surface:"surface",entityType:"entityType",entityId:"entityId",mode:"mode",price:"price",freeSlots:"freeSlots",settings:"settings",createdAt:"createdAt",updatedAt:"updatedAt"},a.Prisma.PlacementScalarFieldEnum={id:"id",surface:"surface",targetType:"targetType",targetId:"targetId",ownerId:"ownerId",placerId:"placerId",data:"data",status:"status",removedBy:"removedBy",amount:"amount",free:"free",spendType:"spendType",sellerId:"sellerId",feeWaived:"feeWaived",createdAt:"createdAt",expiresAt:"expiresAt",resolvedAt:"resolvedAt",resolvedById:"resolvedById",takenDownAt:"takenDownAt",takenDownById:"takenDownById",metricCountedAt:"metricCountedAt",metricClaimedAt:"metricClaimedAt",metricAttempts:"metricAttempts"},a.Prisma.PlacementTransactionScalarFieldEnum={id:"id",placementId:"placementId",kind:"kind",transactionId:"transactionId",amount:"amount",attempts:"attempts",lastAttemptAt:"lastAttemptAt",lastError:"lastError",createdAt:"createdAt"},a.Prisma.PlacementSuspensionScalarFieldEnum={userId:"userId",reason:"reason",createdAt:"createdAt",createdById:"createdById"},a.Prisma.UserHubScalarFieldEnum={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",userId:"userId",name:"name",index:"index",sort:"sort",period:"period",mediaTypes:"mediaTypes",metadata:"metadata",availability:"availability",forcedBrowsingLevel:"forcedBrowsingLevel"},a.Prisma.UserHubFollowScalarFieldEnum={userId:"userId",hubId:"hubId",createdAt:"createdAt"},a.Prisma.UserHubSourceScalarFieldEnum={id:"id",hubId:"hubId",type:"type",targetId:"targetId",alias:"al
12ias",enabled:"enabled",exclude:"exclude",index:"index",groupKey:"groupKey"},a.Prisma.BlurbScalarFieldEnum={id:"id",userId:"userId",name:"name",content:"content",contentHash:"contentHash",createdAt:"createdAt",updatedAt:"updatedAt",deletedAt:"deletedAt"},a.Prisma.BlurbReferenceScalarFieldEnum={blurbId:"blurbId",entityType:"entityType",entityId:"entityId",materializedHash:"materializedHash",materializedAt:"materializedAt",pendingSince:"pendingSince"},a.Prisma.SortOrder={asc:"asc",desc:"desc"},a.Prisma.JsonNullValueInput={JsonNull:l.JsonNull},a.Prisma.NullableJsonNullValueInput={DbNull:l.DbNull,JsonNull:l.JsonNull},a.Prisma.QueryMode={default:"default",insensitive:"insensitive"},a.Prisma.JsonNullValueFilter={DbNull:l.DbNull,JsonNull:l.JsonNull,AnyNull:l.AnyNull},a.Prisma.NullsOrder={first:"first",last:"last"},a.ReferralRewardKind=a.$Enums.ReferralRewardKind={MembershipToken:"MembershipToken",BuzzKickback:"BuzzKickback",MilestoneBonus:"MilestoneBonus",RefereeBonus:"RefereeBonus"},a.ReferralRewardStatus=a.$Enums.ReferralRewardStatus={Pending:"Pending",Settled:"Settled",Redeemed:"Redeemed",Expired:"Expired",Revoked:"Revoked"},a.ReferralRedemptionType=a.$Enums.ReferralRedemptionType={MembershipPerks:"MembershipPerks"},a.CashWithdrawalMethod=a.$Enums.CashWithdrawalMethod={NoPM:"NoPM",WireTransfer:"WireTransfer",Payoneer:"Payoneer",PayPal:"PayPal",ACH:"ACH",Check:"Check",eCheck:"eCheck",HoldMyPayments:"HoldMyPayments",Custom:"Custom",Intercash:"Intercash",Card:"Card",TipaltiInternalValue:"TipaltiInternalValue"},a.BuzzWithdrawalRequestStatus=a.$Enums.BuzzWithdrawalRequestStatus={Requested:"Requested",Canceled:"Canceled",Rejected:"Rejected",Approved:"Approved",Reverted:"Reverted",Transferred:"Transferred",ExternallyResolved:"ExternallyResolved"},a.UserPaymentConfigurationProvider=a.$Enums.UserPaymentConfigurationProvider={Stripe:"Stripe",Tipalti:"Tipalti"},a.Currency=a.$Enums.Currency={USD:"USD",BUZZ:"BUZZ",USDC:"USDC"},a.CashWithdrawalStatus=a.$Enums.CashWithdrawalStatus={Paid:"Paid",Rejected:"Rejected",Scheduled:"Scheduled",Submitted:"Submitted",Deferred:"Deferred",DeferredInternal:"DeferredInternal",Canceled:"Canceled",Cleared:"Cleared",FraudReview:"FraudReview",PendingPayerFunds:"PendingPayerFunds",InternalValue:"InternalValue",FailedFee:"FailedFee",Reclaimed:"Reclaimed"},a.CryptoTransactionStatus=a.$Enums.CryptoTransactionStatus={WaitingForRamp:"WaitingForRamp",RampTimedOut:"RampTimedOut",RampFailed:"RampFailed",RampInProgress:"RampInProgress",RampSuccess:"RampSuccess",WaitingForSweep:"WaitingForSweep",SweepFailed:"SweepFailed",Complete:"Complete"},a.RewardsEligibility=a.$Enums.RewardsEligibility={Eligible:"Eligible",Ineligible:"Ineligible",Protected:"Protected"},a.MembershipGiftStatus=a.$Enums.MembershipGiftStatus={Pending:"Pending",Fulfilled:"Fulfilled",Failed:"Failed",Refunded:"Refunded",Revoked:"Revoked"},a.PaymentProvider=a.$Enums.PaymentProvider={Stripe:"Stripe",Paddle:"Paddle",Civitai:"Civitai"},a.UserEngagementType=a.$Enums.UserEngagementType={Follow:"Follow",Hide:"Hide",Block:"Block"},a.MetricTimeframe=a.$Enums.MetricTimeframe={Day:"Day",Week:"Week",Month:"Month",Year:"Year",AllTime:"AllTime"},a.LinkType=a.$Enums.LinkType={Sponsorship:"Sponsorship",Social:"Social",Other:"Other"},a.ImportStatus=a.$Enums.ImportStatus={Pending:"Pending",Processing:"Processing",Failed:"Failed",Completed:"Completed"},a.HuggingFaceImportStatus=a.$Enums.HuggingFaceImportStatus={Queued:"Queued",Transferring:"Transferring",Completed:"Completed",Failed:"Failed",Canceled:"Canceled"},a.ModelType=a.$Enums.ModelType={Checkpoint:"Checkpoint",TextualInversion:"TextualInversion",Hypernetwork:"Hypernetwork",AestheticGradient:"AestheticGradient",LORA:"LORA",LoCon:"LoCon",DoRA:"DoRA",Controlnet:"Controlnet",Upscaler:"Upscaler",MotionModule:"MotionModule",VAE:"VAE",TextEncoder:"TextEncoder",UNet:"UNet",CLIPVision:"CLIPVision",Poses:"Poses",Wildcards:"Wildcards",Workflows:"Workflows",ComfyWorkflows:"ComfyWorkflows",Detection:"Detection",VisionLanguage:"VisionLanguage",CLIP:"CLIP",LLM:"LLM",Other:"Other"},a.ModelStatus=a.$Enums.ModelStatus={Draft:"Draft",Training:"Training",Published:"Published",Scheduled:"Scheduled",Unpublished:"Unpublished",UnpublishedViolation:"UnpublishedViolation",GatherInterest:"GatherInterest",Deleted:"Deleted"},a.CheckpointType=a.$Enums.CheckpointType={Trained:"Trained",Merge:"Merge"},a.ModelUploadType=a.$Enums.ModelUploadType={Created:"Created",Trained:"Trained"},a.ModelModifier=a.$Enums.ModelModifier={Archived:"Archived",TakenDown:"TakenDown"},a.Availability=a.$Enums.Availability={Public:"Public",Unsearchable:"Unsearchable",Private:"Private",EarlyAccess:"EarlyAccess"},a.CommercialUse=a.$Enums.CommercialUse={None:"None",Image:"Image",RentCivit:"RentCivit",Rent:"Rent",Sell:"Sell",SellMerge:"SellMerge"},a.ModelFlagStatus=a.$Enums.ModelFlagStatus={Pending:"Pending",Resolved:"Resolved"},a.ModelEngagementType=a.$Enums.ModelEngagementType={Favorite:"Favorite",Hide:"Hide",Mute:"Mute",Notify:"Notify"},a.ModelVersionSponsorshipSettingsType=a.$Enums.ModelVersionSponsorshipSettingsType={FixedPrice:"FixedPrice",Bidding:"Bidding"},a.ModelVersionMonetizationType=a.$Enums.ModelVersionMonetizationType={PaidAccess:"PaidAccess",PaidEarlyAccess:"PaidEarlyAccess",PaidGeneration:"PaidGeneration",CivitaiClubOnly:"CivitaiClubOnly",MySubscribersOnly:"MySubscribersOnly",Sponsored:"Sponsored"},a.TrainingStatus=a.$Enums.TrainingStatus={Pending:"Pending",Submitted:"Submitted",Paused:"Paused",Denied:"Denied",Processing:"Processing",InReview:"InReview",Failed:"Failed",Approved:"Approved",Expired:"Expired"},a.ModelUsageControl=a.$Enums.ModelUsageControl={Download:"Download",Generation:"Generation",InternalGeneration:"InternalGeneration",ExternalGeneration:"ExternalGeneration"},a.LicensingFeeType=a.$Enums.LicensingFeeType={PerImageBuzz:"PerImageBuzz"},a.LicensingFeeSettlementCurrency=a.$Enums.LicensingFeeSettlementCurrency={Buzz:"Buzz",Cash:"Cash"},a.PaidAccessEntityType=a.$Enums.PaidAccessEntityType={ModelVersion:"ModelVersion",ComicChapter:"ComicChapter"},a.ModelVersionEngagementType=a.$Enums.ModelVersionEngagementType={Notify:"Notify"},a.ModelHashType=a.$Enums.ModelHashType={AutoV1:"AutoV1",AutoV2:"AutoV2",AutoV3:"AutoV3",SHA256:"SHA256",CRC32:"CRC32",BLAKE3:"BLAKE3",SHA256_12:"SHA256_12",SSHS_12:"SSHS_12"},a.ScanResultCode=a.$Enums.ScanResultCode={Pending:"Pending",Success:"Success",Danger:"Danger",Error:"Error"},a.ModelFileVisibility=a.$Enums.ModelFileVisibility={Sensitive:"Sensitive",Private:"Private",Public:"Public"},a.AssociationType=a.$Enums.AssociationType={Suggested:"Suggested"},a.ReportReason=a.$Enums.ReportReason={TOSViolation:"TOSViolation",NSFW:"NSFW",Ownership:"Ownership",AdminAttention:"AdminAttention",Claim:"Claim",CSAM:"CSAM",Automated:"Automated",Spam:"Spam",StickerPlacement:"StickerPlacement"},a.ReportStatus=a.$Enums.ReportStatus={Pending:"Pending",Processing:"Processing",Actioned:"Actioned",Unactioned:"Unactioned"},a.ReviewReactions=a.$Enums.ReviewReactions={Like:"Like",Dislike:"Dislike",Laugh:"Laugh",Cry:"Cry",Heart:"Heart"},a.MediaType=a.$Enums.MediaType={image:"image",video:"video",audio:"audio"},a.NsfwLevel=a.$Enums.NsfwLevel={None:"None",Soft:"Soft",Mature:"Mature",X:"X",Blocked:"Blocked"},a.ImageGenerationProcess=a.$Enums.ImageGenerationProcess={txt2img:"txt2img",txt2imgHiRes:"txt2imgHiRes",img2img:"img2img",inpainting:"inpainting"},a.ImageIngestionStatus=a.$Enums.ImageIngestionStatus={Pending:"Pending",Scanned:"Scanned",Error:"Error",Blocked:"Blocked",N
12otFound:"NotFound",PendingManualAssignment:"PendingManualAssignment",Rescan:"Rescan"},a.BlockImageReason=a.$Enums.BlockImageReason={Ownership:"Ownership",CSAM:"CSAM",TOS:"TOS"},a.EntityModerationStatus=a.$Enums.EntityModerationStatus={Pending:"Pending",Succeeded:"Succeeded",Failed:"Failed",Expired:"Expired",Canceled:"Canceled"},a.ImageEngagementType=a.$Enums.ImageEngagementType={Favorite:"Favorite",Hide:"Hide"},a.TagType=a.$Enums.TagType={UserGenerated:"UserGenerated",Label:"Label",Moderation:"Moderation",System:"System"},a.TagTarget=a.$Enums.TagTarget={Model:"Model",Question:"Question",Image:"Image",Post:"Post",Tag:"Tag",Article:"Article",Bounty:"Bounty",Collection:"Collection",Model3D:"Model3D"},a.TagsOnTagsType=a.$Enums.TagsOnTagsType={Parent:"Parent",Replace:"Replace",Append:"Append"},a.PartnerPricingModel=a.$Enums.PartnerPricingModel={Duration:"Duration",PerImage:"PerImage"},a.ApiKeyType=a.$Enums.ApiKeyType={System:"System",User:"User",Access:"Access",Refresh:"Refresh"},a.TagEngagementType=a.$Enums.TagEngagementType={Hide:"Hide",Follow:"Follow",Allow:"Allow"},a.DomainColor=a.$Enums.DomainColor={red:"red",green:"green",blue:"blue",all:"all"},a.CosmeticType=a.$Enums.CosmeticType={Badge:"Badge",NamePlate:"NamePlate",ContentDecoration:"ContentDecoration",ProfileDecoration:"ProfileDecoration",ProfileBackground:"ProfileBackground",Sticker:"Sticker",ChatTheme:"ChatTheme"},a.CosmeticSource=a.$Enums.CosmeticSource={Trophy:"Trophy",Purchase:"Purchase",Event:"Event",Membership:"Membership",Claim:"Claim"},a.CosmeticEntity=a.$Enums.CosmeticEntity={Model:"Model",Image:"Image",Article:"Article",Post:"Post",Model3D:"Model3D"},a.CosmeticShopItemStatus=a.$Enums.CosmeticShopItemStatus={Draft:"Draft",PendingReview:"PendingReview",Published:"Published",Rejected:"Rejected",RequestedChanges:"RequestedChanges",Archived:"Archived"},a.BuzzAccountType=a.$Enums.BuzzAccountType={user:"user",generation:"generation",club:"club",green:"green",fakered:"fakered"},a.ArticleIngestionStatus=a.$Enums.ArticleIngestionStatus={Pending:"Pending",Scanned:"Scanned",Blocked:"Blocked",Error:"Error",Rescan:"Rescan"},a.ArticleStatus=a.$Enums.ArticleStatus={Draft:"Draft",Published:"Published",Unpublished:"Unpublished",UnpublishedViolation:"UnpublishedViolation",Processing:"Processing"},a.ArticleEngagementType=a.$Enums.ArticleEngagementType={Favorite:"Favorite",Hide:"Hide"},a.GenerationSchedulers=a.$Enums.GenerationSchedulers={EulerA:"EulerA",Euler:"Euler",LMS:"LMS",Heun:"Heun",DPM2:"DPM2",DPM2A:"DPM2A",DPM2SA:"DPM2SA",DPM2M:"DPM2M",DPMSDE:"DPMSDE",DPMFast:"DPMFast",DPMAdaptive:"DPMAdaptive",LMSKarras:"LMSKarras",DPM2Karras:"DPM2Karras",DPM2AKarras:"DPM2AKarras",DPM2SAKarras:"DPM2SAKarras",DPM2MKarras:"DPM2MKarras",DPMSDEKarras:"DPMSDEKarras",DDIM:"DDIM"},a.CollectionWriteConfiguration=a.$Enums.CollectionWriteConfiguration={Private:"Private",Public:"Public",Review:"Review"},a.CollectionReadConfiguration=a.$Enums.CollectionReadConfiguration={Private:"Private",Public:"Public",Unlisted:"Unlisted"},a.CollectionType=a.$Enums.CollectionType={Model:"Model",Article:"Article",Post:"Post",Image:"Image",Model3D:"Model3D"},a.CollectionMode=a.$Enums.CollectionMode={Contest:"Contest",Bookmark:"Bookmark"},a.CollectionItemStatus=a.$Enums.CollectionItemStatus={ACCEPTED:"ACCEPTED",REVIEW:"REVIEW",REJECTED:"REJECTED"},a.CollectionItemRejectionReason=a.$Enums.CollectionItemRejectionReason={OffTopic:"OffTopic",WrongFormat:"WrongFormat",Duplicate:"Duplicate",Quality:"Quality",RulesViolation:"RulesViolation",Other:"Other",Automated:"Automated"},a.CollectionContributorPermission=a.$Enums.CollectionContributorPermission={VIEW:"VIEW",ADD:"ADD",ADD_REVIEW:"ADD_REVIEW",MANAGE:"MANAGE"},a.CollectionCollaboratorRole=a.$Enums.CollectionCollaboratorRole={Contributor:"Contributor",Manager:"Manager"},a.CollectionInviteStatus=a.$Enums.CollectionInviteStatus={Pending:"Pending",Accepted:"Accepted",Declined:"Declined"},a.HomeBlockType=a.$Enums.HomeBlockType={Collection:"Collection",Announcement:"Announcement",Leaderboard:"Leaderboard",Social:"Social",Event:"Event",CosmeticShop:"CosmeticShop",FeaturedModelVersion:"FeaturedModelVersion",FeaturedCollections:"FeaturedCollections",Feed:"Feed"}
12,a.BountyMode=a.$Enums.BountyMode={Individual:"Individual",Split:"Split"},a.BountyEntryMode=a.$Enums.BountyEntryMode={Open:"Open",BenefactorsOnly:"BenefactorsOnly"},a.BountyType=a.$Enums.BountyType={ModelCreation:"ModelCreation",LoraCreation:"LoraCreation",EmbedCreation:"EmbedCreation",DataSetCreation:"DataSetCreation",DataSetCaption:"DataSetCaption",ImageCreation:"ImageCreation",VideoCreation:"VideoCreation",Other:"Other"},a.BountyEngagementType=a.$Enums.BountyEngagementType={Favorite:"Favorite",Track:"Track"},a.CsamReportType=a.$Enums.CsamReportType={Image:"Image",TrainingData:"TrainingData",GeneratedImage:"GeneratedImage",ExternalLink:"ExternalLink"},a.SaleDiscountType=a.$Enums.SaleDiscountType={Fixed:"Fixed",Percent:"Percent"},a.EntityType=a.$Enums.EntityType={Image:"Image",Post:"Post",Article:"Article",Bounty:"Bounty",BountyEntry:"BountyEntry",ModelVersion:"ModelVersion",Model:"Model",Collection:"Collection",Comment:"Comment",CommentV2:"CommentV2",User:"User",UserProfile:"UserProfile",ResourceReview:"ResourceReview",ChatMessage:"ChatMessage",Model3D:"Model3D"},a.EntityCollaboratorStatus=a.$Enums.EntityCollaboratorStatus={Pending:"Pending",Approved:"Approved",Rejected:"Rejected"},a.ClubAdminPermission=a.$Enums.ClubAdminPermission={ManageMemberships:"ManageMemberships",ManageTiers:"ManageTiers",ManagePosts:"ManagePosts",ManageClub:"ManageClub",ManageResources:"ManageResources",ViewRevenue:"ViewRevenue",WithdrawRevenue:"WithdrawRevenue"},a.ChatMemberStatus=a.$Enums.ChatMemberStatus={Invited:"Invited",Joined:"Joined",Ignored:"Ignored",Left:"Left",Kicked:"Kicked"},a.ChatNotifyLevel=a.$Enums.ChatNotifyLevel={All:"All",Mentions:"Mentions",None:"None"},a.ChatMessageType=a.$Enums.ChatMessageType={Markdown:"Markdown",Image:"Image",Video:"Video",Audio:"Audio",Embed:"Embed"},a.PurchasableRewardUsage=a.$Enums.PurchasableRewardUsage={SingleUse:"SingleUse",MultiUse:"MultiUse"},a.JobQueueType=a.$Enums.JobQueueType={CleanUp:"CleanUp",UpdateMetrics:"UpdateMetrics",UpdateNsfwLevel:"UpdateNsfwLevel",UpdateSearchIndex:"UpdateSearchIndex",CleanIfEmpty:"CleanIfEmpty",ModerationRequest:"ModerationRequest",BlockedImageDelete:"BlockedImageDelete",ImageScan:"ImageScan",ReplacedImageDelete:"ReplacedImageDelete"},a.VaultItemStatus=a.$Enums.VaultItemStatus={Pending:"Pending",Stored:"Stored",Failed:"Failed"},a.RedeemableCodeType=a.$Enums.RedeemableCodeType={Buzz:"Buzz",Membership:"Membership"},a.ToolType=a.$Enums.ToolType={Image:"Image",Video:"Video",MotionCapture:"MotionCapture",Upscalers:"Upscalers",Audio:"Audio",Compute:"Compute",GameEngines:"GameEngines",Editor:"Editor",LLM:"LLM"},a.TechniqueType=a.$Enums.TechniqueType={Image:"Image",Video:"Video"},a.AppealStatus=a.$Enums.AppealStatus={Pending:"Pending",Approved:"Approved",Rejected:"Rejected",Void:"Void"},a.AuctionType=a.$Enums.AuctionType={Model:"Model",Image:"Image",Collection:"Collection",Article:"Article"},a.ModerationRuleAction=a.$Enums.ModerationRuleAction={Approve:"Approve",Block:"Block",Hold:"Hold"},a.ChangelogType=a.$Enums.ChangelogType={Feature:"Feature",Bugfix:"Bugfix",Policy:"Policy",Update:"Update",Incident:"Incident"},a.NewOrderRankType=a.$Enums.NewOrderRankType={Acolyte:"Acolyte",Knight:"Knight",Templar:"Templar"},a.PrizeMode=a.$Enums.PrizeMode={Fixed:"Fixed",Dynamic:"Dynamic"},a.PoolTrigger=a.$Enums.PoolTrigger={Entry:"Entry",User:"User"},a.ChallengeReviewCostType=a.$Enums.ChallengeReviewCostType={None:"None",PerEntry:"PerEntry",Flat:"Flat"},a.ChallengeSource=a.$Enums.ChallengeSource={System:"System",Mod:"Mod",User:"User"},a.ChallengeStatus=a.$Enums.ChallengeStatus={Scheduled:"Scheduled",Active:"Active",Completing:"Completing",Completed:"Completed",Cancelled:"Cancelled"},a.ChallengeIngestionStatus=a.$Enums.ChallengeIngestionStatus={Pending:"Pending",Scanned:"Scanned",Blocked:"Blocked",Error:"Error"},a.ChallengeEngagementType=a.$Enums.ChallengeEngagementType={Notify:"Notify"},a.TagSource=a.$Enums.TagSource={User:"User",Rekognition:"Rekognition",WD14:"WD14",Computed:"Computed",ImageHash:"ImageHash",Hive:"Hive",MinorDetection:"MinorDetection",HiveDemographics:"HiveDemographics",Clavata:"Clavata",SpineRating:"SpineRating",AiRecognition:"AiRecognition",AnimeRecognition:"AnimeRecognition"},a.EntityMetric_EntityType_Type=a.$Enums.EntityMetric_EntityType_Type={Image:"Image"},a.EntityMetric_MetricType_Type=a.$Enums.EntityMetric_MetricType_Type={ReactionLike:"ReactionLike",ReactionHeart:"ReactionHeart",ReactionLaugh:"ReactionLaugh",ReactionCry:"ReactionCry",Comment:"Comment",Collection:"Collection",Buzz:"Buzz"},a.ComicProjectStatus=a.$Enums.ComicProjectStatus={Active:"Active",Deleted:"Deleted"},a.ComicGenre=a.$Enums.ComicGenre={Action:"Action",Adventure:"Adventure",Comedy:"Comedy",Drama:"Drama",Fantasy:"Fantasy",Horror:"Horror",Mystery:"Mystery",Romance:"Romance",SciFi:"SciFi",SliceOfLife:"SliceOfLife",Thriller:"Thriller",Other:"Other"},a.ComicChapterStatus=a.$Enums.ComicChapterStatus={Draft:"Draft",Published:"Published",Scheduled:"Scheduled"},a.ComicReferenceType=a.$Enums.ComicReferenceType={Character:"Character",Location:"Location",Item:"Item",Style:"Style"},a.ComicReferenceStatus=a.$Enums.ComicReferenceStatus={Pending:"Pending",Ready:"Ready",Failed:"Failed"},a.ComicPanelStatus=a.$Enums.ComicPanelStatus={Pending:"Pending",Enqueued:"Enqueued",Generating:"Generating",AwaitingSelection:"AwaitingSelection",RequireUnlock:"RequireUnlock",Ready:"Ready",Failed:"Failed"},a.ComicEngagementType=a.$Enums.ComicEngagementType={None:"None",
12Notify:"Notify",Hide:"Hide"},a.UserRestrictionStatus=a.$Enums.UserRestrictionStatus={Pending:"Pending",Upheld:"Upheld",Overturned:"Overturned"},a.StrikeReason=a.$Enums.StrikeReason={BlockedContent:"BlockedContent",RealisticMinorContent:"RealisticMinorContent",CSAMContent:"CSAMContent",TOSViolation:"TOSViolation",HarassmentContent:"HarassmentContent",ProhibitedContent:"ProhibitedContent",ManualModAction:"ManualModAction"},a.StrikeStatus=a.$Enums.StrikeStatus={Active:"Active",Expired:"Expired",Voided:"Voided"},a.WildcardSetKind=a.$Enums.WildcardSetKind={System:"System",User:"User"},a.WildcardSetAuditStatus=a.$Enums.WildcardSetAuditStatus={Pending:"Pending",Clean:"Clean",Mixed:"Mixed",Dirty:"Dirty"},a.WildcardSetCategoryAuditStatus=a.$Enums.WildcardSetCategoryAuditStatus={Pending:"Pending",Clean:"Clean",Dirty:"Dirty"},a.ReviewVerdict=a.$Enums.ReviewVerdict={TruePositive:"TruePositive",FalsePositive:"FalsePositive",TrueNegative:"TrueNegative",FalseNegative:"FalseNegative",Unsure:"Unsure"},a.Model3DStatus=a.$Enums.Model3DStatus={Draft:"Draft",Published:"Published",Unpublished:"Unpublished",Deleted:"Deleted"},a.Model3DEngagementType=a.$Enums.Model3DEngagementType={Favorite:"Favorite",Hide:"Hide",Notify:"Notify"},a.ShopifyMerchOrderStatus=a.$Enums.ShopifyMerchOrderStatus={Pending:"Pending",Granted:"Granted"},a.OutboxEntity=a.$Enums.OutboxEntity={Article:"Article",Image:"Image",Model:"Model",Post:"Post",ModelVersion:"ModelVersion"},a.UserHubSourceType=a.$Enums.UserHubSourceType={User:"User",Model:"Model",ModelVersion:"ModelVersion",Collection:"Collection",Tag:"Tag"},a.Prisma.ModelName={Account:"Account",Session:"Session",SessionInvalidation:"SessionInvalidation",UserReferral:"UserReferral",UserReferralCode:"UserReferralCode",ReferralReward:"ReferralReward",ReferralMilestone:"ReferralMilestone",ReferralRedemption:"ReferralRedemption",ReferralAttribution:"ReferralAttribution",UserPaymentConfiguration:"UserPaymentConfiguration",BuzzWithdrawalRequestHistory:"BuzzWithdrawalRequestHistory",BuzzWithdrawalRequest:"BuzzWithdrawalRequest",CashWithdrawal:"CashWithdrawal",CryptoWallet:"CryptoWallet",CryptoDeposit:"CryptoDeposit",CryptoTransaction:"CryptoTransaction",User:"User",CustomerSubscription:"CustomerSubscription",MembershipGift:"MembershipGift",Product:"Product",Price:"Price",Purchase:"Purchase",CreatorGalleryHiddenUser:"CreatorGalleryHiddenUser",UserEngagement:"UserEngagement",UserMetric:"UserMetric",UserLink:"UserLink",VerificationToken:"VerificationToken",Import:"Import",HuggingFaceImport:"HuggingFaceImport",Model:"Model",ModelFlag:"ModelFlag",License:"License",ModelInterest:"ModelInterest",ModelEngagement:"ModelEngagement",ModelVersionSponsorshipSettings:"ModelVersionSponsorshipSettings",ModelVersionMonetization:"ModelVersionMonetization",ModelVersion:"ModelVersion",LicensingRoot:"LicensingRoot",PricingSlot:"PricingSlot",ModelVersionEngagement:"ModelVersionEngagement",RecommendedResource:"RecommendedResource",ModelFileHash:"ModelFileHash",ModelFile:"ModelFile",File:"File",ModelMetric:"ModelMetric",ModelVersionMetric:"ModelVersionMetric",ModelBaseModelMetric:"ModelBaseModelMetric",ModelMetricDaily:"ModelMetricDaily",ModelAssociations:"ModelAssociations",DownloadHistory:"DownloadHistory",ModActivity:"ModActivity",Report:"Report",ResourceReviewReport:"ResourceReviewReport",ModelReport:"ModelReport",CommentReport:"CommentReport",CommentV2Report:"CommentV2Report",ImageReport:"ImageReport",ArticleReport:"ArticleReport",PostReport:"PostReport",UserReport:"UserReport",CollectionReport:"CollectionReport",BountyReport:"BountyReport",BountyEntryReport:"BountyEntryReport",ChatReport:"ChatReport",ComicProjectReport:"ComicProjectReport",ResourceReview:"ResourceReview",ResourceReviewReaction:"ResourceReviewReaction",Post:"Post",PostMetric:"PostMetric",Image:"Image",ImageTagForReview:"ImageTagForReview",ImageMetaFlags:"ImageMetaFlags",ImageFlag:"ImageFlag",BlockedImage:"BlockedImage",ImageConnection:"ImageConnection",EntityModeration:"EntityModeration",ImageEngagement:"ImageEngagement",ImageResource:"ImageResource",ImageResourceNew:"ImageResourceNew",ResourceOverride:"ResourceOverride",ImageRatingRequest:"ImageRatingRequest",ArticleRatingReview:"ArticleRatingReview",CollectionMetric:"CollectionMetric",Tag:"Tag",TagsOnTags:"TagsOnTags",TagsOnModels:"TagsOnModels",TagsOnModelsVote:"TagsOnModelsVote",TagsOnQuestions:"TagsOnQuestions",TagsOnImageNew:"TagsOnImageNew",ShadowTagsOnImage:"ShadowTagsOnImage",TagsOnImageVote:"TagsOnImageVote",TagsOnPost:"TagsOnPost",TagsOnArticle:"TagsOnArticle",TagsOnBounty:"TagsOnBounty",TagsOnPostVote:"TagsOnPostVote",TagMetric:"TagMetric",S
12avedModel:"SavedModel",RunStrategy:"RunStrategy",Partner:"Partner",KeyValue:"KeyValue",Feedback:"Feedback",ApiKey:"ApiKey",OauthClient:"OauthClient",UserRole:"UserRole",Role:"Role",UserMembershipOverride:"UserMembershipOverride",AppBlock:"AppBlock",AppCollaborator:"AppCollaborator",AppOwnershipEvent:"AppOwnershipEvent",AppOwnershipTransfer:"AppOwnershipTransfer",AppBlockPublishRequest:"AppBlockPublishRequest",AppListing:"AppListing",AppListingScreenshot:"AppListingScreenshot",AppListingReview:"AppListingReview",AppListingMetric:"AppListingMetric",AppListingPublishRequest:"AppListingPublishRequest",AppListingReport:"AppListingReport",AppListingModerationEvent:"AppListingModerationEvent",AppReviewAgentReport:"AppReviewAgentReport",BlockUserSettings:"BlockUserSettings",PlatformDefaultBlock:"PlatformDefaultBlock",BlockUserSubscription:"BlockUserSubscription",BlockBuzzAttribution:"BlockBuzzAttribution",BlockAttributionPayout:"BlockAttributionPayout",BlockSpendAttribution:"BlockSpendAttribution",BlockAuthorFeeAccrual:"BlockAuthorFeeAccrual",BlockGoodPurchase:"BlockGoodPurchase",BlockGoodEntitlement:"BlockGoodEntitlement",BlockSubscriptionAttribution:"BlockSubscriptionAttribution",BlockScopeInvocation:"BlockScopeInvocation",AppUserScopeGrant:"AppUserScopeGrant",AppDevForgejoIdentity:"AppDevForgejoIdentity",OauthConsent:"OauthConsent",TrustedSpokeDomain:"TrustedSpokeDomain",AdToken:"AdToken",Comment:"Comment",CommentReaction:"CommentReaction",UserNotificationSettings:"UserNotificationSettings",PushSubscription:"PushSub
12scription",UserPushSetting:"UserPushSetting",Webhook:"Webhook",Question:"Question",QuestionMetric:"QuestionMetric",Answer:"Answer",AnswerVote:"AnswerVote",AnswerMetric:"AnswerMetric",CommentV2:"CommentV2",Thread:"Thread",ThreadMute:"ThreadMute",QuestionReaction:"QuestionReaction",AnswerReaction:"AnswerReaction",CommentV2Reaction:"CommentV2Reaction",ImageReaction:"ImageReaction",PostReaction:"PostReaction",ArticleReaction:"ArticleReaction",TagEngagement:"TagEngagement",Announcement:"Announcement",AnnouncementSpend:"AnnouncementSpend",UserAnnouncementMute:"UserAnnouncementMute",AnnouncementUser:"AnnouncementUser",AnnouncementDismissal:"AnnouncementDismissal",RewardsBonusEvent:"RewardsBonusEvent",Cosmetic:"Cosmetic",UserCosmetic:"UserCosmetic",CosmeticShopSection:"CosmeticShopSection",CosmeticShopItem:"CosmeticShopItem",UserCosmeticShopItemResale:"UserCosmeticShopItemResale",CosmeticShopItemCosmetic:"CosmeticShopItemCosmetic",UserCosmeticShopItemWishlist:"UserCosmeticShopItemWishlist",CosmeticShopSectionItem:"CosmeticShopSectionItem",UserCosmeticShopPurchases:"UserCosmeticShopPurchases",UserCosmeticShopPurchaseCosmetic:"UserCosmeticShopPurchaseCosmetic",BuzzClaim:"BuzzClaim",Article:"Article",PressMention:"PressMention",ArticleEngagement:"ArticleEngagement",ArticleMetric:"ArticleMetric",Leaderboard:"Leaderboard",LeaderboardResult:"LeaderboardResult",ModelVersionExploration:"ModelVersionExploration",GenerationServiceProvider:"GenerationServiceProvider",Collection:"Collection",CollectionItem:"CollectionItem",CollectionItemScore:"CollectionItemScore",CollectionContributor:"CollectionContributor",CollectionInvite:"CollectionInvite",TagsOnCollection:"TagsOnCollection",HomeBlock:"HomeBlock",BuzzTip:"BuzzTip",Bounty:"Bounty",BountyEntry:"BountyEntry",BountyEntryReaction:"BountyEntryReaction",BountyBenefactor:"BountyBenefactor",BountyEngagement:"BountyEngagement",TipConnection:"TipConnection",BountyMetric:"BountyMetric",BountyEntryMetric:"BountyEntryMetric",CsamReport:"CsamReport",Link:"Link",EntityAccess:"EntityAccess",PaidAccess:"PaidAccess",ModelVersionSale:"ModelVersionSale",ModelVersionSaleItem:"ModelVersionSaleItem",EntityCollaborator:"EntityCollaborator",EcosystemCheckpoints:"EcosystemCheckpoints",GenerationBaseModel:"GenerationBaseModel",Club:"Club",ClubTier:"ClubTier",ClubAdminInvite:"ClubAdminInvite",ClubAdmin:"ClubAdmin",ClubMembership:"ClubMembership",ClubMembershipCharge:"ClubMembershipCharge",ClubPost:"ClubPost",ClubPostReaction:"ClubPostReaction",ClubPostMetric:"ClubPostMetric",ClubMetric:"ClubMetric",Chat:"Chat",ChatMember:"ChatMember",ChatMessage:"ChatMessage",BuildGuide:"BuildGuide",PurchasableReward:"PurchasableReward",UserPurchasedRewards:"UserPurchasedRewards",JobQueue:"JobQueue",VaultItem:"VaultItem",Vault:"Vault",UserStorageUsage:"UserStorageUsage",UserStorageRollup:"UserStorageRollup",UserStorageSnapshot:"UserStorageSnapshot",RedeemableCode:"RedeemableCode",Tool:"Tool",ImageTool:"ImageTool",Technique:"Technique",ImageTechnique:"ImageTechnique",DonationGoal:"DonationGoal",Donation:"Donation",Blocklist:"Blocklist",Appeal:"Appeal",AuctionBase:"AuctionBase",Auction:"Auction",Bid:"Bid",BidRecurring:"BidRecurring",FeaturedModelVersion:"FeaturedModelVersion",CoveredCheckpoint:"CoveredCheckpoint",ModerationRule:"ModerationRule",Changelog:"Changelog",Bug:"Bug",NewOrderPlayer:"NewOrderPlayer",NewOrderRank:"NewOrderRank",NewOrderSmite:"NewOrderSmite",ReportAutomated:"ReportAutomated",RestrictedBaseModels:"RestrictedBaseModels",Challenge:"Challenge",ChallengeEntryStanding:"ChallengeEntryStanding",ChallengeEntryComparison:"ChallengeEntryComparison",ChallengeReport:"ChallengeReport",AnnouncementReport:"AnnouncementReport",ChallengeJudge:"ChallengeJudge",ChallengeCategory:"ChallengeCategory",ChallengeEngagement:"ChallengeEngagement",ChallengeWinner:"ChallengeWinner",ChallengeEvent:"ChallengeEvent",QuestionRank:"QuestionRank",AnswerRank:"AnswerRank",ModelReportStat:"ModelReportStat",ArticleStat:"ArticleStat",ArticleRank:"ArticleRank",UserStat:"UserStat",UserRank:"UserRank",TagStat:"TagStat",TagRank:"TagRank",ImageModHelper:"ImageModHelper",ModelHash:"ModelHash",PostHelper:"PostHelper",PostStat:"PostStat",CollectionStat:"CollectionStat",CollectionRank:"CollectionRank",ImageTag:"ImageTag",ModelTag:"ModelTag",ImageResourceHelper:"ImageResourceHelper",PostResourceHelper:"PostResourceHelper",PostImageTag:"PostImageTag",PostTag:"PostTag",ResourceReviewHelper:"ResourceReviewHelper",GenerationCoverage:"GenerationCoverage",UserProfile:"UserProfile",BountyStat:"BountyStat",BountyRank:"BountyRank",BountyEntryStat:"BountyEntryStat",BountyEntryRank:"BountyEntryRank",ClubStat:"ClubStat",ClubRank:"ClubRank",EntityMetric:"EntityMetric",EntityMetricImage:"EntityMetricImage",TagsOnImageDetails:"TagsOnImageDetails",ComicProject:"ComicProject",ComicProjectMetric:"ComicProjectMetric",ComicChapter:"ComicChapter",ComicChapterRead:"ComicChapterRead",ComicReference:"ComicReference",ComicReferenceImage:"ComicReferenceImage",ComicProjectReference:"ComicProjectReference",ComicPanel:"ComicPanel",ComicProjectEngagement:"ComicProjectEngagement",ComicPanelReference:"ComicPanelReference",UserRestriction:"UserRestriction",UserStrike:"UserStrike",GenerationPreset:"GenerationPreset",WildcardSet:"WildcardSet",WildcardSetCategory:"WildcardSetCategory",ScannerL
12abelReview:"ScannerLabelReview",ScannerContentSnapshot:"ScannerContentSnapshot",Model3DLicense:"Model3DLicense",Model3D:"Model3D",Model3DFile:"Model3DFile",TagsOnModel3D:"TagsOnModel3D",Model3DEngagement:"Model3DEngagement",Model3DReport:"Model3DReport",Model3DReview:"Model3DReview",Model3DReviewReport:"Model3DReviewReport",Model3DMetric:"Model3DMetric",ShopifyCustomerLink:"ShopifyCustomerLink",ShopifyMerchOrder:"ShopifyMerchOrder",Outbox:"Outbox",AppPageAccess:"AppPageAccess",PlacementSpace:"PlacementSpace",Placement:"Placement",PlacementTransaction:"PlacementTransaction",PlacementSuspension:"PlacementSuspension",UserHub:"UserHub",UserHubFollow:"UserHubFollow",UserHubSource:"UserHubSource",Blurb:"Blurb",BlurbReference:"BlurbReference"},a.PrismaClient=class{constructor(){return new Proxy(this,{get(e,t){let a=d();throw Error((a.isEdge?`PrismaClient is not configured to run in ${a.prettyName}. In order to run Prisma Client on edge runtime, either: 13- Use Prisma Accelerate: https://pris.ly/d/accelerate 14- Use Driver Adapters: https://pris.ly/d/driver-adapters 15`:"PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `"+a.prettyName+"`).")+` 16If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`)}})}},Object.assign(a,l)},220708,(e,t,a)=>{t.exports=e.r(269852)},198091,666545,e=>{"use strict";var t=e.i(389959),a=e.i(176653);e.i(954563);var n=e.i(788015),o=e.i(310059);e.i(220708);let r=(e,t)=>`NOT EXISTS ( 17 SELECT 1 FROM "UserEngagement" blk 18 WHERE (blk."userId" = ${e} AND blk."targetUserId" = ${t} AND blk.type IN ('Block', 'Hide')) 19 OR (blk."userId" = ${t} AND blk."targetUserId" = ${e} AND blk.type = 'Block') 20 )`,i=(e,t)=>`NOT EXISTS ( 21 WITH RECURSIVE muteable_threads AS ( 22 SELECT ${t} "id", 0 "depth" 23 UNION ALL 24 SELECT pc."threadId", mt."depth" + 1 25 FROM muteable_threads mt 26 JOIN "Thread" th ON th.id = mt."id" 27 JOIN "CommentV2" pc ON pc.id = th."commentId" 28 WHERE mt."depth" < 100 29 ) 30 SELECT 1 31 FROM muteable_threads mt 32 JOIN "ThreadMute" tm ON tm."threadId" = mt."id" 33 WHERE tm."userId" = ${e} 34 )`;o.object({id:o.number(),type:o.string(),details:o.record(o.string(),o.any())});
34let d=[100,500,1e3,1e4,5e4,1e5,5e5,1e6],s=[100,500,1e3,1e4,5e4],l={"article-view-milestone":{displayName:"Article view milestones",prepareMessage:({details:e})=>({message:`Congrats! Your article, "${e.articleTitle}" has received ${e.viewCount.toLocaleString()} views`,url:`/articles/${e.articleId}`}),category:n.NotificationCategory.Milestone,prepareQuery:async({lastSentDate:e,clickhouse:t})=>{if(!t)return;let n=JSON.stringify((await t.$query` 35 SELECT DISTINCT entityId 36 FROM views 37 WHERE time > ${e} 38 AND entityType = 'Article' 39 `).map(e=>e.entityId));return` 40 WITH milestones AS ( 41 SELECT * FROM (VALUES ${d.map(e=>`(${e})`).join(", ")}) m(value) 42 ), val AS ( 43 SELECT 44 "articleId" article_id, 45 "viewCount" view_count 46 FROM "ArticleMetric" am 47 WHERE 48 am."articleId" = ANY (SELECT json_array_elements('${n}'::json)::text::integer) 49 AND "viewCount" >= ${d[0]} 50 AND timeframe = 'AllTime' 51 ), milestone AS ( 52 SELECT 53 a."userId" "ownerId", 54 JSON_BUILD_OBJECT( 55 'articleTitle', a.title, 56 'articleId', a.id, 57 'viewCount', ms.value 58 ) "details" 59 FROM val 60 JOIN "Article" a on a.id = val.article_id 61 JOIN milestones ms ON ms.value <= val.view_count 62 WHERE a."createdAt" > '${a.milestoneNotificationFix}' 63 ) 64 SELECT 65 CONCAT('article-view-milestone:', details->>'articleId', ':', details->>'viewCount') "key", 66 "ownerId" "userId", 67 'article-view-milestone' "type", 68 details 69 FROM milestone 70 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'article-view-milestone') 71 `}},"article-like-milestone":{displayName:"Article like milestones",category:n.NotificationCategory.Milestone,prepareMessage:({details:e})=>({message:`Congrats! Your article, "${e.articleTitle}" has received ${e.favoriteCount.toLocaleString()} likes`,url:`/articles/${e.articleId}`}),prepareQuery:({lastSent:e})=>` 72 WITH milestones AS ( 73 SELECT * FROM (VALUES ${s.map(e=>`(${e})`).join(", ")}) m(value) 74 ), affected AS ( 75 SELECT DISTINCT 76 "articleId" article_id 77 FROM "CollectionItem" ci 78 JOIN "Collection" c ON ci."collectionId" = c.id AND c."type" = 'Article' AND c."mode" = 'Bookmark' 79 JOIN "Article" a ON ci."articleId" = a.id 80 WHERE ci."createdAt" > '${e}' 81 AND a."userId" > 0 82 ), val AS ( 83 SELECT 84 article_id, 85 "favoriteCount" favorite_count 86 FROM "ArticleMetric" am 87 JOIN affected af ON af.article_id = am."articleId" 88 WHERE 89 timeframe = 'AllTime' 90 AND "favoriteCount" >= ${s[0]} 91 ), milestone AS ( 92 SELECT 93 a."userId" "ownerId", 94 JSON_BUILD_OBJECT( 95 'articleTitle', a.title, 96 'articleId', a.id, 97 'favoriteCount', ms.value 98 ) "details" 99 FROM val 100 JOIN "Article" a on a.id = val.article_id 101 JOIN milestones ms ON ms.value <= val.favorite_count 102 WHERE a."createdAt" > '${a.milestoneNotificationFix}' 103 ) 104 SELECT 105 CONCAT('article-like-milestone:', details->>'articleId', ':', details->>'favoriteCount') "key", 106 "ownerId" "userId", 107 'article-like-milestone' "type", 108 details 109 FROM milestone 110 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'article-like-milestone') 111 `},"new-article-from-following":{displayName:"New articles from followed users",category:n.NotificationCategory.Update,prepareMessage:({details:e})=>({message:`${e.username} published a new ${e.articleCategory} article: "${e.articleTitle}"`,url:`/articles/${e.articleId}`}),prepareQuery:({lastSent:e})=>` 112 WITH article_categories AS ( 113 SELECT 114 t.id, 115 t.name 116 FROM "Tag" t 117 JOIN "TagsOnTags" tt ON tt."toTagId" = t.id 118 JOIN "Tag" f ON f.id = tt."fromTagId" 119 WHERE f.name = 'article category' 120 ), new_article AS ( 121 SELECT DISTINCT 122 ue."userId" "ownerId", 123 JSONB_BUILD_OBJECT( 124 'articleId', a.id, 125 'articleTitle', a.title, 126 'username', u.username, 127 'articleCategory', ac.name 128 ) "details" 129 FROM "Article" a 130 JOIN ( 131 SELECT 132 toa."articleId", 133 ac.name, 134 row_number() OVER (PARTITION BY toa."articleId") row 135 FROM article_categories ac 136 JOIN "TagsOnArticle" toa ON toa."tagId" = ac.id 137 ) ac ON ac."articleId" = a.id AND ac.row = 1 138 JOIN "User" u ON u.id = a."userId" 139 JOIN "UserEngagement" ue ON ue."targetUserId" = a."userId" AND a."publishedAt" >= ue."createdAt" AND ue.type = 'Follow' 140 WHERE a."publishedAt" > '${e}' 141 AND ${r('ue."userId"','a."userId"')} 142 ) 143 SELECT 144 CONCAT('new-article-from-following:', details->>'articleId') "key", 145 "ownerId" "userId", 146 'new-article-from-following' "type", 147 details 148 FROM new_article 149 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-article-from-following') 150 `}};var u=e.i(279593);let c={"new-comic-chapter":{displayName:"New comic chapter",category:n.NotificationCategory.Update,prepareMessage:({details:e})=>({message:`${e.authorUsername} published a new chapter "${e.chapterName}" in "${e.comicProjectName}"`,url:`/comics/${e.comicProjectId}`})},"new-comic-comment":{displayName:"New comic comment",category:n.NotificationCategory.Comment,prepareMessage:({details:e})=>{let t=(0,u.slugit)(e.comicProjectName||"comic"),a=(0,u.slugit)(e.chapterName||"chapter"),n=null!=e.chapterPosition&&null!=e.commentId?`/comics/${e.comicProjectId}/${t}/${e.chapterPosition+1}/${a}?highlight=${e.commentId}`:`/comics/${e.comicProjectId}`;return{message:`${e.commenterUsername} commented on "${e.chapterName}" in "${e.comicProjectName}"`,url:n}}}},m={"article-rating-review-approved":{displayName:"Article rating dispute approved",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>
150{if(!e)return;let{articleTitle:t,articleId:a,previousLevel:n,newLevel:o,modComment:r}=e,i=`Your rating dispute on "${t}" was approved â the rating was updated from ${n} to ${o}.`;return{message:r?`${i} Moderator note: ${r}`:i,url:`/articles/${a}`}}},"article-rating-review-rejected":{displayName:"Article rating dispute declined",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>{if(!e)return;let{articleTitle:t,articleId:a,appliedLevel:n,currentLevel:o,modComment:r}=e,i=null!=n?`Your rating dispute on "${t}" was reviewed â a moderator set the rating to ${n}.`:`Your rating dispute on "${t}" was declined â the current rating (${o}) was kept.`;return{message:r?`${i} Reason: ${r}`:i,url:`/articles/${a}`}}}};var p=e.i(120208);let I={"article-unpublished":{displayName:"Article unpublished",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>{if(!e)return;let t="other"!==e.reason?(0,p.getArticleUnpublishReason)(e.reason)?.notificationMessage:e.customMessage;return{message:t?`Your article "${e.articleTitle}" has been unpublished: ${t}`:`Your article "${e.articleTitle}" has been unpublished.`,url:`/articles/${e.articleId}`}},prepareQuery:({lastSent:e})=>` 151 WITH unpublished AS ( 152 SELECT DISTINCT 153 a."userId", 154 jsonb_build_object( 155 'articleId', a.id, 156 'articleTitle', a.title, 157 'reason', a.metadata->>'unpublishedReason', 158 'customMessage', a.metadata->>'customMessage' 159 ) "details" 160 FROM "Article" a 161 WHERE jsonb_typeof(a.metadata->'unpublishedReason') = 'string' 162 AND (a.metadata->>'unpublishedAt')::timestamp > '${e}' 163 ) 164 SELECT 165 concat('article-unpublished:', details->>'articleId', ':', '${e}') "key", 166 "userId", 167 'article-unpublished' "type", 168 details 169 FROM unpublished; 170 `}},g="/apps/build";function h(e){let t=e.name?.trim();return t?`Your app block "${t}"`:"Your app block"}let y={"app-block-approved":{displayName:"App block approved",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:`${h(t)} was approved and is being built and deployed.`,url:g}}},"app-block-rejected":{displayName:"App block not approved",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{var t,a;let n,o=e.details;return{message:(t=`${h(o)} was not approved`,a=o.reason,(n=a?.trim())?`${t}: ${n}`:`${t}.`),url:g}}}},C="/apps/invites";function A(e){return e.appBlockId?`/apps/${e.appBlockId}`:"/apps"}function E(e){let t=e.name?.trim();return t?`the app "${t}"`:`the app ${e.slug}`}let N={"app-collaborator-invited":{displayName:"App collaborator invitation",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:`You were invited to collaborate on ${E(t)}.`,url:C}}},"app-collaborator-accepted":{displayName:"App collaborator accepted",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:`Your collaborator invitation for ${E(t)} was accepted.`,url:A(t)}}},"app-collaborator-removed":{displayName:"App collaborator removed",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:`You are no longer a collaborator on ${E(t)}.`,url:"/apps"}}},"app-ownership-transfer-offered":{displayName:"App ownership transfer offered",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:`You were offered ownership of ${E(t)}. Accept it to take over.`,url:C}}},"app-ownership-transfer-accepted":{displayName:"App ownership transfer accepted",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:`Ownership of ${E(t)} was transferred.`,url:A(t)}}}},f="/apps/build";function b(e){return e.name?`"${e.name}"`:"Your app"}function w(e,t){let a=t?.trim();return a?`${e}: ${a}`:`${e}.`}let S={"app-listing-approved":{displayName:"App listing approved",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:`${b(t)} was approved and is now live in the app store.`,url:f}}},"app-listing-rejected":{displayName:"App listing not approved",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:w(`${b(t)} was not approved`,t.reason),url:f}}},"app-listing-hidden":{displayName:"App listing hidden",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:w(`${b(t)}
170 was hidden from the app store by a moderator`,t.reason),url:f}}},"app-listing-purged":{displayName:"App listing removed",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:w(`${b(t)} store listing was removed by a moderator, and its store address is no longer reserved`,t.reason),url:f}}},"app-listing-reset-to-pending":{displayName:"App listing needs re-review",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:w(`${b(t)} was sent back for another review by a moderator`,t.reason),url:f}}}},T={"app-moderator-message":{displayName:"Message from Civitai moderation",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:`Civitai moderation sent you a message about your app "${t.slug}" â ${t.subject}: ${t.body} (Replies to this notification are not delivered; contact the team at civitai.com/support.)`,url:f}}}};var R=e.i(609265),v=e.i(523264);let k={"won-auction":{displayName:"Won Auction",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:`Congratulations! Your bid on ${t.name??"your item"} won! It will be featured${t.until?` until ${t.until}`:""}${t.position?` in the ${(0,v.asOrdinal)(t.position)} spot`:""} on the site.`,url:`/auctions/${R.MY_BIDS}`}}},"dropped-out-auction":{displayName:"Losing Auction",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:`Your bid on ${t.name??"your item"} has fallen out of its winning position. Increase your bid to win!`,url:`/auctions/${R.MY_BIDS}`}}},"failed-recurring-bid-auction":{displayName:"Failed Recurring Bid",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:`Your recurring bid for ${t.auctionName??"an auction"} failed. Please try adding more Buzz to your account, or contact us.`,url:`/auctions/${R.MY_BIDS}`}}},"canceled-bid-auction":{displayName:"Canceled Bid",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:e=>{let t=e.details;return{message:`Your ${t.recurring?"recurring ":""}bid for ${t.name??"your item"} was canceled. Reason: ${t.reason}.`,url:`/auctions/${R.MY_BIDS}`}}}};function M(e){if(!e.length)return"";for(let t of e)if(!Number.isInteger(t))throw Error(`non-integer excluded user id: ${t}`);return`AND r."userId" NOT IN (${e.join(",")})`}let O=[5,10,20,50,100],P={"benefactor-joined":{displayName:"Supporter joined bounty",category:n.NotificationCategory.Bounty,toggleable:!1,prepareMessage:({details:e})=>({message:`${e.benefactorUsername} added ${e.amount} to your bounty "${e.bountyName}"`,url:`/bounties/${e.bountyId}`}),prepareQuery:async({lastSent:e})=>` 171 WITH data AS ( 172 SELECT DISTINCT 173 bo."userId" "ownerId", 174 jsonb_build_object( 175 'bountyId', bb."bountyId", 176 'bountyName', b.name, 177 'benefactorId', bb."userId", 178 'benefactorUsername', u.username, 179 'amount', bb."unitAmount" 180 ) as "details", 181 bb."bountyId", 182 bb."userId" "benefactorUserId" 183 FROM "BountyBenefactor" bb 184 JOIN "User" u ON u.id = bb."userId" 185 JOIN "Bounty" b ON b.id = bb."bountyId" 186 JOIN "BountyBenefactor" bo ON bo."bountyId" = bb."bountyId" AND bo."createdAt" < bb."createdAt" 187 WHERE bb."createdAt" > '${e}' 188 ) 189 SELECT 190 CONCAT('benefactor-joined:',"bountyId",':',"benefactorUserId") "key", 191 "ownerId" "userId", 192 'benefactor-joined' "type", 193 details 194 FROM data 195 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'benefactor-joined') 196 `},"bounty-ending":{displayName:"Bounty you are involved in is ending",category:n.NotificationCategory.Bounty,prepareMessage:({details:e})=>({message:`The bounty "${e.bountyName}" is ending in 24 hours`,url:`/bounties/${e.bountyId}`}),prepareQuery:async({lastSent:e})=>` 197 WITH affected AS ( 198 SELECT DISTINCT b.id 199 FROM "Bounty" b 200 WHERE 201 -- Now is in 24 hour expiration window 202 now() BETWEEN b."expiresAt" - interval '24 hours' AND b."expiresAt" 203 -- And last send was before 24 hour window 204 AND '${e}' < b."expiresAt" - interval '24 hours' 205 ), target_users AS ( 206 SELECT DISTINCT id, "userId" 207 FROM ( 208 SELECT 209 b.id, 210 bb."userId" 211 FROM affected a 212 JOIN "Bounty" b ON b.id = a.id 213 JOIN "BountyBenefactor" bb ON b.id = bb."bountyId" 214 WHERE bb."awardedAt" IS NULL 215 UNION ALL 216 SELECT 217 b.id, 218 be."userId" 219 FROM affected a 220 JOIN "Bounty" b ON b.id = a.id 221 JOIN "BountyEngagement" be ON b.id = be."bountyId" 222 WHERE be.type = 'Track' 223 ) b 224 ), data AS ( 225 SELECT DISTINCT 226 tu."userId" "ownerId", 227 jsonb_build_object( 228 'bountyId', b.id, 229 'bountyName', b.name, 230 'bountyEnd', b."expiresAt" 231 ) as "details", 232 b.id "bountyId" 233 FROM affected a 234 JOIN "Bounty" b ON b.id = a.id 235 JOIN target_users tu ON tu.id = b.id 236 ) 237 SELECT 238 CONCAT('bounty-ending:',"bountyId") "key", 239 "ownerId" "userId", 240 'bounty-ending' "type", 241 details 242 FROM data 243 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'bounty-ending') 244 `},"bounty-awarded":{displayName:"Bounty awarded to you",category:n.NotificationCategory.Bounty,prepareMessage:({details:e})=>({message:`Congrats! You have been awarded ${e.awardAmount} by ${e.benefactorUsername} for your work on "${e.bountyName}"`,url:`/bounties/${e.bountyId}`}),prepareQuery:async({lastSent:e})=>` 245 WITH data AS ( 246 SELECT DISTINCT 247 be."userId" "ownerId", 248 jsonb_build_object( 249 'bountyEntryId', be.id, 250 'bountyId', be."bountyId", 251 'bountyName', b.name, 252 'benefactorUsername', bene.username, 253 'benefactorId', bb."userId",
254 'awardAmount', bb."unitAmount" 255 ) as "details", 256 be."bountyId", 257 bb."userId" "benefactorUserId" 258 FROM "BountyBenefactor" bb 259 JOIN "Bounty" b ON b.id = bb."bountyId" 260 JOIN "User" bene ON bb."userId" = bene.id 261 JOIN "BountyEntry" be ON be.id = bb."awardedToId" 262 WHERE bb."awardedAt" > '${e}' AND bb."userId" != be."userId" 263 ) 264 SELECT 265 -- TODO maybe remove the userIds here 266 CONCAT('bounty-awarded:', "ownerId",':',"bountyId",':',"benefactorUserId") "key", 267 "ownerId" "userId", 268 'bounty-awarded' "type", 269 details 270 FROM data 271 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'bounty-awarded') 272 `},"bounty-reaction-milestone":{displayName:"Bounty entry reaction milestones",category:n.NotificationCategory.Bounty,prepareMessage:({details:e})=>({message:`Your bounty entry on "${e.bountyName}" has reached ${e.reactionCount.toLocaleString()} reactions`,url:`/bounties/${e.bountyId}/entries/${e.bountyEntryId}`}),prepareQuery:async({lastSent:e,excludedUserIds:t})=>{let n=M(t??[]);return` 273 WITH milestones AS ( 274 SELECT * FROM (VALUES ${O.map(e=>`(${e})`).join(", ")}) m(value) 275 ), affected AS ( 276 SELECT DISTINCT 277 "bountyEntryId" 278 FROM "BountyEntryReaction" 279 WHERE "createdAt" > '${e}' 280 ), affected_value AS ( 281 SELECT 282 r."bountyEntryId", 283 COUNT(*) "reaction_count" 284 FROM affected a 285 JOIN "BountyEntryReaction" r ON r."bountyEntryId" = a."bountyEntryId" ${n} 286 GROUP BY r."bountyEntryId" 287 ), data AS ( 288 SELECT DISTINCT 289 be."userId" "ownerId", 290 jsonb_build_object( 291 'bountyId', be."bountyId", 292 'bountyName', b.name, 293 'bountyEntryId', be.id, 294 'reactionCount', ms.value 295 ) as "details", 296 a."bountyEntryId", 297 ms.value "milestone" 298 FROM affected_value a 299 JOIN "BountyEntry" be ON be.id = a."bountyEntryId" 300 JOIN "Bounty" b ON b.id = be."bountyId" 301 JOIN milestones ms ON ms.value <= a.reaction_count 302 WHERE b."createdAt" > '${a.milestoneNotificationFix}' 303 ) 304 SELECT 305 CONCAT('bounty-reaction-milestone:',"bountyEntryId",':',milestone) "key", 306 "ownerId" "userId", 307 'bounty-reaction-milestone' "type", 308 details 309 FROM data 310 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'bounty-reaction-milestone') 311 `}},"bounty-entry":{displayName:"New entry on bounty you are involved in",category:n.NotificationCategory.Bounty,prepareMessage:({details:e})=>({message:`${e.hunterUsername} has submitted an entry to the bounty "${e.bountyName}"`,url:`/bounties/${e.bountyId}/entries/${e.bountyEntryId}`}),prepareQuery:async({lastSent:e})=>` 312 WITH affected AS ( 313 SELECT DISTINCT 314 "bountyId" 315 FROM "BountyEntry" be 316 WHERE "createdAt" > '${e}' 317 ), target_users AS ( 318 SELECT DISTINCT id, "userId" 319 FROM ( 320 SELECT 321 b.id, 322 bb."userId" 323 FROM affected a 324 JOIN "Bounty" b ON b.id = a."bountyId" 325 JOIN "BountyBenefactor" bb ON b.id = bb."bountyId" 326 UNION ALL 327 SELECT 328 b.id, 329 be."userId" 330 FROM affected a 331 JOIN "Bounty" b ON b.id = a."bountyId" 332 JOIN "BountyEngagement" be ON b.id = be."bountyId" 333 ) b 334 ), data AS ( 335 SELECT DISTINCT 336 tu."userId" "ownerId", 337 JSONB_BUILD_OBJECT( 338 'bountyName', b.name, 339 'bountyId', b.id, 340 'hunterUsername', u.username, 341 'bountyEntryId', be.id 342 ) as details, 343 be.id "bountyEntryId" 344 FROM target_users tu 345 JOIN "Bounty" b ON b.id = tu.id 346 JOIN "BountyEntry" be ON be."bountyId" = tu.id AND be."createdAt" > '${e}' 347 JOIN "User" u ON u.id = be."userId" 348 WHERE be."userId" != tu."userId" 349 ) 350 SELECT 351 CONCAT('bounty-entry:',"bountyEntryId") "key", 352 "ownerId" "userId", 353 'bounty-entry' "type", 354 details 355 FROM data 356 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'bounty-entry') 357 `}};var D=e.i(237816);let L={"tip-received":{displayName:"Tip Received",category:n.NotificationCategory.Buzz,prepareMessage:({details:e})=>{let{url:t,notification:a}
357=(0,D.parseBuzzTransactionDetails)(e);return{message:`${a}${e.message?` They said: "${e.message}".`:""}`,url:t}}},"deposit-confirmed":{displayName:"Crypto Deposit Confirmed",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:({details:e})=>{let t=Number(e.buzzAmount).toLocaleString(),a=e.bonusBuzz&&Number(e.bonusBuzz)>0?` (plus ${Number(e.bonusBuzz).toLocaleString()} bonus Buzz)`:"";return{message:`Your crypto deposit has been confirmed! ${t} Buzz${a} has been added to your account.`,url:"/user/transactions"}}},"partially-paid":{displayName:"Partially Paid",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:()=>({message:"Thanks for purchasing Buzz via Crypto! We received a partial payment, likely due to network or conversion fees. You've been credited Buzz based on the amount received",url:"/user/transactions"})},"redeemable-code-ready":{displayName:"Redeemable Code Ready",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:({details:e})=>{let t="Buzz"===e.codeType?`${Number(e.unitValue).toLocaleString()} Buzz`:`${e.unitValue}-month Membership`;return{message:`Your crypto payment has been confirmed! Your redeemable code for ${t} is ready. View it in your Buzz Dashboard.`,url:"/user/buzz-dashboard"}}}},$={"membership-gift-received":{displayName:"Membership Gift Received",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>{let t=e.from?`@${e.from}`:"Someone",a=e.message?` They said: "${e.message}"`:"";return{message:`${t} gifted you ${e.months} month${1===e.months?"":"s"} of ${e.tier} membership! ð${a}`,url:"/user/membership"}}},"membership-gift-sent":{displayName:"Membership Gift Sent",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:`Your gift of ${e.months} month${1===e.months?"":"s"} of ${e.tier} membership has been delivered to @${e.to}`,url:"/user/membership"})}},F={"challenge-winner":{displayName:"Challenge Winner",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:`You placed ${(0,v.asOrdinal)(e.position)} in the "${e.challengeName}" challenge!${e.prize>0?` You've won ${(0,v.numberWithCommas)(e.prize)} Buzz.`:""}`,url:`/challenges/${e.challengeId}`})},"challenge-participation":{displayName:"Challenge Participation",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:`You've submitted enough entries to earn the participation prize in the "${e.challengeName}" challenge! You've won ${(0,v.numberWithCommas)(e.prize)} Buzz.`,url:`/challenges/${e.challengeId}`})},"challenge-rejection":{displayName:"Challenge Rejection",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:`${e.count} entries to the "${e.challengeName}" challenge have been declined. Consider making new entries to improve your chances of winning!`,url:`/challenges/${e.challengeId}`})},"challenge-resource":{displayName:"Your resource has been selected for today's challenge",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:`Your resource "${e.resourceName}" has been selected for the "${e.challengeName}" challenge! Check all the details by clicking on this notification.`,url:`/challenges/${e.challengeId}`})},"challenge-cancelled":{displayName:"Challenge Cancelled",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:`The "${e.challengeTitle}" challenge was cancelled. The prize pool portion of your entry fee (${(0,v.numberWithCommas)(e.refundedBuzz)} Buzz per entry) has been refunded to your account â the platform fee portion of each entry is not refunded.`,url:`/challenges/${e.challengeId}`})},"challenge-starting":{displayName:"Challenge you follow is starting",category:n.NotificationCategory.Update,toggleable:!0,prepareMessage:({details:e})=>({message:`The "${e.challengeTitle}" challenge is now live â submit your entries!`,url:`/challenges/${e.challengeId}`})},"new-challenge-from-following":{displayName:"New challenges from followed users",category:n.NotificationCategory.Update,toggleable:!0,prepareMessage:({details:e})=>({message:`${e.username} posted a new challenge: ${e.challengeTitle}`,url:`/challenges/${e.challengeId}`}),prepareQuery:({lastSent:e})=>` 358 WITH new_challenge_from_following AS ( 359 SELECT DISTINCT 360 ue."userId" "ownerId", 361 JSONB_BUILD_OBJECT( 362 'challengeId', c.id, 363 'challengeTitle', c.title, 364 'username', u.username 365 ) "details", 366 c.id "challengeId" 367 FROM "Challenge" c 368 JOIN "User" u ON u.id = c."createdById" 369 JOIN "UserEngagement" ue 370 ON ue."targetUserId" = c."createdById" AND ue.type = 'Follow' 371 JOIN "User" ru ON ru.id = ue."userId" 372 LEFT JOIN "Image" cover ON cover.id = c."coverImageId" 373 WHERE 374 c.source = 'User' 375 AND c.ingestion = 'Scanned' 376 AND c.status IN ('Scheduled', 'Active') 377 AND c."visibleAt" >= ue."createdAt" 378 -- 59s lookback buffer: the send-notifications cursor can advance past a visibleAt that 379 -- lands just before it. Duplicates are safe (ON CONFLICT upsert on key). 380 AND c."visibleAt" BETWEEN '${e}'::timestamptz - interval '59 second' AND now() 381 -- Wall-clock floor: bounds the Challenge x UserEngagement scan no matter how far behind 382 -- the cursor is. Do not replace with an incrementally-advancing row cap. 383 AND c."visibleAt" > NOW() - INTERVAL '30 minutes' 384 -- Both levels must intersect, matching the feed: Challenge.nsfwLevel is the MAX level the 385 -- challenge admits, so an X-rated challenge with a PG cover would otherwise be announced 386 -- to a PG-only follower who can never open it. 387 AND (cover."nsfwLevel" & ru."browsingLevel") <> 0 388 AND (c."nsfwLevel" & ru."browsingLevel") <> 0 389 -- A POI cover hides the challenge from both the feed and the detail page, so announcing 390 -- it would land the follower on a 404. 391 AND cover.poi IS NOT TRUE 392 AND NOT EXISTS ( 393 SELECT 1 FROM "UserEngagement" blk 394 WHERE ( 395 blk."userId" = ue."userId" 396 AND blk."targetUserId" = c."createdById" 397 AND blk.type IN ('Block', 'Hide') 398 ) OR ( 399 blk."userId" = c."createdById" 400 AND blk."targetUserId" = ue."userId" 401 AND blk.type = 'Block' 402 ) 403 ) 404 ) 405 SELECT 406 CONCAT('new-challenge-from-following:', "challengeId") "key", 407 "ownerId" "userId", 408 'new-challenge-from-following' "type", 409 details 410 FROM new_challenge_from_following 411 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-challenge-from-following') 412 `},"challenge-ending-soon":{displayName:"Challenge you are tracking is ending",category:n.NotificationCategory.Update,toggleable:!0,prepareMessage:({details:e})=>({message:`The "${e.challengeTitle}" challenge closes in 8 hours â get your entries in.`,url:`/challenges/${e.challengeId}`}),prepareQuery:({lastSent:e})=>` 413 WITH affected AS ( 414 SELECT c.id, c.title, c."collectionId" 415 FROM "Challenge" c 416 WHERE 417 c.status = 'Active' 418 -- Now is inside the 8 hour window... 419 AND now() BETWEEN c."endsAt" - interval '8 hours' AND c."endsAt" 420 -- ...and the last scan was before it, so this fires once on the crossing. 421 AND '${e}'::timestamptz < c."endsAt" - interval '8 hours' 422 -- A challenge <= 8h long crosses its own "8 hours left" mark at go-live, which 423 -- challenge-starting already announces. Excluding those also removes the race against 424 -- the hourly activation cron, which would otherwise never set status=Active in time. 425 AND c."startsAt" < c."endsAt" - interval '8 hours' 426 ), target_users AS ( 427 SELECT DISTINCT "challengeId", "userId" FROM ( 428 SELECT a.id "challengeId", ce."userId" 429 FROM affected a 430 JOIN "ChallengeEngagement" ce ON ce."challengeId" = a.id AND ce.type = 'Notify' 431 UNION ALL 432 SELECT a.id "challengeId", ci."addedById" "userId" 433 FROM affected a 434 JOIN "CollectionItem" ci ON ci."collectionId" = a."collectionId" 435 WHERE ci."addedById" IS NOT NULL 436 -- Matches the feed's Entered filter: a user whose only entry was rejected already got 437 -- challenge-rejection and is not competing. 438 AND ci.status IN ('ACCEPTED', 'REVIEW') 439 ) u 440 ) 441 SELECT 442 CONCAT('challenge-ending-soon:', a.id) "key", 443 tu."userId" "userId", 444 'challenge-ending-soon' "type", 445 JSONB_BUILD_OBJECT('challengeId', a.id, 'challengeTitle', a.title) "details" 446 FROM affected a 447 JOIN target_users tu ON tu."challengeId" = a.id 448 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = tu."userId" AND type = 'challenge-ending-soon') 449 `},"challenge-results":{displayName:"Results for a challenge you are tracking",category:n.NotificationCategory.Update,toggleable:!0,prepareMessage:({details:e})=>({message:`Winners have been announced for the "${e.challengeTitle}" challenge.`,url:`/challenges/${e.challengeId}`})}},U={"contest-collection-item-status-change":{displayName:"Your item has been reviewed",category:n.NotificationCategory.Update,toggleable:!1,prepareMessage:({details:e})=>({message:`The item you submitted to the contest "${e.collectionName}" has been ${e.status}.`,url:e.imageId?`/images/${e.imageId}`:e.modelId?`/models/${e.modelId}`:e.articleId?`/articles/${e.articleId}`:e.postId?`/posts/${e.postId}`:`/collections/${e.collectionId}`})},"collection-item-accepted":{displayName:"Your submission was accepted",category:n.NotificationCategory.Update,prepareMessage:({details:e})=>({message:`Your submission to ${e.collectionName} was accepted.`,url:e.imageId?`/images/${e.imageId}`:e.modelId?`/models/${e.modelId}`:e.articleId?`/articles/${e.articleId}`:e.postId?`/posts/${e.postId}`:`/collections/${e.collectionId}`})},"collection-item-rejected":{displayName:"Your submission wasn't accepted",category:n.NotificationCategory.Update,prepareMessage:({details:e})=>({message:e.reason?`Your submission to ${e.collectionName} wasn't accepted. ${e.reason}`:`Your submission to ${e.collectionName} wasn't accepted.`,url:e.imageId?`/images/${e.imageId}`:e.modelId?`/models/${e.modelId}`:e.articleId?`/articles/${e.articleId}`:e.postId?`/posts/${e.postId}`:`/collections/${e.collectionId}`})},"beggars-board-rejected":{displayName:"Beggars board entry declined",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:()=>({message:"Your entry to the Buzz Beggars Board was declined. Try again!",url:"/collections/3870938"})},"beggars-board-expired":{displayName:"Beggars board entry expired",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:()=>({message:"Your submission to the Buzz Beggars Board has expired. Time to make a new entry!",url:"/collections/3870938"})},"collection-update":{displayName:"New items added to a collection you follow",category:n.NotificationCategory.Update,toggleable:!0,prepareMessage:({details:e})=>({message:`New items have been added to the "${e.collectionName}" collection.`,url:`/collections/${e.collectionId}`})},"collection-submission-received":{displayName:"New entry submitted to your collection",category:n.NotificationCategory.Update,toggleable:!0,prepareMessage:({details:e})=>({message:`A new entry was submitted to "${e.collectionName}" and is waiting for review.`,url:`/collections/${e.collectionId}/review`})},"collection-invite-received":{displayName:"You were invited to collaborate on a collection",category:n.NotificationCategory.Update,toggleable:!0,prepareMessage:({details:e})=>({message:`You've been invited to help run "${e.collectionName}".`,url:`/collections/${e.collectionId}`})}};var B=e.i(615890),W=e.i(369289),H=e.i(941842),z=e.i(112578),_=e.i(146554),V=e.i(203121),Y=e.i(104825),x=e.i(691804),J=Object.prototype.hasOwnProperty;let j=function(e){if(null==e)return!0;
449if((0,_.default)(e)&&((0,z.default)(e)||"string"==typeof e||"function"==typeof e.splice||(0,V.default)(e)||(0,x.default)(e)||(0,H.default)(e)))return!e.length;var t=(0,W.default)(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if((0,Y.default)(e))return!(0,B.default)(e).length;for(var a in e)if(J.call(e,a))return!1;return!0};var q=e.i(554062),G=e.i(209971),K=e.i(326786);let Q=e=>`LEFT JOIN "app_listings" al ON al."serial_id" = ${e}`,X=e=>`(${e} IS NULL OR al.slug IS NOT NULL)`,Z='CASE WHEN al.kind = \'onsite\' THEN COALESCE(oc."userId", al."user_id") ELSE al."user_id" END',ee=new Map([["appListing","app listing"],["bountyEntry","bounty entry"],["comicProject","comic"],["model3d","3D model"]]),et=e=>ee.get(e)??e,ea=e=>`${["a","e","i","o","u"].includes(e[0])?"an":"a"} ${e}`,en=({threadType:e,threadParentId:t,...a})=>{let n=K.QS.stringify({highlight:a.commentId,commentParentType:a.commentParentType,commentParentId:a.commentParentId,threadId:a.threadId});return({model:`/models/${t}?dialog=commentThread&${n}`,image:`/images/${t}?${n}`,post:`/posts/${t}?${n}`,article:`/articles/${t}?${n}`,review:`/reviews/${t}?${n}`,bounty:`/bounties/${t}?${n}`,bountyEntry:`/bounties/entries/${t}?${n}`,challenge:`/challenges/${t}?${n}`,comicChapter:`/comics/${t}?${n}`,comicProject:`/comics/${t}?${n}`,model3d:`/3d-models/${t}?${n}`,appListing:a.appListingSlug?`${(0,q.getListingDetailHref)(a.appListingSlug)}?${n}`:void 0})[e]},eo=e=>`concat('comment:${e}:', details->>'commentId')`,er="concat('comment:', case when details->>'version' is not null then 'v2:' else 'v1:' end, details->>'commentId')",ei=`case 450 when details->>'version' is null then ${er} 451 when details->>'threadType' <> 'comment' then ${er} 452 end`,ed={"new-comment":{displayName:"New comments on your models",category:n.NotificationCategory.Comment,priority:4,prepareMessage:({details:e})=>({message:`${e.username} commented on your ${e.modelName} model`,url:(0,G.getModelCommentThreadUrl)({modelId:e.modelId,commentId:e.commentId})}),prepareQuery:({lastSent:e})=>` 453 WITH new_comments AS ( 454 SELECT DISTINCT 455 m."userId" "ownerId", 456 JSONB_BUILD_OBJECT( 457 'modelId', c."modelId", 458 'commentId', c.id, 459 'modelName', m.name, 460 'username', u.username 461 ) "details" 462 FROM "Comment" c 463 JOIN "User" u ON c."userId" = u.id 464 JOIN "Model" m ON m.id = c."modelId" 465 WHERE m."userId" > 0 466 AND c."parentId" IS NULL 467 AND c."createdAt" > '${e}' 468 AND c."userId" != m."userId" 469 AND ${r('m."userId"','c."userId"')} 470 ) 471 SELECT 472 concat('new-comment-model:owner:v1:', details->>'commentId') "key", 473 ${eo("v1")} "dedupeKey", 474 "ownerId" "userId", 475 'new-comment' "type", 476 details 477 FROM new_comments r 478 WHERE 479 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-comment') 480 `},"new-comment-response":{displayName:"New comment responses (Models)",category:n.NotificationCategory.Comment,priority:2,prepareMessage:({details:e})=>({message:`${e.username} responded to your comment on the ${e.modelName} model`,url:(0,G.getModelCommentThreadUrl)({modelId:e.modelId,commentId:e.parentId??e.commentId,highlight:e.commentId})}),prepareQuery:({lastSent:e})=>` 481 WITH new_comment_response AS ( 482 SELECT DISTINCT 483 p."userId" "ownerId", 484 JSONB_BUILD_OBJECT( 485 'modelId', c."modelId", 486 'commentId', c.id, 487 'parentId', p.id, 488 'modelName', m.name, 489 'username', u.username 490 ) "details" 491 FROM "Comment" c 492 JOIN "Comment" p ON p.id = c."parentId" 493 JOIN "User" u ON c."userId" = u.id 494 JOIN "Model" m ON m.id = c."modelId" 495 WHERE m."userId" > 0 496 AND c."createdAt" > '${e}' 497 AND c."userId" != p."userId" 498 AND ${r('p."userId"','c."userId"')} 499 ) 500 SELECT 501 concat('new-comment-response:owner:v1:', details->>'commentId') "key", 502 ${eo("v1")} "dedupeKey", 503 "ownerId" "userId", 504 'new-comment-response' "type", 505 details 506 FROM new_comment_response r 507 WHERE 508 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-comment-response') 509 `},"new-comment-nested":{displayName:"New responses to comments and reviews on your models",category:n.NotificationCategory.Comment,priority:4,prepareMessage:({details:e})=>({message:`${e.username} responded to a ${e.parentType} on your ${e.modelName} model`,url:`/models/${e.modelId}?dialog=${e.parentType}Thread&${e.parentType}Id=${e.parentId}&highlight=${e.commentId}`}),prepareQuery:({lastSent:e})=>` 510 WITH new_comments_nested AS ( 511 SELECT DISTINCT 512 m."userId" "ownerId", 513 JSONB_BUILD_OBJECT( 514 'modelId', c."modelId", 515 'commentId', c.id, 516 'parentId', c."parentId", 517 'parentType', CASE WHEN c."parentId" IS NOT NULL THEN 'comment' ELSE 'review' END, 518 'modelName', m.name, 519 'username', u.username 520 ) "details" 521 FROM "Comment" c 522 JOIN "User" u ON c."userId" = u.id
523 JOIN "Model" m ON m.id = c."modelId" 524 WHERE m."userId" > 0 525 AND c."parentId" IS NOT NULL 526 AND c."createdAt" > '${e}' 527 AND c."userId" != m."userId" 528 AND ${r('m."userId"','c."userId"')} 529 ) 530 SELECT 531 concat('new-comment-nested:user:v1:', details->>'commentId') "key", 532 ${eo("v1")} "dedupeKey", 533 "ownerId" "userId", 534 'new-comment-nested' "type", 535 details 536 FROM new_comments_nested r 537 WHERE 538 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-comment-nested') 539 `},"new-comment-reply":{displayName:"New comment replies",category:n.NotificationCategory.Comment,priority:2,prepareMessage:({details:e})=>{let t=en(e);return{message:`${e.username} replied to ${ea(et(e.threadType))} comment you made`,url:t}},prepareQuery:({lastSent:e})=>` 540 WITH new_comment_reply AS ( 541 SELECT DISTINCT 542 pc."userId" "ownerId", 543 JSONB_BUILD_OBJECT( 544 'version', 2, 545 'commentId', c.id, 546 'threadId', c."threadId", 547 'threadParentId', COALESCE( 548 root."imageId", 549 root."modelId", 550 root."postId", 551 root."questionId", 552 root."answerId", 553 root."reviewId", 554 root."articleId", 555 root."bountyId", 556 root."bountyEntryId", 557 root."challengeId", 558 root."model3dId", 559 root."comicProjectId" 560 ), 561 'threadType', CASE 562 WHEN root."imageId" IS NOT NULL THEN 'image' 563 WHEN root."modelId" IS NOT NULL THEN 'model' 564 WHEN root."postId" IS NOT NULL THEN 'post' 565 WHEN root."questionId" IS NOT NULL THEN 'question' 566 WHEN root."answerId" IS NOT NULL THEN 'answer' 567 WHEN root."reviewId" IS NOT NULL THEN 'review' 568 WHEN root."articleId" IS NOT NULL THEN 'article' 569 WHEN root."bountyId" IS NOT NULL THEN 'bounty' 570 WHEN root."bountyEntryId" IS NOT NULL THEN 'bountyEntry' 571 WHEN root."challengeId" IS NOT NULL THEN 'challenge' 572 WHEN root."model3dId" IS NOT NULL THEN 'model3d' 573 WHEN root."comicProjectId" IS NOT NULL THEN 'comicProject' 574 -- App-store listing threads are SLUG-addressed, so this arm keys on the 575 -- JOINED slug rather than on an id column. al only joins through 576 -- root."appListingId", so a non-null slug already means: this is an 577 -- appListing thread AND its listing resolved. 578 WHEN al.slug IS NOT NULL THEN 'appListing' 579 ELSE 'comment' 580 END, 581 'appListingSlug', al.slug, 582 'commentParentId', t."commentId", 583 'commentParentType', 'comment', 584 'username', u.username 585 ) "details" 586 FROM "CommentV2" c 587 JOIN "Thread" t ON t.id = c."threadId" 588 JOIN "CommentV2" pc ON pc.id = t."commentId" 589 JOIN "User" u ON c."userId" = u.id 590 JOIN "Thread" root ON root.id = t."rootThreadId" 591 ${Q('root."appListingId"')} 592 WHERE c."createdAt" > '${e}' AND c."userId" != pc."userId" 593 AND ${r('pc."userId"','c."userId"')} 594 AND ${i('pc."userId"',"t.id")} 595 -- appListing (app-store listing) threads DO emit replies now â the join above 596 -- resolves the slug threadUrlMap needs. This drops only the rows that join 597 -- failed on, so we never ship an unlinkable notification. (appListingId lives 598 -- on the root here.) 599 AND ${X('root."appListingId"')} 600 ) 601 SELECT 602 concat('new-comment-reply:owner:v2:', details->>'commentId') "key", 603 ${ei} "dedupeKey", 604 "ownerId" "userId", 605 'new-comment-reply' "type", 606 details 607 FROM new_comment_reply r 608 WHERE 609 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-comment-reply') 610 `},"new-thread-response":{displayName:"New replies to comment threads you are in",category:n.NotificationCategory.Comment,priority:3,prepareMessage:({details:e})=>
610{if(!e.version)return{message:`${e.username} responded to the ${e.parentType} thread on the ${e.modelName} model`,url:`/models/${e.modelId}?dialog=${e.parentType}Thread&${e.parentType}Id=${e.parentId}&highlight=${e.commentId}`};let t=en(e);return{message:`${e.username} responded to ${ea(et(e.threadType))} thread you're in`,url:t}},prepareQuery:({lastSent:e})=>` 611 WITH new_thread_response AS ( 612 SELECT DISTINCT 613 UNNEST((SELECT ARRAY_AGG("userId") FROM "Comment" cu WHERE cu."parentId" = c."parentId" AND cu."userId" != c."userId" AND ${r('cu."userId"','c."userId"')})) "ownerId", 614 JSONB_BUILD_OBJECT( 615 'modelId', c."modelId", 616 'commentId', c.id, 617 'parentId', c."parentId", 618 'parentType', 'comment', 619 'modelName', m.name, 620 'username', u.username 621 ) "details" 622 FROM "Comment" c 623 JOIN "Model" m ON m.id = c."modelId" 624 JOIN "User" u ON c."userId" = u.id 625 WHERE c."parentId" IS NOT NULL AND c."createdAt" > '${e}' 626 627 UNION 628 629 SELECT DISTINCT 630 UNNEST((SELECT ARRAY_AGG("userId") FROM "CommentV2" cu WHERE cu."threadId" = c."threadId" AND cu."userId" != c."userId" AND ${r('cu."userId"','c."userId"')} AND ${i('cu."userId"',"t.id")})) "ownerId", 631 JSONB_BUILD_OBJECT( 632 'version', 2, 633 'commentId', c.id, 634 'threadId', c."threadId", 635 'threadParentId', COALESCE( 636 root."imageId", 637 root."modelId", 638 root."postId", 639 root."questionId", 640 root."answerId", 641 root."reviewId", 642 root."articleId", 643 root."bountyId", 644 root."bountyEntryId", 645 root."challengeId", 646 root."model3dId", 647 root."comicProjectId", 648 t."imageId", 649 t."modelId", 650 t."postId", 651 t."questionId", 652 t."answerId", 653 t."reviewId", 654 t."articleId", 655 t."bountyId", 656 t."bountyEntryId", 657 t."challengeId", 658 t."model3dId", 659 t."comicProjectId" 660 ), 661 'threadType', CASE 662 WHEN COALESCE(root."imageId", t."imageId") IS NOT NULL THEN 'image' 663 WHEN COALESCE(root."modelId", t."modelId") IS NOT NULL THEN 'model' 664 WHEN COALESCE(root."postId", t."postId") IS NOT NULL THEN 'post' 665 WHEN COALESCE(root."questionId", t."questionId") IS NOT NULL THEN 'question' 666 WHEN COALESCE(root."answerId", t."answerId") IS NOT NULL THEN 'answer' 667 WHEN COALESCE(root."reviewId", t."reviewId") IS NOT NULL THEN 'review' 668 WHEN COALESCE(root."articleId", t."articleId") IS NOT NULL THEN 'article' 669 WHEN COALESCE(root."bountyId", t."bountyId") IS NOT NULL THEN 'bounty' 670 WHEN COALESCE(root."bountyEntryId", t."bountyEntryId") IS NOT NULL THEN 'bountyEntry' 671 WHEN COALESCE(root."challengeId", t."challengeId") IS NOT NULL THEN 'challenge' 672 WHEN COALESCE(root."model3dId", t."model3dId") IS NOT NULL THEN 'model3d' 673 WHEN COALESCE(root."comicProjectId", t."comicProjectId") IS NOT NULL THEN 'comicProject' 674 -- SLUG-addressed; see the same arm in new-comment-reply above. 675 WHEN al.slug IS NOT NULL THEN 'appListing' 676 ELSE 'comment' 677 END, 678 'appListingSlug', al.slug, 679 'commentParentId', COALESCE( 680 t."imageId", 681 t."modelId", 682 t."postId", 683 t."questionId", 684 t."answerId", 685 t."reviewId", 686 t."articleId", 687 t."bountyId", 688 t."bountyEntryId", 689 t."challengeId", 690 t."model3dId", 691 t."commentId" 692 ), 693 'commentParentType', CASE 694 WHEN t."imageId" IS NOT NULL THEN 'image' 695 WHEN t."modelId" IS NOT NULL THEN 'model' 696 WHEN t."postId" IS NOT NULL THEN 'post' 697 WHEN t."questionId" IS NOT NULL THEN 'question' 698 WHEN t."answerId" IS NOT NULL THEN 'answer' 699 WHEN t."reviewId" IS NOT NULL THEN 'review' 700 WHEN t."articleId" IS NOT NULL THEN 'article' 701 WHEN t."bountyId" IS NOT NULL THEN 'bounty' 702 WHEN t."bountyEntryId" IS NOT NULL THEN 'bountyEntry' 703 WHEN t."challengeId" IS NOT NULL THEN 'challenge' 704 WHEN t."model3dId" IS NOT NULL THEN 'model3d' 705 ELSE 'comment' 706 END, 707 'username', u.username 708 ) "details" 709 FROM "CommentV2" c 710 JOIN "Thread" t ON t.id = c."threadId" 711 JOIN "User" u ON c."userId" = u.id
712 LEFT JOIN "Thread" root ON root.id = t."rootThreadId" 713 ${Q('COALESCE(root."appListingId", t."appListingId")')} 714 WHERE c."createdAt" > '${e}' 715 -- Unhandled thread types... 716 AND t."questionId" IS NULL 717 AND t."answerId" IS NULL 718 -- appListing threads emit here too, via the joined slug. COALESCE over BOTH the 719 -- root and the immediate thread, because the entity parent may sit on either. 720 AND ${X('COALESCE(root."appListingId", t."appListingId")')} 721 ) 722 SELECT 723 concat('new-thread-response:user:', case when details->>'version' is not null then 'v2:' else 'v1:' end, details->>'commentId') "key", 724 ${ei} "dedupeKey", 725 "ownerId" "userId", 726 'new-thread-response' "type", 727 details 728 FROM new_thread_response r 729 WHERE 730 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-thread-response') 731 `},"new-review-response":{displayName:"New review responses",category:n.NotificationCategory.Comment,priority:2,prepareMessage:({details:e})=>2!==e.version?{message:`${e.username} responded to your review on the ${e.modelName} model`,url:`/models/${e.modelId}?dialog=reviewThread&reviewId=${e.reviewId}&highlight=${e.commentId}`}:{message:`${e.username} responded to your review on the ${e.modelName} model`,url:`/reviews/${e.reviewId}?highlight=${e.commentId}`},prepareQuery:({lastSent:e})=>` 732 WITH new_review_response AS ( 733 SELECT DISTINCT 734 r."userId" "ownerId", 735 JSONB_BUILD_OBJECT( 736 'version', 2, 737 'modelId', r."modelId", 738 'commentId', c.id, 739 'reviewId', r.id, 740 'modelName', m.name, 741 'username', u.username 742 ) as "details" 743 FROM "CommentV2" c 744 JOIN "Thread" t ON t.id = c."threadId" 745 JOIN "ResourceReview" r ON r.id = t."reviewId" 746 JOIN "User" u ON c."userId" = u.id 747 JOIN "Model" m ON m.id = r."modelId" 748 WHERE m."userId" > 0 749 AND c."createdAt" > '${e}' 750 AND c."userId" != r."userId" 751 AND ${r('r."userId"','c."userId"')} 752 AND ${i('r."userId"',"t.id")} 753 ) 754 SELECT 755 concat('new-review-response:owner:v2:', details->>'commentId') "key", 756 ${eo("v2")} "dedupeKey", 757 "ownerId" "userId", 758 'new-review-response' "type", 759 details 760 FROM new_review_response r 761 WHERE 762 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-review-response') 763 `},"new-image-comment":{displayName:"New comments on your images",category:n.NotificationCategory.Comment,priority:4,prepareMessage:({details:e})=>{if(2===e.version){let t=`${e.username} commented on your image`;return e.modelName&&(t+=` posted to the ${e.modelName} model`),{message:t,url:`/images/${e.imageId}?highlight=${e.commentId}`}}let t=`${e.username} commented on your ${e.reviewId?"review image":"example image"} posted to the ${e.modelName} model`,a={model:e.modelId,modelVersionId:e.modelVersionId,highlight:e.commentId,infinite:"false"};return e.reviewId?(a.review=e.reviewId,a.returnUrl=`/models/${e.modelId}?dialog=reviewThread&reviewId=${e.reviewId}`):a.returnUrl=`/models/${e.modelId}`,{message:t,url:`/images/${e.imageId}?${new URLSearchParams(a).toString()}`}},prepareQuery:({lastSent:e})=>` 764 WITH new_image_comment AS ( 765 SELECT DISTINCT 766 i."userId" "ownerId", 767 JSONB_BUILD_OBJECT( 768 'version', 2, 769 'imageId', t."imageId", 770 'postId', i."postId", 771 'commentId', c.id, 772 'username', u.username, 773 'modelName', m.name, 774 'modelId', m.id, 775 'modelVersionId', p."modelVersionId", 776 'modelVersionName', mv.name 777 ) "details" 778 FROM "CommentV2" c 779 JOIN "Thread" t ON t.id = c."threadId" AND t."imageId" IS NOT NULL 780 JOIN "Image" i ON i.id = t."imageId" 781 JOIN "Post" p ON p.id = i."postId" 782 LEFT JOIN "ModelVersion" mv ON mv.id = p."modelVersionId"
783 LEFT JOIN "Model" m ON m.id = mv."modelId" 784 JOIN "User" u ON c."userId" = u.id 785 WHERE i."userId" > 0 786 AND c."createdAt" > '${e}' 787 AND c."userId" != i."userId" 788 AND ${r('i."userId"','c."userId"')} 789 AND ${i('i."userId"',"t.id")} 790 ) 791 SELECT 792 concat('new-comment-image:owner:v2:', details->>'commentId') "key", 793 ${eo("v2")} "dedupeKey", 794 "ownerId" "userId", 795 'new-image-comment' "type", 796 details 797 FROM new_image_comment 798 WHERE 799 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-image-comment'); 800 `},"new-post-comment":{displayName:"New comments on your posts",category:n.NotificationCategory.Comment,priority:4,prepareMessage:({details:e})=>{if(e.postTitle)return{message:`${e.username} commented on your post: "${e.postTitle}"`,url:`/posts/${e.postId}?highlight=${e.commentId}`};let t=`${e.username} commented on your post`;return e.modelName&&(t+=` on the ${e.modelName} model`),{message:t,url:`/posts/${e.postId}?highlight=${e.commentId}`}},prepareQuery:({lastSent:e})=>` 801 WITH new_post_comment AS ( 802 SELECT DISTINCT 803 p."userId" "ownerId", 804 JSONB_BUILD_OBJECT( 805 'version', 2, 806 'postId', p.id, 807 'postTitle', p.title, 808 'commentId', c.id, 809 'username', u.username, 810 'modelName', m.name 811 ) "details" 812 FROM "CommentV2" c 813 JOIN "User" u ON c."userId" = u.id 814 JOIN "Thread" t ON t.id = c."threadId" AND t."postId" IS NOT NULL 815 JOIN "Post" p ON p.id = t."postId" 816 LEFT JOIN "ModelVersion" mv ON mv.id = p."modelVersionId" 817 LEFT JOIN "Model" m ON m.id = mv."modelId" 818 WHERE p."userId" > 0 819 AND c."createdAt" > '${e}' 820 -- Two floors, because this type has no cursor row until its first successful run and so 821 -- inherits the job's GLOBAL last-run: new Date(0) on a fresh DB, and stale by the outage 822 -- duration after any send-notifications outage. Unfloored, one such deploy emits all 110k 823 -- historical post comments (measured; the query returns them in 2.6s, well inside the 20s 824 -- timeout, so nothing downstream stops it). 825 -- The launch date is the guard new-bounty-comment carries. It only bites for the first week 826 -- after it passes, but that is the window where a pre-launch comment could still be emitted. 827 AND c."createdAt" > '2026-08-06' 828 -- After that the rolling window is the one doing the work, and it never goes stale: it bounds 829 -- any first batch to ~7 days (~500 rows at the measured 3/hour) however far the cursor drifted. 830 AND c."createdAt" > NOW() - INTERVAL '7 days' 831 AND c."userId" != p."userId" 832 AND ${r('p."userId"','c."userId"')} 833 AND ${i('p."userId"',"t.id")} 834 ) 835 SELECT 836 concat('new-comment-post:owner:v2:', details->>'commentId') "key", 837 ${eo("v2")} "dedupeKey", 838 "ownerId" "userId", 839 'new-post-comment' "type", 840 details 841 FROM new_post_comment 842 WHERE 843 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-post-comment'); 844 `},"new-app-listing-comment":{displayName:"New comments on your app listings",category:n.NotificationCategory.Comment,priority:4,prepareMessage:({details:e})=>({message:`${e.username} commented on your app listing: "${e.listingName}"`,url:f}),prepareQuery:({lastSent:e})=>` 845 WITH new_app_listing_comment AS ( 846 SELECT DISTINCT 847 ${Z} "ownerId", 848 JSONB_BUILD_OBJECT( 849 'version', 2, 850 'commentId', c.id, 851 'appListingSlug', al.slug, 852 'listingName', al.name, 853 'username', u.username 854 ) "details" 855 FROM "CommentV2" c 856 JOIN "User" u ON c."userId" = u.id 857 -- TOP-LEVEL comments only. A reply's own thread is keyed by its parent COMMENT and carries 858 -- no "appListingId", so it never matches â replies stay with
858new-comment-reply / 859 -- new-thread-response. 860 -- 861 -- ð´ THIS PREDICATE IS BEHAVIOURALLY REDUNDANT, AND THAT IS DELIBERATE. The 862 -- app_listings join below is an INNER join on al."serial_id" = t."appListingId", and NULL 863 -- never equals anything, so a NULL "appListingId" is already excluded by the join itself: 864 -- removing this line produces BYTE-IDENTICAL result rows â executed against a real 865 -- Postgres 16 fixture by the #4184 audit, not reasoned about here. 866 -- 867 -- So a mutant that deletes it SURVIVES because it is UNREACHABLE â no input can make the 868 -- guard change the answer â NOT because a test forgot to assert it. The distinction has 869 -- opposite remedies: an unasserted mutant wants a new assertion, an unreachable one wants 870 -- nothing (adding a test for it would be vacuous by construction). Kept as 871 -- defence-in-depth so the intent survives a future refactor that makes the join LEFT or 872 -- reorders it â at which point the redundancy ends and this becomes load-bearing. 873 JOIN "Thread" t ON t.id = c."threadId" AND t."appListingId" IS NOT NULL 874 JOIN "app_listings" al ON al."serial_id" = t."appListingId" 875 -- Ownership chain for the onsite kind â see APP_LISTING_OWNER_SQL. LEFT, because an 876 -- offsite listing has no block and an onsite one may carry a dangling app_id; both must 877 -- still fall back to the column rather than drop the row. 878 LEFT JOIN "app_blocks" ab ON ab.id = al."app_block_id" 879 LEFT JOIN "OauthClient" oc ON oc.id = ab."app_id" 880 WHERE ${Z} > 0 881 -- Only APPROVED listings. The destination reads through 882 -- \`appListings.getAppDetail\`, which is approved-only, so a comment on a draft / 883 -- rejected / moderator-removed listing would notify its owner toward a NotFound. 884 -- Measured on prod: only 14 of 28 listings are approved. Mirrors the sibling raw-SQL 885 -- consumer (appListing.metrics.sql.ts). 886 AND al."status" = 'approved' 887 -- Never a shadow revision. \`beginListingRevision\` clones an approved parent as a 888 -- hidden draft; the clone freezes \`user_id\` at clone time and no ownership write 889 -- revisits it, so a shadow can name a STALE owner. Not reachable today (shadows are 890 -- draft, so the status filter already excludes them) â belt and braces, and it 891 -- matches every Prisma-side ownership read. 892 AND al."revision_of_id" IS NULL 893 AND c."createdAt" > '${e}' 894 -- Two floors, for the reason new-post-comment carries them: this type has no cursor row 895 -- until its first successful run, so it inherits the job's GLOBAL last-run â new Date(0) 896 -- on a fresh DB, and stale by the outage duration after any send-notifications outage. 897 AND c."createdAt" > '2026-08-19' 898 -- The rolling window is the one that never goes stale: it bounds any first batch to 899 -- ~7 days however far the cursor drifted. 900 AND c."createdAt" > NOW() - INTERVAL '7 days' 901 -- A commenter never notifies themselves for their own listing. 902 AND c."userId" != ${Z} 903 -- Argument ORDER is load-bearing: (recipient, actor). Swapped, the owner's Hide stops 904 -- suppressing and the commenter's starts â a silent inversion of who gets muted. 905 AND ${r(Z,'c."userId"')} 906 AND ${i(Z,"t.id")} 907 ) 908 SELECT 909 concat('new-comment-app-listing:owner:v2:', details->>'commentId') "key", 910 ${eo("v2")} "dedupeKey", 911 "ownerId" "userId", 912 'new-app-listing-comment' "type", 913 details 914 FROM new_app_listing_comment 915 WHERE 916 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-app-listing-comment'); 917 `},"new-article-comment":{displayName:"New comments on your articles",category:n.NotificationCategory.Comment,priority:4,prepareMessage:({details:e})=>e&&!j(e)?{message:`${e.username} commented on your article: "${e.articleTitle}"`,url:`/articles/${e.articleId}?highlight=${e.commentId}`}:void 0,prepareQuery:({lastSent:e})=>`
918 WITH new_article_comment AS ( 919 SELECT DISTINCT 920 a."userId" "ownerId", 921 JSONB_BUILD_OBJECT( 922 'version', 2, 923 'articleId', a.id, 924 'articleTitle', a.title, 925 'commentId', c.id, 926 'username', u.username 927 ) "details" 928 FROM "CommentV2" c 929 JOIN "User" u ON c."userId" = u.id 930 JOIN "Thread" t ON t.id = c."threadId" AND t."articleId" IS NOT NULL 931 JOIN "Article" a ON a.id = t."articleId" 932 WHERE a."userId" > 0 933 AND c."createdAt" > '${e}' 934 AND c."userId" != a."userId" 935 AND ${r('a."userId"','c."userId"')} 936 AND ${i('a."userId"',"t.id")} 937 ) 938 SELECT 939 concat('new-comment-article:owner:v2:', details->>'commentId') "key", 940 ${eo("v2")} "dedupeKey", 941 "ownerId" "userId", 942 'new-article-comment' "type", 943 details 944 FROM new_article_comment 945 WHERE 946 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-article-comment'); 947 `},"new-bounty-comment":{displayName:"New comments on your bounty",category:n.NotificationCategory.Comment,priority:4,prepareMessage:({details:e})=>({message:`${e.username} commented on your bounty: "${e.bountyTitle}"`,url:`/bounties/${e.bountyId}?highlight=${e.commentId}`}),prepareQuery:({lastSent:e})=>` 948 WITH new_bounty_comment AS ( 949 SELECT DISTINCT 950 b."userId" "ownerId", 951 JSONB_BUILD_OBJECT( 952 'version', 2, 953 'bountyId', b.id, 954 'bountyTitle', b.name, 955 'commentId', c.id, 956 'username', u.username 957 ) as "details" 958 FROM "CommentV2" c 959 JOIN "User" u ON c."userId" = u.id 960 JOIN "Thread" t ON t.id = c."threadId" AND t."bountyId" IS NOT NULL 961 JOIN "Bounty" b ON b.id = t."bountyId" 962 WHERE b."userId" > 0 963 AND c."createdAt" > '${e}' 964 AND c."createdAt" > '2024-02-24' 965 AND c."userId" != b."userId" 966 AND ${r('b."userId"','c."userId"')} 967 AND ${i('b."userId"',"t.id")} 968 ) 969 SELECT 970 concat('new-comment-bounty:owner:v2:', details->>'commentId') "key", 971 ${eo("v2")} "dedupeKey", 972 "ownerId" "userId", 973 'new-bounty-comment' "type", 974 details 975 FROM new_bounty_comment 976 WHERE 977 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-bounty-comment'); 978 `},"new-bounty-entry-comment":{displayName:"New comments on your bounty entries",category:n.NotificationCategory.Comment,priority:4,prepareMessage:({details:e})=>({message:`${e.username} commented on your entry to the "${e.bountyTitle}" bounty`,url:`/bounties/${e.bountyId}/entries/${e.bountyEntryId}?highlight=${e.commentId}`}),prepareQuery:({lastSent:e})=>` 979 WITH new_bounty_entry_comment AS ( 980 SELECT DISTINCT 981 be."userId" "ownerId", 982 JSONB_BUILD_OBJECT( 983 'version', 2, 984 'bountyEntryId', be.id, 985 'bountyId', b.id, 986 'bountyTitle', b.name, 987 'commentId', c.id, 988 'username', u.username 989 ) as "details" 990 FROM "CommentV2" c 991 JOIN "User" u ON c."userId" = u.id 992 JOIN "Thread" t ON t.id = c."threadId" AND t."bountyEntryId" IS NOT NULL 993 JOIN "BountyEntry" be ON be.id = t."bountyEntryId" 994 JOIN "Bounty" b ON b.id = be."bountyId" 995 -- BountyEntry."userId" is nullable (SetNull on user delete); NULL > 0 is NULL, so this drops 996 -- orphaned entries as well as system-owned ones. 997 WHERE be."userId" > 0 998 AND c."createdAt" > '${e}' 999 -- A new type has no cursor row until its first successful run, so it inherits the job's 1000 -- global last-run: new Date(0) on a fresh DB, stale by the outage duration after any 1001 -- send-notifications outage. There are 21,812 historical entry comments across 3,876 1002 -- owners. Launch date is the guard new-bounty-comment carries; the rolling window is what 1003 -- still holds once that date is behind us. 1004 AND c."createdAt" > '2026-08-06' 1005 AND c."createdAt" > NOW() - INTERVAL '7 days' 1006 AND c."userId" != be."userId" 1007 AND ${r('be."userId"','c."userId"')} 1008 AND ${i('be."userId"',"t.id")} 1009 ) 1010 SELECT 1011 concat('new-comment-bounty-entry:owner:v2:', details->>'commentId') "key", 1012 ${eo("v2")} "dedupeKey", 1013 "ownerId" "userId", 1014 'new-bounty-entry-comment' "type", 1015 details 1016 FROM new_bounty_entry_comment 1017 WHERE 1018 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-bounty-entry-comment'); 1019 `},"new-challenge-comment":{displayName:"New comments on your challenges",category:n.NotificationCategory.Comment,priority:4,prepareMessage:({details:e})=>({message:`${e.username} commented on your challenge: "${e.challengeTitle}"`,url:`/challenges/${e.challengeId}?highlight=${e.commentId}`}),prepareQuery:({lastSent:e})=>` 1020 WITH new_challenge_comment AS ( 1021 SELECT DISTINCT 1022 ch."createdById" "ownerId", 1023 JSONB_BUILD_OBJECT( 1024 'version', 2, 1025 'challengeId', ch.id, 1026 'challengeTitle', ch.title, 1027 'commentId', c.id, 1028 'username', u.username 1029 ) as "details" 1030 FROM "CommentV2" c 1031 JOIN "User" u ON c."userId" = u.id 1032 JOIN "Thread" t ON t.id = c."threadId" AND t."challengeId" IS NOT NULL 1033 JOIN "Challenge" ch ON ch.id = t."challengeId" 1034 WHERE ch."createdById" > 0 1035 AND c."createdAt" > '${e}' 1036 AND c."userId" != ch."createdById" 1037 AND ${r('ch."createdById"','c."userId"')} 1038 AND ${i('ch."createdById"',"t.id")} 1039 ) 1040 SELECT 1041 concat('new-comment-challenge:owner:v2:', details->>'commentId') "key", 1042 ${eo("v2")} "dedupeKey", 1043 "ownerId" "userId", 1044 'new-challenge-comment' "type", 1045 details 1046 FROM new_challenge_comment 1047 WHERE 1048 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-challenge-comment'); 1049 `},"new-3d-model-comment":{displayName:"New comments on your 3D models",category:n.NotificationCategory.Comment,priority:4,prepareMessage:({details:e})=>({message:`${e.username} commented on your 3D model: "${e.model3dName}"`,url:`/3d-models/${e.model3dId}?highlight=${e.commentId}`}),prepareQuery:({lastSent:e})=>` 1050 WITH new_3d_model_comment AS ( 1051 SELECT DISTINCT 1052 m3d."userId" "ownerId", 1053 JSONB_BUILD_OBJECT( 1054 'version', 2, 1055 'model3dId', m3d.id, 1056 'model3dName', m3d.name, 1057 'commentId', c.id, 1058 'username', u.username 1059 ) "details" 1060 FROM "CommentV2" c 1061 JOIN "User" u ON c."userId" = u.id 1062 JOIN "Thread" t ON t.id = c."threadId" AND t."model3dId" IS NOT NULL 1063 JOIN "Model3D" m3d ON m3d.id = t."model3dId" 1064 WHERE m3d."userId" > 0 1065 AND c."createdAt" > '${e}' 1066 AND c."userId" != m3d."userId" 1067 AND ${r('m3d."userId"','c."userId"')} 1068 AND ${i('m3d."userId"',"t.id")} 1069 ) 1070 SELECT 1071 concat('new-comment-model3d:owner:v2:', details->>'commentId') "key", 1072 ${eo("v2")} "dedupeKey", 1073 "ownerId" "userId", 1074 'new-3d-model-comment' "type", 1075 details 1076 FROM new_3d_model_comment 1077 WHERE 1078 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-3d-model-comment'); 1079 `},"new-3d-model-comment-response":{displayName:"New responses to your comments on 3D models",category:n.NotificationCategory.Comment,priority:2,prepareMessage:({details:e})=>({message:`${e.username} responded to your comment on the 3D model "${e.model3dName}"`,url:`/3d-models/${e.model3dId}?highlight=${e.commentId}`}),prepareQuery:({lastSent:e})=>` 1080 -- A "response" here is a CommentV2 whose Thread is rooted at a parent 1081 -- CommentV2 (Thread.commentId) that itself lives inside a Model3D 1082 -- thread. We notify the parent comment's author. Mirrors the 1083 -- Model-side new-comment-response shape. 1084 WITH new_3d_model_comment_response AS ( 1085 SELECT DISTINCT 1086 pc."userId" "ownerId", 1087 JSONB_BUILD_OBJECT( 1088 'version', 2, 1089 'model3dId', root."model3dId", 1090 'model3dName', m3d.name, 1091 'commentId', c.id, 1092 'parentId', pc.id, 1093 'username', u.username 1094 ) "details" 1095 FROM "CommentV2" c 1096 JOIN "Thread" t ON t.id = c."threadId" 1097 JOIN "CommentV2" pc ON pc.id = t."commentId"
1098 JOIN "Thread" root ON root.id = t."rootThreadId" 1099 JOIN "Model3D" m3d ON m3d.id = root."model3dId" 1100 JOIN "User" u ON c."userId" = u.id 1101 WHERE root."model3dId" IS NOT NULL 1102 AND c."createdAt" > '${e}' 1103 AND c."userId" != pc."userId" 1104 AND ${r('pc."userId"','c."userId"')} 1105 AND ${i('pc."userId"',"t.id")} 1106 ) 1107 SELECT 1108 concat('new-comment-response-model3d:owner:v2:', details->>'commentId') "key", 1109 ${eo("v2")} "dedupeKey", 1110 "ownerId" "userId", 1111 'new-3d-model-comment-response' "type", 1112 details 1113 FROM new_3d_model_comment_response 1114 WHERE 1115 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-3d-model-comment-response') 1116 `},"new-3d-model-comment-nested":{displayName:"New nested comments on your 3D models",category:n.NotificationCategory.Comment,priority:4,prepareMessage:({details:e})=>({message:`${e.username} responded to a comment on your 3D model "${e.model3dName}"`,url:`/3d-models/${e.model3dId}?highlight=${e.commentId}`}),prepareQuery:({lastSent:e})=>` 1117 -- A "nested" Model3D comment is a CommentV2 whose Thread is anchored 1118 -- in a comment under the model3d root thread. The Model3D owner gets 1119 -- the heads-up (the parent comment's author is covered by 1120 -- new-3d-model-comment-response). Mirrors the Model new-comment-nested 1121 -- shape. 1122 WITH new_3d_model_comment_nested AS ( 1123 SELECT DISTINCT 1124 m3d."userId" "ownerId", 1125 JSONB_BUILD_OBJECT( 1126 'version', 2, 1127 'model3dId', m3d.id, 1128 'model3dName', m3d.name, 1129 'commentId', c.id, 1130 'parentId', t."commentId", 1131 'username', u.username 1132 ) "details" 1133 FROM "CommentV2" c 1134 JOIN "Thread" t ON t.id = c."threadId" AND t."commentId" IS NOT NULL 1135 JOIN "Thread" root ON root.id = t."rootThreadId" 1136 JOIN "Model3D" m3d ON m3d.id = root."model3dId" 1137 JOIN "User" u ON c."userId" = u.id 1138 WHERE root."model3dId" IS NOT NULL 1139 AND m3d."userId" > 0 1140 AND c."createdAt" > '${e}' 1141 AND c."userId" != m3d."userId" 1142 AND ${r('m3d."userId"','c."userId"')} 1143 AND ${i('m3d."userId"',"t.id")} 1144 ) 1145 SELECT 1146 concat('new-comment-nested-model3d:user:v2:', details->>'commentId') "key", 1147 ${eo("v2")} "dedupeKey", 1148 "ownerId" "userId", 1149 'new-3d-model-comment-nested' "type", 1150 details 1151 FROM new_3d_model_comment_nested 1152 WHERE 1153 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-3d-model-comment-nested') 1154 `}},es={"creator-shop-item-approved":{displayName:"Creator Shop: Cosmetic approved",category:n.NotificationCategory.System,prepareMessage:({details:e})=>({message:`Your cosmetic "${e.title}" was approved and is now live in your shop.`,url:e.username?`/user/${e.username}/shop`:"/"})},"creator-shop-item-changes-requested":{displayName:"Creator Shop: Changes requested",category:n.NotificationCategory.System,prepareMessage:({details:e})=>({message:e.reason?`Your cosmetic "${e.title}" needs changes: ${e.reason}`:`Changes were requested on your cosmetic "${e.title}". Edit and resubmit it from your shop.`,url:e.username?`/user/${e.username}/shop/manage`:"/"})},"creator-shop-item-reverted":{displayName:"Creator Shop: Cosmetic unpublished",category:n.NotificationCategory.System,prepareMessage:({details:e})=>({message:e.reason?`Your cosmetic "${e.title}" was unpublished and returned to review: ${e.reason}`:`Your cosmetic "${e.title}" was unpublished and returned to review.`,url:e.username?`/user/${e.username}/shop/manage`:"/"})},"creator-shop-item-rejected":{displayName:"Creator Shop: Cosmetic rejected",category:n.NotificationCategory.System,prepareMessage:({details:e})=>({message:e.reason?`Your cosmetic "${e.title}" was rejected: ${e.reason}`:`Your cosmetic "${e.title}" was rejected.`,url:e.username?`/user/${e.username}/shop/manage`:"/"})},"creator-shop-resale-ended":{displayName:"Creator Shop: An item you resell was withdrawn",category:n.NotificationCategory.System,prepareMessage:({details:e})=>
1154({message:`"${e.title}" is no longer for sale, so it's been removed from your shop. You can list it again if its creator brings it back.`,url:e.username?`/user/${e.username}/shop/manage`:"/shop"})},"creator-shop-item-taken-down":{displayName:"Creator Shop: Cosmetic removed",category:n.NotificationCategory.System,prepareMessage:({details:e})=>({message:`Your cosmetic "${e.title}" was removed from the shop and all sales were refunded: ${e.reason}`,url:"/content/tos"})},"cosmetic-shop-item-taken-down":{displayName:"Shop: A cosmetic you bought was removed",category:n.NotificationCategory.System,prepareMessage:({details:e})=>({message:`"${e.title}" had to be removed from the shop. It's been taken off your account and your Buzz was refunded.`,url:"/user/transactions"})},"cosmetic-shop-item-added-to-section":{optIn:!0,displayName:"Shop: New Products Available",category:n.NotificationCategory.System,prepareMessage:()=>({message:"New items have been added to the shop! Check 'em out now!",url:"/shop"}),prepareQuery:({lastSent:e})=>` 1155 WITH new_items AS ( 1156 SELECT * FROM "CosmeticShopSectionItem" ssi 1157 JOIN "CosmeticShopItem" si ON si.id = ssi."shopItemId" 1158 JOIN "CosmeticShopSection" ss ON ss.id = ssi."shopSectionId" 1159 WHERE ( 1160 ( 1161 ssi."createdAt" > '${e}'::timestamp 1162 AND si."availableFrom" IS NULL 1163 ) 1164 OR 1165 ( 1166 si."availableFrom" BETWEEN '${e}'::timestamp 1167 AND now() 1168 ) 1169 ) 1170 AND (si."availableTo" >= NOW() OR si."availableTo" IS NULL) 1171 AND ss."published" = TRUE 1172 ORDER BY si."availableFrom" DESC, ssi."createdAt" DESC 1173 LIMIT 1 1174 ) 1175 SELECT 1176 CONCAT('cosmetic-shop-item-added-to-section:', ni."shopItemId") "key", 1177 uns."userId" as "userId", 1178 'cosmetic-shop-item-added-to-section' as "type", 1179 '{}'::jsonb "details" 1180 FROM new_items ni 1181 JOIN "UserNotificationSettings" uns ON uns."type" = 'cosmetic-shop-item-added-to-section' 1182 WHERE ni."shopItemId" IS NOT NULL 1183 `},"cosmetic-shop-item-sold":{displayName:"Shop: Your Item got bought (Creator Program exclusive)",category:n.NotificationCategory.System,prepareMessage:({details:e})=>({message:e.buyer?`${e.buyer} bought your "${e.shopItemTitle}" shop item. You got paid ${(0,v.numberWithCommas)(e.buzzAmount)} Buzz!`:`You got paid ${(0,v.numberWithCommas)(e.buzzAmount)} Buzz for selling 1 "${e.shopItemTitle}" item`,url:"/user/transactions"}),prepareQuery:({lastSent:e})=>` 1184 WITH sold_items AS ( 1185 SELECT 1186 cp."buzzTransactionId", 1187 (payout->>'userId')::int "ownerId", 1188 si."title" "shopItemTitle", 1189 u.username "buyer", 1190 SUM((payout->>'amount')::int) "buzzAmount" 1191 FROM "UserCosmeticShopPurchases" cp 1192 JOIN "CosmeticShopItem" si ON si.id = cp."shopItemId" 1193 LEFT JOIN "User" u ON u.id = cp."userId" 1194 CROSS JOIN LATERAL jsonb_array_elements( 1195 CASE WHEN jsonb_typeof(cp.meta->'payouts') = 'array' THEN cp.meta->'payouts' ELSE '[]'::jsonb END 1196 ) payout 1197 WHERE cp."purchasedAt" > '${e}'::timestamp - INTERVAL '5 minutes' 1198 AND cp."purchasedAt" <= NOW() - INTERVAL '5 minutes' 1199 AND (payout->>'amount')::int > 0 1200 GROUP BY cp."buzzTransactionId", (payout->>'userId')::int, si."title", u.username 1201 ) 1202 SELECT 1203 CONCAT('cosmetic-shop-item-sold:', "buzzTransactionId", ':', "ownerId") "key", 1204 "ownerId" "userId", 1205 'cosmetic-shop-item-sold' "type", 1206 JSONB_BUILD_OBJECT( 1207 'shopItemTitle', "shopItemTitle", 1208 'buzzAmount', "buzzAmount", 1209 'buyer', "buyer" 1210 ) "details" 1211 FROM sold_items 1212 -- One line: the polarity guard matches this clause as a literal. 1213 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = sold_items."ownerId" AND type = 'cosmetic-shop-item-sold') 1214 `}};var el=e.i(431465),eu=e.i(278420);function ec({noun:e,pendingNoun:t,location:a,details:n}){let o="cosmeticTakedown"===n.removedBy,r=!!n.wasLive,i=Number(n.amount??0)>0,d=o?r?`Your ${e} was removed from ${a} because a moderator took its artwork down.`:`Your ${t} was cancelled because a moderator took its artwork down.`:r?`A moderator removed your ${e} from ${a}.`:`A moderator removed your ${t} before it was reviewed.`;return i?o&&!r?`${d} Your Buzz has been refunded.`:`${d} The Buzz you paid is not refunded.`:d}let em={"sticker-placement-pending":{displayName:"Sticker awaiting your review",category:n.NotificationCategory.Creator,prepareMessage:({details:e})=>({message:`${e.placerUsername} wants to place a sticker on your image for ${e.amount} Buzz`,url:el.STICKER_QUEUE_RECEIVED_URL}),prepareQuery:async({lastSent:e})=>` 1215 WITH data AS ( 1216 SELECT 1217 p."ownerId" "userId", 1218 p.id "placementId", 1219 jsonb_build_object( 1220 'placementId', p.id, 1221 'imageId', p."targetId", 1222 'placerId', p."placerId",
1223 'placerUsername', u.username, 1224 'amount', p.amount 1225 ) as "details" 1226 FROM "Placement" p 1227 JOIN "User" u ON u.id = p."placerId" 1228 WHERE p.surface = 'sticker' 1229 AND p."targetType" = 'image' 1230 -- Paid rows only. A free one carries amount 0, so without this it 1231 -- reads "wants to place a sticker on your image for 0 Buzz" and is 1232 -- silenced by the toggle for the paid kind. 1233 AND p.free = false 1234 -- Only rows that are still waiting. A placement approved, declined or 1235 -- expired between the last run and this one has already been answered, 1236 -- and telling someone to review it sends them to a dead link. 1237 AND p.status = 'pending' 1238 -- Stamped by holdPlacementEscrow, so on the rows THIS query can see its 1239 -- presence means the escrow has at least been attempted. The row is 1240 -- created before that runs, and a notification landing in the gap would 1241 -- send someone to review a placement about to be unwound, or one in an 1242 -- auto space that approves itself seconds later. 1243 -- 1244 -- â ï¸ The escrow half of that reasoning holds only because of the 1245 -- p.free = false above. A free row gets its deadline from the same 1246 -- INSERT that creates it and never touches escrow, so this gate alone 1247 -- would pass one straight through â announced as a paid placement, 1248 -- quoting 0 Buzz. The two clauses are load-bearing together. 1249 AND p."expiresAt" IS NOT NULL 1250 AND p."createdAt" > '${e}' 1251 ) 1252 SELECT 1253 CONCAT('sticker-placement-pending:',"placementId") "key", 1254 "userId", 1255 'sticker-placement-pending' "type", 1256 details 1257 FROM data 1258 -- A row means opted OUT. There is no global filter â every processor that 1259 -- honours its own toggle writes this clause itself â so without it the 1260 -- setting renders, saves, and does nothing. Kept on one line because the 1261 -- notification-settings-polarity guard matches the clause as a literal. 1262 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = data."userId" AND type = 'sticker-placement-pending') 1263 `},"sticker-placement-free-pending":{displayName:"Free sticker awaiting your review",category:n.NotificationCategory.Creator,prepareMessage:({details:e})=>({message:`${e.placerUsername} wants to place a free sticker on your image`,url:el.STICKER_QUEUE_RECEIVED_URL}),prepareQuery:async({lastSent:e})=>` 1264 WITH data AS ( 1265 SELECT 1266 p."ownerId" "userId", 1267 p.id "placementId", 1268 jsonb_build_object( 1269 'placementId', p.id, 1270 'imageId', p."targetId", 1271 'placerId', p."placerId", 1272 'placerUsername', u.username 1273 ) as "details" 1274 FROM "Placement" p 1275 JOIN "User" u ON u.id = p."placerId" 1276 WHERE p.surface = 'sticker' 1277 AND p."targetType" = 'image' 1278 AND p.free = true 1279 AND p.status = 'pending' 1280 -- Written by the same INSERT that creates a free row rather than 1281 -- stamped afterwards, so unlike the paid path there is no window where 1282 -- this is null. Kept anyway: it is the one column that says the row is 1283 -- reachable by the expiry sweep, and a free row that is not would hold 1284 -- one of the creator's slots forever. 1285 AND p."expiresAt" IS NOT NULL 1286 AND p."createdAt" > '${e}' 1287 ) 1288 SELECT 1289 CONCAT('sticker-placement-free-pending:',"placementId") "key", 1290 "userId", 1291 'sticker-placement-free-pending' "type", 1292 details 1293 FROM data 1294 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = data."userId" AND type = 'sticker-placement-free-pending') 1295 `},"remix-gallery-pending":{displayName:"Remix awaiting your review",category:n.NotificationCategory.Creator,prepareMessage:({details:e})=>({message:`${e.placerUsername} wants to add a remix to your gallery for ${e.amount} Buzz`,url:el.REMIX_QUEUE_RECEIVED_URL}),prepareQuery:async({lastSent:e})=>` 1296 WITH data AS ( 1297 SELECT 1298 p."ownerId" "userId", 1299 p.id "placementId", 1300 jsonb_build_object( 1301 'placementId', p.id, 1302 'imageId', p."targetId", 1303 'placerId', p."placerId",
1304 'placerUsername', u.username, 1305 'amount', p.amount 1306 ) as "details" 1307 FROM "Placement" p 1308 JOIN "User" u ON u.id = p."placerId" 1309 WHERE p.surface = 'remixGallery' 1310 AND p."targetType" = 'image' 1311 AND p.status = 'pending' 1312 -- Free submissions are their own type, with their own toggle. Excluded 1313 -- here rather than left to fall through both: this message quotes an 1314 -- amount, and a free row's amount is 0. 1315 AND NOT p.free 1316 -- Stamped by holdPlacementEscrow. Its absence means the row exists but 1317 -- the escrow has not been attempted, and a notification landing in that 1318 -- gap sends someone to review a submission about to be unwound. 1319 AND p."expiresAt" IS NOT NULL 1320 AND p."createdAt" > '${e}' 1321 -- A row means opted OUT, and there is no global filter â every 1322 -- processor that honours its own toggle writes this clause itself. It 1323 -- was missing here, so the setting rendered, saved, and did nothing. 1324 -- 1325 -- Inside the CTE and against p."ownerId", which is the recipient; the 1326 -- projected "userId" outside the CTE is the same value and would work 1327 -- there too. Kept on one line either way, because the polarity guard 1328 -- matches the clause as a literal. 1329 AND NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = p."ownerId" AND type = 'remix-gallery-pending') 1330 ) 1331 SELECT 1332 CONCAT('remix-gallery-pending:',"placementId") "key", 1333 "userId", 1334 'remix-gallery-pending' "type", 1335 details 1336 FROM data 1337 `},"remix-gallery-free-pending":{displayName:"Free remix awaiting your review",category:n.NotificationCategory.Creator,prepareMessage:({details:e})=>({message:`${e.placerUsername} submitted a free remix to your gallery`,url:el.REMIX_QUEUE_RECEIVED_URL}),prepareQuery:async({lastSent:e})=>` 1338 WITH data AS ( 1339 SELECT 1340 p."ownerId" "userId", 1341 p.id "placementId", 1342 jsonb_build_object( 1343 'placementId', p.id, 1344 'imageId', p."targetId", 1345 'placerId', p."placerId", 1346 'placerUsername', u.username 1347 ) as "details" 1348 FROM "Placement" p 1349 JOIN "User" u ON u.id = p."placerId" 1350 WHERE p.surface = 'remixGallery' 1351 AND p."targetType" = 'image' 1352 AND p.status = 'pending' 1353 AND p.free 1354 AND p."createdAt" > '${e}' 1355 -- A row here means opted OUT, and its own type rather than the paid 1356 -- one's: silencing free submissions must not silence the queue a 1357 -- creator is being paid for. 1358 AND NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = p."ownerId" AND type = 'remix-gallery-free-pending') 1359 ) 1360 SELECT 1361 CONCAT('remix-gallery-free-pending:',"placementId") "key", 1362 "userId", 1363 'remix-gallery-free-pending' "type", 1364 details 1365 FROM data 1366 `},"remix-gallery-resolved":{displayName:"Your remix submission was answered",category:n.NotificationCategory.Creator,prepareMessage:({details:e})=>{let t=`/images/${e.imageId}`;return"approved"===e.status?{message:`${e.ownerUsername} added your remix to their gallery`,url:t}:"removed"===e.status?{message:"owner"===e.removedBy?`${e.ownerUsername} removed your remix from their gallery`:ec({noun:"remix",pendingNoun:"remix submission",location:`${e.ownerUsername}'s gallery`,details:e}),url:t}:{message:`${e.ownerUsername} declined your remix submission`,url:t}},prepareQuery:async({lastSent:e})=>` 1367 WITH data AS ( 1368 SELECT 1369 p."placerId" "userId", 1370 p.id "placementId", 1371 p.status "status", 1372 jsonb_build_object( 1373 'placementId', p.id, 1374 'imageId', p."targetId", 1375 'ownerId', p."ownerId", 1376 'ownerUsername', u.username, 1377 'status', p.status, 1378 'removedBy', p."removedBy", 1379 'wasLive', p."takenDownAt" IS NOT NULL, 1380 'amount', p.amount 1381 ) as "details" 1382 FROM "Placement" p 1383 JOIN "User" u ON u.id = p."ownerId" 1384 WHERE p.surface = 'remixGallery' 1385 AND p."targetType" = 'image' 1386 -- Each branch keys off the moment its own actor acted, never off 1387 -- createdAt: a submission made before the last run and answered after 1388 -- it would be missed entirely by a createdAt window. 1389 -- 1390 -- Removal is deliberately a separate branch on takenDownAt, because 1391 -- taking a live entry down does not touch resolvedAt -- that column 1392 -- records who approved it, and this path must not destroy the 1393 -- approval trail. 1394 AND ( 1395 ( 1396 p.status = 'approved' 1397 AND p."resolvedAt" IS NOT NULL 1398 AND p."resolvedAt" > '${e}' 1399 ) 1400 OR ( 1401 p.status = 'removed'
1402 -- Keying on the actor instead (takenDownById = ownerId) looks like 1403 -- the same test and is not: it reads a moderator-mode removal on 1404 -- their own gallery as a creator's. Tried in #4148 and reverted. 1405 AND p."removedBy" IN ('owner', 'moderator', 'cosmeticTakedown') 1406 AND p."takenDownAt" IS NOT NULL 1407 AND p."takenDownAt" > '${e}' 1408 ) 1409 OR ( 1410 -- A moderator ending a PENDING submission. It never went live, so 1411 -- there is no takedown to record and settlePlacement stamps 1412 -- resolvedAt like every other settled outcome -- which is why this 1413 -- cannot share the branch above, and why it excludes rows that DO 1414 -- carry a takedown rather than leaving them to match both. 1415 -- 1416 -- A pending removeByModerator forfeits the whole escrow, fee and 1417 -- principal; a pending removeByCosmeticTakedown refunds it in full. 1418 -- 1419 -- No 'owner' here. An owner ending a pending submission is a 1420 -- decline, which is deliberately silent, and the remove path only 1421 -- ever touches rows that are already approved. 1422 p.status = 'removed' 1423 AND p."removedBy" IN ('moderator', 'cosmeticTakedown') 1424 AND p."takenDownAt" IS NULL 1425 AND p."resolvedAt" IS NOT NULL 1426 AND p."resolvedAt" > '${e}' 1427 ) 1428 ) 1429 ) 1430 SELECT 1431 -- The status is part of the key because one placement legitimately 1432 -- produces two of these: approved, then removed later. Keying on the id 1433 -- alone means the approval burns the key and the removal is deduped 1434 -- away silently. 1435 CONCAT('remix-gallery-resolved:',"status",':',"placementId") "key", 1436 "userId", 1437 'remix-gallery-resolved' "type", 1438 details 1439 FROM data 1440 -- A row means opted OUT. This type shipped without the clause, so its 1441 -- toggle rendered, saved, and changed nothing -- there is no global filter 1442 -- on this path (createNotificationsBulk does no settings lookup), so a 1443 -- processor that omits it is unmuteable. Kept on one line because the 1444 -- polarity guard matches the clause as a literal. 1445 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = data."userId" AND type = 'remix-gallery-resolved') 1446 `},"remix-gallery-undelivered":{displayName:"A remix submission could not be delivered",category:n.NotificationCategory.Creator,prepareMessage:({details:e})=>({message:Number(e.amount??0)>0?`Your remix couldn't be submitted to ${e.ownerUsername}'s gallery, so your Buzz has been returned.`:`Your remix couldn't be submitted to ${e.ownerUsername}'s gallery.`,url:`/images/${e.imageId}`}),prepareQuery:async({lastSent:e})=>` 1447 WITH data AS ( 1448 SELECT 1449 p."placerId" "userId", 1450 p.id "placementId", 1451 jsonb_build_object( 1452 'placementId', p.id, 1453 'imageId', p."targetId", 1454 -- The party to name on the avatar. This notification is addressed to 1455 -- the PLACER, so the other party is the owner; without the id the row 1456 -- falls back to a generic bell. 1457 'ownerId', p."ownerId", 1458 'ownerUsername', u.username, 1459 -- Decides the money sentence above. A free row is 0 and must not be 1460 -- told about Buzz that never moved. 1461 'amount', p.amount 1462 ) as "details" 1463 FROM "Placement" p 1464 JOIN "User" u ON u.id = p."ownerId" 1465 WHERE p.surface = 'remixGallery' 1466 AND p."targetType" = 'image' 1467 AND p.status = 'expired' 1468 -- Refused for something about the IMAGE, not by a deadline passing. 1469 -- A draft the submitter simply never published also ends as expired 1470 -- with the same refund, and telling THEM we could not deliver would be 1471 -- the false-blame message the resolved type exists to avoid. Only the 1472 -- readiness pass sets this. 1473 AND p.data ->> 'undeliverable' = 'true' 1474 -- Keyed off when it was settled, not when it was created: a submission 1475 -- made before the last run and expired after it would be missed by a 1476 -- createdAt window. 1477 AND p."resolvedAt" IS NOT NULL 1478 AND p."resolvedAt" > '${e}' 1479 ) 1480 SELECT 1481 CONCAT('remix-gallery-undelivered:',"placementId") "key", 1482 "userId", 1483 'remix-gallery-undelivered' "type", 1484 details 1485 FROM data 1486 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = data."userId" AND type = 'remix-gallery-undelivered') 1487 `},"sticker-placement-resolved":{displayName:"Your sticker placement was resolved",category:n.NotificationCategory.Creator,prepareMessage:({details:e})=>
1487{if("removed"===e.status)return{message:ec({noun:"sticker",pendingNoun:"sticker placement",location:`${e.ownerUsername}'s image`,details:e}),url:`/images/${e.imageId}`};let t=`/images/${e.imageId}`;if("declined"===e.status){let a,n,o,r;return{message:(a=`${e.ownerUsername} declined your sticker`,n=Number(e.feeToOwner??0),o=e.refundPaid?" Your Buzz has been refunded.":"",r=e.refundPaid?"; the rest has been refunded":"",e.feeWaived?`${a}.${o}`:n>0?`${a}. They kept ${n} Buzz${r}.`:`${a}.`),url:t}}return"expired"===e.status?{message:`Your sticker placement on ${e.ownerUsername}'s image expired.${Number(e.amount??0)>0&&e.refundPaid?" Your Buzz has been refunded.":""}`,url:t}:{message:`${e.ownerUsername} accepted your sticker`,url:(0,el.imageWithStickersUrl)(e.imageId)}},prepareQuery:async({lastSent:e})=>` 1488 WITH data AS ( 1489 SELECT 1490 p."placerId" "userId", 1491 p.id "placementId", 1492 p.status "status", 1493 jsonb_build_object( 1494 'placementId', p.id, 1495 'imageId', p."targetId", 1496 'ownerId', p."ownerId", 1497 'ownerUsername', u.username, 1498 'status', p.status, 1499 'removedBy', p."removedBy", 1500 'wasLive', p."takenDownAt" IS NOT NULL, 1501 'amount', p.amount, 1502 -- The two things a decline's money sentence turns on, and both are 1503 -- columns on the row rather than a join: removedBy is NULL on a 1504 -- decline and cannot tell a waived fee from a taken one. 1505 'feeWaived', p."feeWaived", 1506 -- What was actually taken, not what today's rate would compute. The 1507 -- rate is per-space and can move between the placement and the 1508 -- decline. NULL where no fee leg was ever claimed, which is the 1509 -- waived and free cases. Hits the unique index on 1510 -- (placementId, kind), so it is a lookup rather than a scan. 1511 'feeToOwner', ( 1512 SELECT pt.amount FROM "PlacementTransaction" pt 1513 WHERE pt."placementId" = p.id AND pt.kind = 'feeToOwner' 1514 AND pt."transactionId" IS NOT NULL 1515 ), 1516 -- ð´ Whether the placer's money has actually MOVED, not whether it 1517 -- was planned. settlePlacement writes the status flip and the payout 1518 -- legs in one transaction with transactionId NULL on every leg; the 1519 -- Buzz calls happen afterwards, outside it, and runLeg can decline 1520 -- the lock, fail, or exhaust its attempts and stop. The 1521 -- notification job runs every minute off the committed row, so 1522 -- without this "your Buzz has been refunded" is a claim about a 1523 -- movement nobody has observed -- and on a stranded leg it stays 1524 -- false, with the placer's balance as the thing disagreeing. 1525 -- 1526 -- One flag for both placer-directed kinds. A partial payout (the 1527 -- principal receipted, the fee refund not) reads as refunded, which 1528 -- is the direction that errs toward saying less rather than saying 1529 -- something false. 1530 'refundPaid', EXISTS ( 1531 SELECT 1 FROM "PlacementTransaction" pt 1532 WHERE pt."placementId" = p.id 1533 AND pt.kind IN ('principalToPlacer', 'feeToPlacer') 1534 AND pt."transactionId" IS NOT NULL 1535 ) 1536 ) as "details" 1537 FROM "Placement" p 1538 JOIN "User" u ON u.id = p."ownerId" 1539 WHERE p.surface = 'sticker' 1540 AND p."targetType" = 'image' 1541 -- Each branch keys off the moment its own actor acted, never off 1542 -- createdAt: a placement made before the last run and answered after 1543 -- it would be missed entirely by a createdAt window. 1544 AND ( 1545 ( 1546 p.status = 'approved' 1547 AND p."resolvedAt" IS NOT NULL 1548 AND p."resolvedAt" > '${e}' 1549 ) 1550 OR ( 1551 -- The MODE the remover acted in, not their role. An OWNER removal 1552 -- stays silent -- taking a sticker off your own image is y
1552our 1553 -- choice to make -- so only the two moderator modes are here. 1554 -- 1555 -- takenDownAt is its own column, and the reason this is a separate 1556 -- branch: taking a live placement down does not touch resolvedAt, 1557 -- which records who approved it. 1558 p.status = 'removed' 1559 AND p."removedBy" IN ('moderator', 'cosmeticTakedown') 1560 AND p."takenDownAt" IS NOT NULL 1561 AND p."takenDownAt" > '${e}' 1562 ) 1563 OR ( 1564 -- A moderator ending a PENDING placement. It never went live, so 1565 -- there is no takedown to record and settlePlacement stamps 1566 -- resolvedAt like every other settled outcome -- which is why this 1567 -- cannot share the branch above, and why it excludes rows that DO 1568 -- carry a takedown rather than leaving them to match both. 1569 -- 1570 -- A pending removeByModerator forfeits the whole escrow, fee and 1571 -- principal; a pending removeByCosmeticTakedown refunds it in full. 1572 p.status = 'removed' 1573 AND p."removedBy" IN ('moderator', 'cosmeticTakedown') 1574 AND p."takenDownAt" IS NULL 1575 AND p."resolvedAt" IS NOT NULL 1576 AND p."resolvedAt" > '${e}' 1577 ) 1578 OR ( 1579 -- The creator said no. settlePlacement stamps resolvedAt for every 1580 -- decline mode, including the two that waive the fee, so one branch 1581 -- covers all three and the MESSAGE picks its money sentence from 1582 -- feeWaived and amount. 1583 p.status = 'declined' 1584 AND p."resolvedAt" IS NOT NULL 1585 AND p."resolvedAt" > '${e}' 1586 ) 1587 OR ( 1588 -- Nobody answered. expirePlacements runs over status = 'pending' 1589 -- regardless of free, and 'expire' stamps resolvedAt like any other 1590 -- settled outcome -- so this needs no expiresAt window of its own, 1591 -- which would re-report a row whose deadline passed long before the 1592 -- job reached it. 1593 -- â ï¸ This also selects a FAILED CREATION. createStickerPlacement 1594 -- compensates a failure by calling settlePlacement with 'expire', 1595 -- so the row is indistinguishable from one that timed out -- and 1596 -- the placer, who already saw an error, is told it "expired". 1597 -- Accepted knowingly (Justin, 2026-08-24) rather than missed: the 1598 -- path is rare and the receipt gate above keeps the sentence from 1599 -- claiming a refund that did not happen. Telling the two apart 1600 -- needs a column the row does not carry, so do not "fix" this with 1601 -- a WHERE clause -- it would need the unwind to mark itself first. 1602 p.status = 'expired' 1603 AND p."resolvedAt" IS NOT NULL 1604 AND p."resolvedAt" > '${e}' 1605 ) 1606 ) 1607 ) 1608 SELECT 1609 -- The status is part of the key because one placement legitimately 1610 -- produces two of these: accepted, then taken down later. Keying on the 1611 -- id alone means the acceptance burns the key and the takedown is 1612 -- deduped away silently. 1613 CONCAT('sticker-placement-resolved:',"status",':',"placementId") "key", 1614 "userId", 1615 'sticker-placement-resolved' "type", 1616 details 1617 FROM data 1618 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = data."userId" AND type = 'sticker-placement-resolved') 1619 `},"sticker-placement-auto-accepted":{optIn:!0,displayName:"A sticker was accepted on your image automatically",category:n.NotificationCategory.Creator,prepareMessage:({details:e})=>({message:`${e.placerUsername} placed a sticker on your image`,url:(0,el.imageWithStickersUrl)(e.imageId)}),prepareQuery:async({lastSent:e})=>` 1620 WITH data AS ( 1621 SELECT 1622 p."ownerId" "userId", 1623 p.id "placementId", 1624 jsonb_build_object( 1625 'placementId', p.id, 1626 'imageId', p."targetId", 1627 'placerId', p."placerId",
1628 'placerUsername', u.username 1629 ) as "details" 1630 FROM "Placement" p 1631 JOIN "User" u ON u.id = p."placerId" 1632 -- A row means SUBSCRIBED for this type, so the join IS the filter and an 1633 -- owner with no row gets nothing. Inner, deliberately: a LEFT JOIN here 1634 -- restricts no one and would send this to every creator on the site. 1635 JOIN "UserNotificationSettings" uns ON uns."userId" = p."ownerId" AND uns.type = 'sticker-placement-auto-accepted' 1636 WHERE p.surface = 'sticker' 1637 AND p."targetType" = 'image' 1638 AND p.status = 'approved' 1639 -- Covers paid and free alike. The message quotes no amount, so unlike 1640 -- the pending pair there is nothing here that a free row's 0 makes 1641 -- false, and one type serves both. 1642 AND p.data ->> '${eu.STICKER_AUTO_SPACE_KEY}' = 'true' 1643 -- Keyed off when it was approved, not when it was created: the two are 1644 -- seconds apart on this path, but a createdAt window would still miss a 1645 -- placement created just before a run and approved just after it. 1646 AND p."resolvedAt" IS NOT NULL 1647 AND p."resolvedAt" > '${e}' 1648 ) 1649 SELECT 1650 CONCAT('sticker-placement-auto-accepted:',"placementId") "key", 1651 "userId", 1652 'sticker-placement-auto-accepted' "type", 1653 details 1654 FROM data 1655 `}},ep={"creators-program-enabled":{displayName:"Creators program enabled",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:()=>({message:"Your account is approved for Creator Payouts! Click this notification to set up your payment details to start receiving payments.",url:"/user/account#payments"})},"creators-program-payments-enabled":{displayName:"Payments enabled",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:()=>({message:"Your account has been verified and approved for payments! You can now start earning money from your content!",url:"/creator-program"})},"creators-program-rejected-stripe":{displayName:"Creators program Rejected (Stripe)",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:()=>({message:"We're sorry, but it looks like your stripe account has been rejected for payments. If you need more information, you can contact support.",url:"/creator-program"})},"creators-program-rejected-tipalti":{displayName:"Creators program Rejected (Tipalti)",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:()=>({message:"We're sorry, but it looks like your tipalti account has been rejected for payments. If you need more information, you can contact support. This is not Civitai's decision, but Tipalti's.",url:"/creator-program"})},"creators-program-withdrawal-approved":{displayName:"Creators program - Withdrawal Approved",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:()=>({message:"Your withdrawal request has been approved. Your funds will be transferred to your account soon",url:"/user/buzz-dashboard#buzz-withdrawals"})},"creators-program-withdrawal-updated":{displayName:"Creators program - Withdrawal Updated",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:()=>({message:"Your withdrawal request has been updated. You may check the withdrawals' history for more information.",url:"/user/buzz-dashboard#buzz-withdrawals"})},"creators-program-withdrawal-transferred":{displayName:"Creators program - Money transferred",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:()=>({message:"Your request has been processed and money has been transfered to your account.",url:"/user/buzz-dashboard#buzz-withdrawals"})},"creators-program-withdrawal-rejected":{displayName:"Creators program - Withdrawal Rejected",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:()=>({message:"Moderators have rejected your withdrawal request. Please contact us for more information.",url:"/user/buzz-dashboard#buzz-withdrawals"})},"creators-program-withdrawal-reverted":{displayName:"Creators program - Money reverted",category:n.NotificationCategory.Buzz,toggleable:!1,prepareMessage:()=>({message:"We have decided to revert money that was transfered to your account. Please contact us for more information on why we came to this desicion.",url:"/user/buzz-dashboard#buzz-withdrawals"})},"creator-program-banking-phase-ending":{displayName:"Banking phase ending",category:n.NotificationCategory.Creator,toggleable:!1,showCategory:!0,prepareMessage:()=>({message:"This is the last day to Bank Buzz before the Extraction Phase begins.",url:"/user/buzz-dashboard#get-paid"})},"creator-program-extraction-phase-started":{displayName:"Extraction phase started",category:n.NotificationCategory.Creator,toggleable:!1,showCategory:!0,prepareMessage:()=>({message:"The Extraction Phase has begun. Check the value of your Banked Buzz and decide what to do.",url:"/user/buzz-dashboard#get-paid"})},"creator-program-extraction-phase-ending":{displayName:"Extraction phase ending",category:n.NotificationCategory.Creator,toggleable:!1,showCategory:!0,prepareMessage:()=>({message:"This is the last day to Extract Buzz before the Creator Compensation Pool is distributed. Check the value of your Banked Buzz and decide what to do.",url:"/user/buzz-dashboard#get-paid"})}
1655,"creator-program-funds-settled":{displayName:"Funds settled",category:n.NotificationCategory.Creator,toggleable:!1,showCategory:!0,prepareMessage:({details:e})=>({message:"Your funds earned from the Creator Compensation Pool have been settled. You can now withdraw your earnings.",url:"/user/buzz-dashboard#get-paid"})}},eI={"featured-model":{displayName:"Model featured",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:`Congrats! Your ${e.modelName} model has been featured on the homepage`,url:`/models/${e.modelId}`}),prepareQuery:async({lastSent:e})=>` 1656 WITH data AS ( 1657 SELECT DISTINCT 1658 m."userId", 1659 jsonb_build_object( 1660 'modelId', ci."modelId", 1661 'modelName', m.name 1662 ) "details", 1663 ci."modelId" 1664 FROM "CollectionItem" ci 1665 JOIN "Collection" c ON c.id = ci."collectionId" 1666 JOIN "Model" m ON m.id = ci."modelId" 1667 WHERE c."userId" = -1 AND c.name = 'Featured Models' 1668 AND ci.status = 'ACCEPTED' 1669 AND ci."createdAt" > '${e}' -- Only check for new not updated 1670 ) 1671 SELECT 1672 CONCAT('featured-model:',"modelId") "key", -- maybe add last sent 1673 "userId", 1674 'featured-model' "type", 1675 details 1676 FROM data 1677 `},"featured-image":{displayName:"Image featured",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:"Congrats! Your image has been featured on the homepage",url:`/images/${e.imageId}`}),prepareQuery:async({lastSent:e})=>` 1678 WITH data AS ( 1679 SELECT DISTINCT 1680 i."userId", 1681 jsonb_build_object( 1682 'imageId', ci."imageId" 1683 ) "details", 1684 ci."imageId" 1685 FROM "CollectionItem" ci 1686 JOIN "Collection" c ON c.id = ci."collectionId" 1687 JOIN "Image" i ON i.id = ci."imageId" 1688 WHERE c."userId" = -1 AND c.name = 'Featured Images' 1689 AND ci.status = 'ACCEPTED' 1690 AND ci."createdAt" > '${e}' -- Only check for new not updated 1691 ) 1692 SELECT 1693 CONCAT('featured-image:',"imageId") "key", -- maybe add last sent 1694 "userId", 1695 'featured-image' "type", 1696 details 1697 FROM data 1698 `},"featured-post":{displayName:"Post featured",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>{let t="Congrats! Your post has been featured on the homepage";return e.postTitle&&(t=`Congrats! Your post "${e.postTitle}" has been featured on the homepage`),{message:t,url:`/posts/${e.postId}`}},prepareQuery:async({lastSent:e})=>` 1699 WITH data AS ( 1700 SELECT DISTINCT 1701 p."userId", 1702 jsonb_build_object( 1703 'postId', ci."postId", 1704 'postTitle', p.title 1705 ) "details", 1706 ci."postId" 1707 FROM "CollectionItem" ci 1708 JOIN "Collection" c ON c.id = ci."collectionId" 1709 JOIN "Post" p ON p.id = ci."postId" 1710 WHERE c."userId" = -1 AND c.name = 'Featured Posts' 1711 AND ci.status = 'ACCEPTED' 1712 AND ci."createdAt" > '${e}' -- Only check for new not updated 1713 ) 1714 SELECT 1715 CONCAT('featured-post:',"postId") "key", -- maybe add last sent 1716 "userId", 1717 'featured-post' "type", 1718 details 1719 FROM data 1720 `},"featured-article":{displayName:"Article featured",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:`Congrats! Your article "${e.articleTitle}" has been featured on the homepage`,url:`/articles/${e.articleId}`}),prepareQuery:async({lastSent:e})=>` 1721 WITH data AS ( 1722 SELECT DISTINCT 1723 a."userId", 1724 jsonb_build_object( 1725 'articleId', ci."articleId", 1726 'articleTitle', a.title 1727 ) "details", 1728 ci."articleId" 1729 FROM "CollectionItem" ci 1730 JOIN "Collection" c ON c.id = ci."collectionId" 1731 JOIN "Article" a ON a.id = ci."articleId" 1732 WHERE c."userId" = -1 AND c.name = 'Featured Articles' 1733 AND ci.status = 'ACCEPTED' 1734 AND ci."createdAt" > '${e}' -- Only check for new not updated 1735 ) 1736 SELECT 1737 CONCAT('featured-article:',"articleId") "key", -- maybe add last sent 1738 "userId", 1739 'featured-article' "type", 1740 details 1741 FROM data 1742 `}},eg={"creator-announcement":{displayName:"Announcements from creators you follow",category:n.NotificationCategory.Update,toggleable:!1,prepareMessage:({details:e})=>({message:`${e.username} made an announcement: ${e.title}. Check it out.`,url:`/user/${e.username}?announcement=${e.announcementId}`})}},eh={"followed-by":{displayName:"New follower",category:n.NotificationCategory.Update,prepareMessage:({details:e})=>({message:`${e.username??"A user"} has followed you!`,url:e.username?`/user/${e.username}`:void 0})}},ey={"generation-muted":{displayName:"Generation access restricted",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:()=>({message:"Your generation access has been restricted due to potential Terms of Service violations. A moderator will review your account within 2 business days.",url:"/generate"})},"generation-restriction-upheld":{displayName:"Generation restriction upheld",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:e.resolvedMessage?`Your generation restriction has been reviewed and upheld: ${e.resolvedMessage}`:"Your generation restriction has been reviewed and upheld.",url:"/generate"})},"generation-restriction-overturned":{displayName:"Generation access restored",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:e.resolvedMessage?`Your generation access has been restored: ${e.resolvedMessage}`:"Your generation access has been restored. You may now use the generation feature again.",url:"/generate"})}},eC={"profile-picture-blocked":{displayName:"Avatar blocked",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:()=>({message:"Your avatar has been blocked.",url:"/user/account"}),prepareQuery:async({lastSent:e})=>` 1743 WITH data AS ( 1744 SELECT 1745 i.id "imageId", 1746 u.id as "userId" 1747 FROM "Image" i 1748 JOIN "User" u ON i.id = u."profilePictureId" 1749 WHERE i."updatedAt" > '${e}' AND i.ingestion = 'Blocked'::"ImageIngestionStatus" 1750 ) 1751 SELECT 1752 CONCAT('profile-picture-blocked:',"imageId") "key", 1753 "userId", 1754 'profile-picture-blocked' "type", 1755 '{}'::jsonb "details" 1756 FROM data 1757 `}},eA={"new-mention":{displayName:"New @mentions",category:n.NotificationCategory.Comment,priority:1,prepareMessage:({details:e})=>
1757{if("comment"===e.mentionedIn&&void 0!==e.threadId){let t=en(e),a="comment"===e.threadType?"comment thread":et(e.threadType);return{message:`${e.username} mentioned you in a comment on ${ea(a)}`,url:t}}if("comment"===e.mentionedIn){if("review"===e.parentType)return;return{message:`${e.username} mentioned you in a ${e.parentType} on ${e.modelName}`,url:`/models/${e.modelId}?dialog=${e.parentType}Thread&${e.parentType}Id=${e.parentId}&highlight=${e.commentId}`}}return{message:`${e.username} mentioned you in the description of ${e.modelName}`,url:`/models/${e.modelId}`}},prepareQuery:({lastSent:e})=>` 1758 WITH new_mentions AS ( 1759 SELECT DISTINCT 1760 CAST(unnest(regexp_matches(content, '"mention:(\\d+)"', 'g')) as INT) "ownerId", 1761 -- The recipient is produced by unnest() in this select list, so it can't be referenced 1762 -- from these WHERE clauses. Each branch carries its author out instead, and the block 1763 -- filter runs once on the outer query where both sides are finally in scope. 1764 c."userId" "actorId", 1765 JSONB_BUILD_OBJECT( 1766 'version', 2, 1767 'mentionedIn', 'comment', 1768 'commentId', c.id, 1769 'threadId', c."threadId", 1770 'threadParentId', COALESCE( 1771 root."imageId", 1772 root."modelId", 1773 root."postId", 1774 root."questionId", 1775 root."answerId", 1776 root."reviewId", 1777 root."articleId", 1778 root."bountyId", 1779 root."bountyEntryId", 1780 root."challengeId", 1781 root."model3dId", 1782 root."comicProjectId", 1783 t."imageId", 1784 t."modelId", 1785 t."postId", 1786 t."questionId", 1787 t."answerId", 1788 t."reviewId", 1789 t."articleId", 1790 t."bountyId", 1791 t."bountyEntryId", 1792 t."challengeId", 1793 t."model3dId", 1794 t."comicProjectId" 1795 ), 1796 'threadType', CASE 1797 WHEN COALESCE(root."imageId", t."imageId") IS NOT NULL THEN 'image' 1798 WHEN COALESCE(root."modelId", t."modelId") IS NOT NULL THEN 'model' 1799 WHEN COALESCE(root."postId", t."postId") IS NOT NULL THEN 'post' 1800 WHEN COALESCE(root."questionId", t."questionId") IS NOT NULL THEN 'question' 1801 WHEN COALESCE(root."answerId", t."answerId") IS NOT NULL THEN 'answer' 1802 WHEN COALESCE(root."reviewId", t."reviewId") IS NOT NULL THEN 'review' 1803 WHEN COALESCE(root."articleId", t."articleId") IS NOT NULL THEN 'article' 1804 WHEN COALESCE(root."bountyId", t."bountyId") IS NOT NULL THEN 'bounty' 1805 WHEN COALESCE(root."bountyEntryId", t."bountyEntryId") IS NOT NULL THEN 'bountyEntry' 1806 WHEN COALESCE(root."challengeId", t."challengeId") IS NOT NULL THEN 'challenge' 1807 WHEN COALESCE(root."model3dId", t."model3dId") IS NOT NULL THEN 'model3d' 1808 WHEN COALESCE(root."comicProjectId", t."comicProjectId") IS NOT NULL THEN 'comicProject' 1809 -- App-store listings are SLUG-addressed, so this arm keys on the JOINED slug 1810 -- rather than an id column â see appListingSlugJoin. 1811 WHEN al.slug IS NOT NULL THEN 'appListing' 1812 ELSE 'comment' 1813 END, 1814 'appListingSlug', al.slug, 1815 'commentParentId', COALESCE( 1816 t."imageId", 1817 t."modelId", 1818 t."postId", 1819 t."questionId", 1820 t."answerId", 1821 t."reviewId", 1822 t."articleId", 1823 t."bountyId", 1824 t."bountyEntryId", 1825 t."challengeId", 1826 t."model3dId", 1827 t."commentId" 1828 ), 1829 'commentParentType', CASE 1830 WHEN t."imageId" IS NOT NULL THEN 'image' 1831 WHEN t."modelId" IS NOT NULL THEN 'model' 1832 WHEN t."postId" IS NOT NULL THEN 'post' 1833 WHEN t."questionId" IS NOT NULL THEN 'question' 1834 WHEN t."answerId" IS NOT NULL THEN 'answer' 1835 WHEN t."reviewId" IS NOT NULL THEN 'review' 1836 WHEN t."articleId" IS NOT NULL THEN 'article' 1837 WHEN t."bountyId" IS NOT NULL THEN 'bounty' 1838 WHEN t."bountyEntryId" IS NOT NULL THEN 'bountyEntry' 1839 WHEN t."challengeId" IS NOT NULL THEN 'challenge' 1840 WHEN t."model3dId" IS NOT NULL THEN 'model3d' 1841 ELSE 'comment' 1842 END, 1843 'username', u.username 1844 ) "details" 1845 FROM "CommentV2" c 1846 JOIN "User" u ON c."userId" = u.id 1847 JOIN "Thread" t ON t.id = c."threadId"
1848 LEFT JOIN "Thread" root ON root.id = t."rootThreadId" 1849 ${Q('COALESCE(root."appListingId", t."appListingId")')} 1850 WHERE (c."createdAt" > '${e}') 1851 AND c.content LIKE '%"mention:%' 1852 -- Unhandled thread types... 1853 AND t."questionId" IS NULL 1854 AND t."answerId" IS NULL 1855 -- Same slug-resolution guard the reply processors carry: those threads are addressed by 1856 -- SLUG, the join above supplies it, and only a row the join failed on is dropped. 1857 AND ${X('COALESCE(root."appListingId", t."appListingId")')} 1858 1859 UNION 1860 1861 SELECT DISTINCT 1862 CAST(unnest(regexp_matches(content, '"mention:(\\d+)"', 'g')) as INT) "ownerId", 1863 c."userId" "actorId", 1864 JSONB_BUILD_OBJECT( 1865 'mentionedIn', 'comment', 1866 'modelId', c."modelId", 1867 'commentId', c.id, 1868 'parentId', c."parentId", 1869 'parentType', CASE WHEN c."parentId" IS NOT NULL THEN 'comment' ELSE 'review' END, 1870 'modelName', m.name, 1871 'username', u.username 1872 ) "details" 1873 FROM "Comment" c 1874 JOIN "User" u ON c."userId" = u.id 1875 JOIN "Model" m ON m.id = c."modelId" 1876 WHERE m."userId" > 0 1877 AND (c."createdAt" > '${e}') 1878 AND c.content LIKE '%"mention:%' 1879 1880 UNION 1881 1882 SELECT DISTINCT 1883 CAST(unnest(regexp_matches(m.description, '"mention:(\\d+)"', 'g')) as INT) "ownerId", 1884 m."userId" "actorId", 1885 JSONB_BUILD_OBJECT( 1886 'mentionedIn', 'model', 1887 'modelId', m.id, 1888 'modelName', m.name, 1889 'username', u.username 1890 ) "details" 1891 FROM "Model" m 1892 JOIN "User" u ON m."userId" = u.id 1893 WHERE m."userId" > 0 1894 AND (m."publishedAt" > '${e}' OR m."updatedAt" > '${e}') 1895 AND m.description LIKE '%"mention:%' 1896 AND m.status = 'Published' 1897 ) 1898 SELECT 1899 concat('new-mention:user:', case when details->>'mentionedIn' = 'model' then 'model:' when details->>'version' is not null then 'v2:' else 'v1:' end, coalesce(details->>'commentId', details->>'modelId')) "key", 1900 -- Claiming the dedupe key SUPPRESSES every other notification for this comment, so only claim it 1901 -- when this mention is a worthy replacement â i.e. prepareMessage above yields a message AND a 1902 -- working URL. Three ways it doesn't: 1903 -- * mentionedIn = 'model' â a model DESCRIPTION mention, no comment behind it at all 1904 -- * v2 threadType 'comment' â the fallback for a thread entity threadUrlMap can't address 1905 -- (clubPost, model3dReview, ...), which renders a dead link 1906 -- * v1 parentType 'review' â prepareMessage bails and returns undefined, so the row renders as 1907 -- NOTHING. Left unguarded this silently swallows the new-comment the user should have got. 1908 -- Anything excluded here still delivers as its own (lower-priority) notification, unchanged. 1909 case 1910 when details->>'mentionedIn' <> 'comment' then null 1911 when details->>'version' is not null then 1912 case when details->>'threadType' <> 'comment' then ${er} end 1913 when details->>'parentType' = 'comment' then ${er} 1914 end "dedupeKey", 1915 "ownerId" "userId", 1916 'new-mention' "type", 1917 details 1918 FROM new_mentions r 1919 WHERE 1920 NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-mention') 1921 AND ${r('r."ownerId"','r."actorId"')} 1922 `}},eE={"model-flagged-minor":{displayName:"Model marked as minor",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>e&&!j(e)?{message:`Your model ${e.modelName} has been marked as depicting a minor. If you believe this is a mistake, you can request a review on the model page.`,url:`/models/${e.modelId}/${(0,u.slugit)(e.modelName)}`}:void 0,prepareQuery:({lastSent:e})=>` 1923 WITH flagged AS ( 1924 SELECT DISTINCT 1925 m."userId", 1926 jsonb_build_object( 1927 'modelId', m.id, 1928 'modelName', m.name 1929 ) "details" 1930 FROM "Model" m 1931 WHERE 1932 -- Semantic no-op: when the key is absent both COALESCE arms are NULL and the 1933 -- clause below is already NULL. Exists only so the planner can prove the 1934 -- partial index predicate is implied â do not remove it. 1935 m.meta ? 'minorFlagSnapshot' 1936 AND COALESCE( 1937 m.meta->'minorFlagSnapshot'->>'confirmedFrom', 1938 m.meta->'minorFlagSnapshot'->>'source' 1939 ) = 'auto' 1940 AND (m.meta->'minorFlagSnapshot'->>'at')::timestamptz > '${e}' 1941 AND m."userId" <> -1 1942 -- The snapshot is written before the flag lands and survives an ordinary 1943 -- unflag, so its presence alone doesn't prove the model is currently minor. 1944 AND m.minor 1945 ) 1946 SELECT 1947 concat('model-flagged-minor:', details->>'modelId', ':', '${e}') "key", 1948 "userId", 1949 'model-flagged-minor' "type", 1950 details 1951 FROM flagged; 1952 `}},eN="1 week",ef=[5,10,20,50,100,500],eb=[100,500,1e3,1e4,5e4],ew={"model-download-milestone":{displayName:"Model download milestones",category:n.NotificationCategory.Milestone,prepareMessage:({details:e})=>({message:`Congrats! Your ${e.modelName}
1952 model has received ${e.downloadCount.toLocaleString()} downloads`,url:`/models/${e.modelId}`}),prepareQuery:async({lastSentDate:e,clickhouse:t})=>{if(!t)return;let n=JSON.stringify((await t.$query` 1953 SELECT DISTINCT modelId 1954 FROM modelVersionEvents 1955 WHERE time > ${e} 1956 AND type = 'Download' 1957 `).map(e=>e.modelId));return` 1958 WITH milestones AS ( 1959 SELECT * FROM (VALUES ${ef.map(e=>`(${e})`).join(", ")}) m(value) 1960 ), model_value AS ( 1961 SELECT 1962 "modelId" model_id, 1963 "downloadCount" download_count 1964 FROM "ModelMetric" 1965 WHERE 1966 "modelId" = ANY (SELECT json_array_elements('${n}'::json)::text::integer) 1967 AND "downloadCount" >= ${ef[0]} 1968 ), model_milestone AS ( 1969 SELECT 1970 m."userId" "ownerId", 1971 JSON_BUILD_OBJECT( 1972 'modelName', m.name, 1973 'modelId', m.id, 1974 'downloadCount', ms.value 1975 ) "details" 1976 FROM model_value mval 1977 JOIN "Model" m on m.id = mval.model_id 1978 JOIN milestones ms ON ms.value <= mval.download_count 1979 WHERE m."createdAt" > '${a.milestoneNotificationFix}' 1980 ) 1981 SELECT 1982 CONCAT('model-download-milestone:', details->>'modelId', ':', details->>'downloadCount') as "key", 1983 "ownerId" "userId", 1984 'model-download-milestone' "type", 1985 details 1986 FROM model_milestone 1987 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'model-download-milestone') 1988 `}},"model-like-milestone":{displayName:"Model like milestones",category:n.NotificationCategory.Milestone,prepareMessage:({details:e})=>{let t=e.favoriteCount||e.thumbsUpCount;return{message:`Congrats! Your ${e.modelName} model has received ${t?.toLocaleString()} likes`,url:`/models/${e.modelId}`}},prepareQuery:({lastSent:e})=>` 1989 WITH milestones AS ( 1990 SELECT * FROM (VALUES ${eb.map(e=>`(${e})`).join(", ")}) m(value) 1991 ), model_value AS ( 1992 SELECT DISTINCT 1993 mm."modelId" model_id, 1994 mm."thumbsUpCount" thumbs_up_count 1995 FROM "ModelMetric" mm 1996 JOIN "Model" m ON m.id = mm."modelId" 1997 WHERE 1998 mm."updatedAt" > '${e}' 1999 AND "thumbsUpCount" >= ${eb[0]} 2000 AND m."userId" > 0 2001 ), model_milestone AS ( 2002 SELECT 2003 m."userId" "ownerId", 2004 JSON_BUILD_OBJECT( 2005 'modelName', m.name, 2006 'modelId', m.id, 2007 'thumbsUpCount', ms.value 2008 ) "details" 2009 FROM model_value mval 2010 JOIN "Model" m on m.id = mval.model_id 2011 JOIN milestones ms ON ms.value <= mval.thumbs_up_count 2012 WHERE m."createdAt" > '${a.milestoneNotificationFix}' 2013 ) 2014 SELECT 2015 CONCAT('model-like-milestone:', details->>'modelId', ':', details->>'thumbsUpCount') "key", 2016 "ownerId" "userId", 2017 'model-like-milestone' "type", 2018 details 2019 FROM model_milestone 2020 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'model-like-milestone') 2021 `},"new-model-version":{displayName:"New versions of models you follow",category:n.NotificationCategory.Update,prepareMessage:({details:e})=>({message:`The ${e.modelName} model has a new version: ${e.versionName}`,url:`/models/${e.modelId}${e.modelVersionId?`?modelVersionId=${e.modelVersionId}`:""}`}),prepareQuery:({lastSent:e})=>` 2022 WITH new_model_version AS ( 2023 SELECT 2024 m."userId", 2025 mv."modelId", 2026 JSONB_BUILD_OBJECT( 2027 'modelId', mv."modelId", 2028 'modelName', m.name, 2029 'versionName', mv.name, 2030 'modelVersionId', mv.id 2031 ) "details" 2032 FROM "ModelVersion" mv 2033 JOIN "Model" m ON m.id = mv."modelId" 2034 WHERE m."userId" > 0 2035 AND mv."publishedAt" - m."publishedAt" > INTERVAL '2 hour' 2036 -- Wall-clock floor: bound the query window to the last 30 minutes regardless of 2037 -- how far behind the cursor is. Prevents death-spiral when a stale cursor would 2038 -- otherwise force a giant table scan; older events become unreachable rather 2039 -- than blocking every subsequent run. 2040 AND mv."publishedAt" > NOW() - INTERVAL '30 minutes' 2041 AND ( 2042 -- handle scheduled posts - these can take a little while to update via another job 2043 (mv."publishedAt" BETWEEN '${e}'::timestamptz - interval '59 second' AND now() AND mv.status = 'Published') 2044 OR (mv."publishedAt" <= '${e}' AND mv.status = 'Scheduled') 2045 ) 2046 ), followers AS ( 2047 SELECT DISTINCT ON ("userId") 2048 * 2049 FROM ( 2050 SELECT 2051 ue."userId", 2052 nmv.details 2053 FROM "UserEngagement" ue 2054 JOIN new_model_version nmv ON nmv."userId" = ue."targetUserId" 2055 WHERE ue.type = 'Follow' 2056 AND NOT EXISTS (SELECT 1 FROM "ModelEngagement" me WHERE me.type = 'Mute' AND me."userId" = ue."userId" AND me."modelId" = nmv."modelId") 2057 AND ${r('ue."userId"','nmv."userId"')} 2058 2059 UNION 2060 2061 SELECT 2062 me."userId", 2063 nmv.details 2064 FROM "ModelEngagement" me 2065 JOIN new_model_version nmv ON nmv."modelId" = me."modelId"
2066 WHERE type = 'Notify' 2067 AND ${r('me."userId"','nmv."userId"')} 2068 ) t 2069 ) 2070 SELECT 2071 CONCAT('new-model-version:', details->>'modelVersionId') "key", 2072 "userId", 2073 'new-model-version' "type", 2074 details 2075 FROM followers n 2076 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" uns WHERE uns."userId" = n."userId" AND type = 'new-model-version') 2077 `},"new-model-from-following":{displayName:"New models from followed users",category:n.NotificationCategory.Update,prepareMessage:({details:e})=>({message:`${e.username} released a new ${(0,u.getDisplayName)(e.modelType)}: ${e.modelName}`,url:`/models/${e.modelId}`}),prepareQuery:({lastSent:e})=>` 2078 WITH new_model_from_following AS ( 2079 SELECT DISTINCT 2080 ue."userId" "ownerId", 2081 JSONB_BUILD_OBJECT( 2082 'modelId', m."id", 2083 'modelName', m.name, 2084 'username', u.username, 2085 'modelType', m.type 2086 ) "details" 2087 FROM "Model" m 2088 JOIN "User" u ON u.id = m."userId" 2089 JOIN "UserEngagement" ue ON ue."targetUserId" = m."userId" AND m."publishedAt" >= ue."createdAt" AND ue.type = 'Follow' 2090 WHERE 2091 m."userId" != -1 2092 -- 59s lookback buffer: handles race condition between send-notifications and 2093 -- process-scheduled-publishing jobs (both */1 * * * *). Without it, a model can be 2094 -- missed if its publishedAt falls just before the cursor after the previous run advanced. 2095 -- Duplicates are safe due to ON CONFLICT upsert in PendingNotification. 2096 AND m."publishedAt" BETWEEN '${e}'::timestamptz - interval '59 second' AND now() 2097 -- Wall-clock floor: bound the query window to the last 30 minutes regardless of 2098 -- how far behind the cursor is. Prevents death-spiral when a stale cursor would 2099 -- otherwise force a giant Model x UserEngagement scan. 2100 AND m."publishedAt" > NOW() - INTERVAL '30 minutes' 2101 AND m.status IN ('Published', 'Scheduled') 2102 -- The follow almost always predates the block, so the Follow row outlives it and keeps 2103 -- delivering the blocker's releases to someone who blocked them. 2104 AND ${r('ue."userId"','m."userId"')} 2105 ) 2106 SELECT 2107 CONCAT('new-model-from-following:', details->>'modelId') "key", 2108 "ownerId" "userId", 2109 'new-model-from-following' "type", 2110 details 2111 FROM new_model_from_following 2112 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'new-model-from-following') 2113 `},"early-access-complete":{toggleable:!1,displayName:"Early Access Complete",category:n.NotificationCategory.Update,prepareMessage:({details:e})=>({message:`${e.modelName}: ${e.versionName} has left Early Access!`,url:`/models/${e.modelId}?modelVersionId=${e.versionId}`}),prepareQuery:({lastSent:e})=>` 2114 WITH early_access_versions AS ( 2115 SELECT 2116 mv.id version_id, 2117 mv.name version_name, 2118 m.id model_id, 2119 m.name model_name, 2120 m.type model_type, 2121 mv."publishedAt" updated_published_at 2122 FROM "ModelVersion" mv 2123 JOIN "Model" m ON m.id = mv."modelId" 2124 JOIN "PaidAccess" pa ON pa."entityType" = 'ModelVersion' AND pa."entityId" = mv.id 2125 where 2126 pa."endsAt" IS NOT NULL 2127 AND pa."endsAt" <= NOW() 2128 AND pa."endsAt" >= '${e}' 2129 -- Wall-clock floor: bound to last 30 minutes so a stale cursor cannot force a 2130 -- giant table scan. See new-model-from-following / new-model-version for details. 2131 AND pa."endsAt" > NOW() - INTERVAL '30 minutes' 2132 ), early_access_complete AS ( 2133 SELECT DISTINCT 2134 mve."userId" owner_id, 2135 jsonb_build_object( 2136 'modelId', model_id, 2137 'modelName', model_name, 2138 'modelType', model_type, 2139 'versionId', version_id, 2140 'versionName', version_name 2141 ) details 2142 FROM early_access_versions ev 2143 JOIN "ModelVersionEngagement" mve ON mve."modelVersionId" = ev.version_id AND mve.type = 'Notify' 2144 WHERE ev.updated_published_at > '${e}' AND ev.updated_published_at < now() 2145 ) 2146 SELECT 2147 concat('early-access-complete:', details->>'versionId') "key", 2148 owner_id "userId", 2149 'early-access-complete' "type", 2150 details 2151 FROM early_access_complete; 2152 `}
2152,"old-draft":{displayName:"Old Model Draft Deletion Reminder",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:`Your ${e.modelName} model that is in draft mode will be deleted in ${eN}.`,url:`/models/${e.modelId}/${(0,u.slugit)(e.modelName)}`}),prepareQuery:({lastSent:e})=>` 2153 with to_add AS ( 2154 SELECT DISTINCT 2155 m."userId", 2156 jsonb_build_object( 2157 'modelId', m.id, 2158 'modelName', m.name, 2159 'updatedAt', m."updatedAt" 2160 ) details 2161 FROM "Model" m 2162 WHERE m.status IN ('Draft') 2163 AND m."updatedAt" BETWEEN '${e}'::timestamp - INTERVAL '23 days' AND NOW() - INTERVAL '23 days' 2164 AND m."availability" != 'Private'::"Availability" 2165 -- EXISTS, not a JOIN, but the same semantics as the reaper's INNER 2166 -- JOIN + DISTINCT: a model with no "ModelMetric" row is not reapable, 2167 -- so it must not be warned either. 2168 AND EXISTS (SELECT 1 FROM "ModelMetric" mm 2169 WHERE mm."modelId" = m.id 2170 AND mm."downloadCount" < 10) 2171 ) 2172 SELECT 2173 concat('old-draft:', details->>'modelId', ':', details->>'updatedAt') "key", 2174 "userId", 2175 'old-draft' "type", 2176 details 2177 FROM to_add 2178 `},"early-access-failed-to-publish":{displayName:"Model version failed to publish.",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:`We were unable to publish your model version: ${e.displayName} due to insufficient funds. Please remove early access or purchase more Buzz to publish.`,url:`/models/${e.modelId}?modelVersionId=${e.modelVersionId}`})},"model-hash-fix":{displayName:"Model Hash Fix",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:`The hash in the metadata of your resource "${e.modelName}: ${e.versionName}" has been corrected. Please redownload it to ensure that your images report the correct hash going forward.`,url:`/models/${e.modelId}/${(0,u.slugit)(e.modelName)}?modelVersionId=${e.versionId}`})}},eS={"new-order-sanity-warning":{displayName:"Knights of New Order: Performance Check Failed",category:n.NotificationCategory.Other,prepareMessage:({details:e})=>({message:e?.message||"Knights of New Order: Careful! You incorrectly rated a performance check image. Make sure you rate based on your acolyte training to avoid getting a Smite.",url:"/games/knights-of-new-order"})},"new-order-smite-received":{displayName:"Knights of New Order: Smite",prepareMessage:()=>({message:"Knights of New Order: Oh no! You got a smite because one of your ratings did not meet the guidelines. Jump back in to cleanse the smite as soon as possible!",url:"/games/knights-of-new-order"}),category:n.NotificationCategory.Other},"new-order-smite-cleansed":{displayName:"Knights of New Order: Cleansed Smite",category:n.NotificationCategory.Other,prepareMessage:({details:e})=>({message:`Knights of New Order: One of your smites was cleansed with the following reason: ${e.cleansedReason}`,url:"/games/knights-of-new-order"})},"new-order-game-over":{displayName:"Knights of New Order: Game Over",category:n.NotificationCategory.Other,prepareMessage:({details:e})=>({message:`Knights of New Order: ${e.reason||"Your New Order career has been reset."}`,url:"/games/knights-of-new-order"})},"new-order-templar-promotion":{displayName:"Knights of New Order: Templar Promotion",category:n.NotificationCategory.Other,prepareMessage:()=>({message:"Knights of New Order: Congratulations! You have been promoted to Templar because your fervor is outstangin! Keep up the good work!",url:"/games/knights-of-new-order"})},"new-order-knight-demoted":{displayName:"Knights of New Order: Knight Demotion",category:n.NotificationCategory.Other,prepareMessage:()=>({message:"Knights of New Order: Oh no! You have been demoted to Knight because your fervor is not up to the standards. This update reflects recent activity levels and isn't permanent, you're always welcome to level up again through continued engagement.",url:"/games/knights-of-new-order"})},"new-order-blessed-buzz-granted":{displayName:"Knights of New Order: Blessed Buzz Granted",category:n.NotificationCategory.Other,prepareMessage:({details:e})=>({message:`Knights of New Order: You've received ${e.buzzAmount} Buzz from your banked Gold rewards! Thank you for your continued dedication to content moderation. Sorry for the delay!`,url:"/user/transactions"})}},eT={"strike-issued":{displayName:"Strike Issued",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:e.points>1?`You have received a strike: ${e.description}. This counts as ${e.points} strike points.`:`You have received a strike: ${e.description}.`})},"strike-voided":{displayName:"Strike Removed",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:`A strike on your account has been removed: ${e.voidReason}`})},"strike-escalation-muted":{displayName:"Account Muted",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>
2178({message:"indefinite"===e.muteDays?"Your account has been muted due to accumulated strikes and is pending review. Please review our Terms of Service.":"Your account has been muted due to accumulated strikes. Review and accept our Terms of Service to lift it â you will be asked the next time you try to post or comment."})},"strike-expired":{displayName:"Strike Expired",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:()=>({message:"A strike on your account has expired. Your account standing has improved."})},"strike-de-escalation-unmuted":{displayName:"Account Unmuted",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:()=>({message:"Your account mute has been lifted as your strike points have decreased. Please continue to follow our Terms of Service."})}},eR=[5,10,20,50,100],ev=[5,10,20,50,100],ek={"comment-reaction-milestone":{displayName:"Comment reaction milestones",category:n.NotificationCategory.Milestone,prepareMessage:({details:e})=>({message:`Your comment on ${e.modelName} has received ${e.reactionCount} reactions`,url:(0,G.getModelCommentThreadUrl)({modelId:e.modelId,commentId:e.rootCommentId})}),prepareQuery:({lastSent:e})=>` 2179 WITH milestones AS ( 2180 SELECT * FROM (VALUES ${eR.map(e=>`(${e})`).join(", ")}) m(value) 2181 ), affected AS ( 2182 SELECT DISTINCT 2183 "commentId" affected_id 2184 FROM "CommentReaction" 2185 WHERE "createdAt" > '${e}' 2186 ), affected_value AS ( 2187 SELECT 2188 a.affected_id, 2189 COUNT(r."commentId") reaction_count 2190 FROM "CommentReaction" r 2191 JOIN affected a ON a.affected_id = r."commentId" 2192 GROUP BY a.affected_id 2193 HAVING COUNT(*) >= ${eR[0]} 2194 ), reaction_milestone AS ( 2195 SELECT 2196 c."userId" "ownerId", 2197 JSON_BUILD_OBJECT( 2198 'modelName', m.name, 2199 'modelId', m.id, 2200 'rootCommentId', COALESCE(c."parentId", c.id), 2201 'commentId', c.id, 2202 'reactionCount', ms.value 2203 ) "details" 2204 FROM affected_value a 2205 JOIN "Comment" c on c.id = a.affected_id 2206 JOIN "Model" m ON m.id = c."modelId" 2207 JOIN milestones ms ON ms.value <= a.reaction_count 2208 WHERE c."createdAt" > '${a.milestoneNotificationFix}' 2209 ) 2210 SELECT 2211 CONCAT('comment-reaction-milestone:', details->>'commentId', ':', details->>'reactionCount') "key", 2212 "ownerId" "userId", 2213 'comment-reaction-milestone' "type", 2214 details 2215 FROM reaction_milestone 2216 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'comment-reaction-milestone') 2217 `},"image-reaction-milestone":{displayName:"Image reaction milestones",category:n.NotificationCategory.Milestone,prepareMessage:({details:e})=>{let t;if(2===e.version){let a;if(e.models){let t=e.models.slice(0,2),n=e.models.length-t.length;a=n>0?t.join(", ")+`, and ${n} more`:function(e,t){if(!Array.isArray(e))throw TypeError("Expected an array, but got a non-array value "+e+".");return(t={separator:", ",lastSeparator:", and ",...t},0===e.length)?"":1===e.length?e[0]:e.slice(0,-1).join(t.separator)+t.lastSeparator+e[e.length-1]}(t)}t=`Your image${a?` using ${a}`:""} has received ${e.reactionCount} reactions`}else t=`Your ${e.reviewId?"review image":"example image"} on the ${e.modelName} model has received ${e.reactionCount} reactions`;return{message:t,url:null!=e.postId?`/images/${e.imageId}?postId=${e.postId}`:`/images/${e.imageId}`}}},"article-reaction-milestone":{displayName:"Article reaction milestones",category:n.NotificationCategory.Milestone,prepareMessage:({details:e})=>({message:`Your article, "${e.articleTitle}" has received ${e.reactionCount} reactions`,url:`/articles/${e.articleId}`}),prepareQuery:async({lastSent:e,excludedUserIds:t})=>{let n=M(t??[]);return` 2218 WITH milestones AS ( 2219 SELECT * FROM (VALUES ${ev.map(e=>`(${e})`).join(", ")}) m(value) 2220 ), affected AS ( 2221 SELECT DISTINCT 2222 "articleId" affected_id 2223 FROM "ArticleReaction" 2224 WHERE "createdAt" > '${e}' 2225 ), affected_value AS ( 2226 SELECT 2227 a.affected_id, 2228 COUNT(r."articleId") reaction_count 2229 FROM "ArticleReaction" r 2230 JOIN affected a ON a.affected_id = r."articleId" ${n} 2231 GROUP BY a.affected_id 2232 HAVING COUNT(*) >= ${ev[0]} 2233 ), reaction_milestone AS ( 2234 SELECT 2235 a."userId" "ownerId", 2236 JSON_BUILD_OBJECT( 2237 'articleId', a.id, 2238 'articleTitle', a.title, 2239 'reactionCount', ms.value 2240 ) "details" 2241 FROM affected_value af 2242 JOIN "Article" a on a.id = af.affected_id 2243 JOIN milestones ms ON ms.value <= af.reaction_count 2244 AND a."createdAt" > '${a.milestoneNotificationFix}' 2245 ) 2246 SELECT 2247 CONCAT('article-reaction-milestone:', details->>'articleId', ':', details->>'reactionCount') "key", 2248 "ownerId" "userId", 2249 'article-reaction-milestone' "type", 2250 details 2251 FROM reaction_milestone 2252 WHERE NOT EXISTS (SELECT 1 FROM "UserNotificationSettings" WHERE "userId" = "ownerId" AND type = 'article-reaction-milestone') 2253 `}}};var eM=e.i(229862);let eO={[eM.EntityType.Image]:"/images",[eM.EntityType.Model]:"/models"},eP={"report-actioned":{displayName:"Report actioned",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:`The ${e.reportType??"item"} you reported has been actioned. Thanks for helping keep the community safe!`}),prepareQuery:async({lastSent:e})=>` 2254 WITH actioned AS ( 2255 SELECT DISTINCT 2256 u."id" "ownerId", 2257 JSONB_BUILD_OBJECT( 2258 'reportId', r.id, 2259 'reportType', 2260 CASE 2261 WHEN jsonb_typeof(r.details->'reportType') = 'string' THEN r.details->>'reportType' 2262 WHEN EXISTS (SELECT 1 FROM "ResourceReviewReport" WHERE "reportId" = r.id) THEN 'review' 2263 WHEN EXISTS (SELECT 1 FROM "ModelReport" WHERE "reportId" = r.id) THEN 'resource' 2264 WHEN EXISTS (SELECT 1 FROM "CommentReport" WHERE "reportId" = r.id) THEN 'comment' 2265 WHEN EXISTS (SELECT 1 FROM "CommentV2Report" WHERE "reportId" = r.id) THEN 'comment' 2266 WHEN EXISTS (SELECT 1 FROM "ImageReport" WHERE "reportId" = r.id) THEN 'image' 2267 WHEN EXISTS (SELECT 1 FROM "ArticleReport" WHERE "reportId" = r.id) THEN 'article' 2268 WHEN EXISTS (SELECT 1 FROM "PostReport" WHERE "reportId" = r.id) THEN 'post' 2269 WHEN EXISTS (SELECT 1 FROM "CollectionReport" WHERE "reportId" = r.id) THEN 'collection' 2270 END, 2271 'reportReason', r.reason, 2272 'createdAt', r."createdAt" 2273 ) as "details" 2274 FROM "Report" r 2275 JOIN "User" u ON u.id = r."userId" OR u.id = ANY(r."alsoReportedBy") 2276 WHERE 2277 r."userId" > 0 AND 2278 r.reason != 'NSFW' AND 2279 r."statusSetAt" > '${e}' AND 2280 r.status = 'Actioned' 2281 ) 2282 SELECT 2283 concat('report-actioned:', details->>'reportId') "key", 2284 "ownerId" "userId", 2285 'report-actioned' "type", 2286 details 2287 FROM actioned r 2288 `},"entity-appeal-resolved":{displayName:"Entity appeal resolved",category:n.NotificationCategory.Other,toggleable:!1,prepareMessage:({details:e})=>({message:`Your appeal regarding your ${e.entityType} has been ${e.status.toLowerCase()}${e.resolvedMessage?`: ${e.resolvedMessage}.`:"."}`,url:`${eO[e.entityType]}/${e.entityId}`})}},eD={"new-review":{displayName:"New reviews",category:n.NotificationCategory.Update,prepareMessage:({details:e})=>
2288{if(2===e.version){let t=e.recommended??(!!e.rating&&e.rating>=3),a=`${e.username} gave ${e.modelName} ${e.modelVersionName} a ${t?"ð":"ð"}`;return e.imageCount&&(a+=` and posted ${e.imageCount} images`),{message:a,url:`/reviews/${e.reviewId}`}}return{message:`${e.username} reviewed ${e.modelName} ${e.modelVersionName}`,url:`/redirect?to=review&reviewId=${e.reviewId}`}}}},eL={"civitai-features":{displayName:"New Civitai features",category:n.NotificationCategory.System,prepareMessage:({details:e})=>({message:`New Features! ${e.featureBlurb}, check it out!`,url:`/content/release/${e.releaseSlug}`})},"tos-violation":{displayName:"Terms of Service Violation",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:e.reason?`Your ${e.entity} on "${e.modelName}" has been removed for a Terms of Service violation: ${e.reason}.`:`Your ${e.entity} on "${e.modelName}" has been removed due to a Terms of Service violation.`,url:e.url})},"system-announcement":{displayName:"System Announcement",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:e.message,url:e.url})},"system-message":{displayName:"Heads Up!",category:n.NotificationCategory.Other,toggleable:!1,prepareMessage:({details:e})=>({message:e.message,url:e.url})}},e$={"model-version-unpublished":{displayName:"Model version unpublished",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>({message:"other"!==e.reason?`Your ${e.modelName} - ${e.modelVersionName} model has been unpublished: ${p.unpublishReasons[e.reason].notificationMessage??""}`:`Your ${e.modelName} - ${e.modelVersionName} model has been unpublished: ${e.customMessage??""}`,url:`/models/${e.modelId}/${(0,u.slugit)(e.modelName)}?modelVersionId=${e.modelVersionId}`}),prepareQuery:({lastSent:e})=>` 2289 WITH unpublished AS ( 2290 SELECT DISTINCT 2291 m."userId", 2292 jsonb_build_object( 2293 'modelId', m.id, 2294 'modelName', m.name, 2295 'modelVersionId', mv.id, 2296 'modelVersionName', mv.name, 2297 'reason', mv.meta->>'unpublishedReason', 2298 'customMessage', mv.meta->>'customMessage' 2299 ) "details" 2300 FROM "ModelVersion" mv 2301 JOIN "Model" m ON m.id = mv."modelId" 2302 WHERE jsonb_typeof(mv.meta->'unpublishedReason') = 'string' 2303 AND (mv.meta->>'unpublishedAt')::timestamp > '${e}' 2304 ) 2305 SELECT 2306 concat('model-version-unpublished:', details->>'modelVersionId', ':', '${e}') "key", 2307 "userId", 2308 'model-version-unpublished' "type", 2309 details 2310 FROM unpublished; 2311 `},"model-unpublished":{displayName:"Model unpublished",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>e&&!j(e)?{message:"other"!==e.reason?`Your ${e.modelName} model has been unpublished: ${p.unpublishReasons[e.reason].notificationMessage??""}`:`Your ${e.modelName} model has been unpublished: ${e.customMessage??""}`,url:`/models/${e.modelId}/${(0,u.slugit)(e.modelName)}`}:void 0,prepareQuery:({lastSent:e})=>` 2312 WITH unpublished AS ( 2313 SELECT DISTINCT 2314 m."userId", 2315 jsonb_build_object( 2316 'modelId', m.id, 2317 'modelName', m.name, 2318 'reason', m.meta->>'unpublishedReason', 2319 'customMessage', m.meta->>'customMessage' 2320 ) "details" 2321 FROM "Model" m 2322 WHERE jsonb_typeof(m.meta->'unpublishedReason') = 'string' 2323 AND (m.meta->>'unpublishedAt')::timestamp > '${e}' 2324 ) 2325 SELECT 2326 concat('model-unpublished:', details->>'modelId', ':', '${e}') "key", 2327 "userId", 2328 'model-unpublished' "type", 2329 details 2330 FROM unpublished; 2331 `},"model-republish-declined":{displayName:"Model republish declined",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:({details:e})=>{let t=`Your republish request for ${e.modelName} has been declined`;return e.reason&&(t+=`: ${e.reason}`),{message:t,url:`/models/${e.modelId}/${(0,u.slugit)(e.modelName)}`}},prepareQuery:({lastSent:e})=>` 2332 WITH declined AS ( 2333 SELECT DISTINCT 2334 m."userId", 2335 jsonb_build_object( 2336 'modelId', m.id, 2337 'modelName', m.name, 2338 'reason', m.meta->>'declinedReason' 2339 ) "details" 2340 FROM "Model" m 2341 WHERE jsonb_typeof(m.meta->'declinedReason') = 'string' 2342 AND (m.meta->>'declinedAt')::timestamp > '${e}' 2343 ) 2344 SELECT 2345 concat('model-republish-declined:', details->>'modelId', ':', '${e}') "key", 2346 "userId", 2347 'model-republish-declined' "type", 2348 details 2349 FROM declined; 2350 `}},eF={"join-community":{displayName:"Welcome to Civitai",category:n.NotificationCategory.System,toggleable:!1,prepareMessage:()=>({message:"Happy to have you here! Come join our Discord server to stay up to date with the community and updates to the platform.",url:"/discord",target:"_blank"})}},eU={"referral-reward-settled":{displayName:"Referral Reward Settled",category:n.NotificationCategory.Referral,prepareMessage:({details:e})=>{let t=Number(e.tokens??0),a=Number(e.blueBuzz??0),n=[];t>0&&n.push(`${t} token${1===t?"":"s"}`),a>
23500&&n.push(`${a.toLocaleString()} Blue Buzz`);let o=n.join(" + ")||"Reward";return{message:`${o} from your referral settled. Spend it or save it on your referral dashboard.`,url:"/user/referrals"}}},"referral-milestone-hit":{displayName:"Referral Milestone Reached",category:n.NotificationCategory.Referral,prepareMessage:({details:e})=>{let t=Number(e.threshold??0).toLocaleString(),a=Number(e.bonusAmount??0).toLocaleString();return{message:`You crossed the ${t} lifetime Blue Buzz milestone. +${a} bonus Blue Buzz is on the way.`,url:"/user/referrals"}}},"referral-token-expiring":{displayName:"Referral Tokens Expiring Soon",category:n.NotificationCategory.Referral,prepareMessage:({details:e})=>{let t=Number(e.tokens??0);return{message:`${t} referral token${1===t?"":"s"} will expire within 7 days. Redeem them for Membership perks before they lapse.`,url:"/user/referrals"}}},"referral-welcome-bonus":{displayName:"Welcome Bonus from Referral",category:n.NotificationCategory.Referral,toggleable:!1,prepareMessage:({details:e})=>{let t=Number(e.blueBuzz??0).toLocaleString();return{message:`Thanks for subscribing through a referral. ${t} Blue Buzz has been added to your account.`,url:"/user/buzz-dashboard"}}}},eB={...eg,...eA,...ew,...eD,...ed,...ek,...eL,...eF,...e$,...eE,...l,...I,...S,...y,...N,...T,...m,...eP,...eI,...P,...em,...L,...U,...eC,...ep,...eh,...ey,...es,...F,...k,...eS,...c,...eT,...eU,...$},eW=Object.entries(eB).map(([e,t])=>({...t,key:e})).sort((e,t)=>(e.priority??0)-(t.priority??0)),eH={};for(let e of eW){let t=e.priority??0;eH[t]??=[],eH[t].push(e)}Object.keys(eH).map(Number).sort((e,t)=>e-t).map(e=>eH[e]);let{notificationCategoryTypes:ez,notificationTypes:e_,optInNotificationTypes:eV}=function(){let e=[],t=[],a={};for(let[n,{displayName:o,toggleable:r,category:i,optIn:d,showCategory:s}]of Object.entries(eB))(!1!==r||s)&&(a[i]??=[],a[i].push({type:n,displayName:o,optIn:d??!1}),d?t.push(n):e.push(n));return{notificationCategoryTypes:a,notificationTypes:e,optInNotificationTypes:t}}(),eY=e=>eV.includes(e);e.s(["getNotificationMessage",0,function(e){let{prepareMessage:t}=eB[e.type]??{};return t?t(e):null},"isOptInNotification",0,eY,"notificationCategoryTypes",0,ez,"notificationTypes",0,e_,"optInNotificationTypes",0,eV],666545);var ex=e.i(85179),eJ=e.i(148063);e.s(["useNotificationSettings",0,(e=!0)=>{let{data:a=[],isLoading:n}=eJ.trpc.user.getNotificationSettings.useQuery(void 0,{enabled:e}),{hasNotifications:o,hasCategory:r,notificationSettings:i}=(0,t.useMemo)(()=>{let e=!1,t={},n={};for(let[o,r]of Object.entries(ez))for(let{type:i,optIn:d}of(n[o]=!1,r)){let r=a.some(e=>e.type===i),s=d?r:!r;t[i]=s,d||(!n[o]&&s&&(n[o]=!0),!e&&s&&(e=!0))}return{hasNotifications:e,hasCategory:n,notificationSettings:t}},[a]);return{hasNotifications:o,hasCategory:r,notificationSettings:i,isLoading:n}},"usePushNotificationSettings",0,(e=!0)=>{let{data:t=[],isLoading:a}=eJ.trpc.notification.getPushSettings.useQuery(void 0,{enabled:e,staleTime:0});return{pushTypes:t,isLoading:a}},"useToggleNotificationSetting",0,()=>{let e=eJ.trpc.useUtils();return eJ.trpc.notification.updateUserSettings.useMutation({async onMutate({toggle:t,type:a}){await e.user.getNotificationSettings.cancel();let n=e.user.getNotificationSettings.getData()??[],o=n.map(e=>e.type),r=n.length>0?n[n.length-1]:{id:0},i=a.filter(e=>t?!eY(e):eY(e)),d=a.filter(e=>t?eY(e):!eY(e)).filter(e=>!o.includes(e)).map(e=>({...r,type:e,disabledAt:new Date}));return e.user.getNotificationSettings.setData(void 0,(e=[])=>[...e.filter(e=>!i.includes(e.type)),...d]),{prevUserSettings:n}},onSuccess(){(0,ex.showSuccessNotification)({message:"User profile updated"})},onError(t,a,n){e.user.getNotificationSettings.setData(void 0,n?.prevUserSettings)}})},"useTogglePushSetting",0,()=>{let e=eJ.trpc.useUtils();return eJ.trpc.notification.updatePushSettings.useMutation({async onMutate({type:t,enabled:a}){await e.notification.getPushSettings.cancel();let n=e.notification.getPushSettings.getData()??[];return e.notification.getPushSettings.setData(void 0,(e=[])=>a?[...new Set([...e,...t])]:e.filter(e=>!t.includes(e))),{prevPushTypes:n}},onError(t,a,n){e.notification.getPushSettings.setData(void 0,n?.prevPushTypes)}})}],198091)}]); 2351 2352//# sourceMappingURL=2tfuiw_-h589h.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.