PageSourceSearch

https://qname.ai/assets/domain-sweep-DyC6o4So.js

js qname.ai collected 2026-10-05 16:37:35 UTC 74,658 bytes, 22 lines download raw bytes

1import{c as Re,a0 as Y,a1 as Z,a2 as X,a3 as ye,e as pt,r as b,j as a,B as Q,a4 as He,b as Le,a5 as Qe,N as _t,P as $e,Y as ft,R as ht}from"./main-HVf8ATPQ.js";import{t as P}from"./index-CTmY_VWW.js";import{p as yt,a as Te,A as J,b as M,D as me,B as gt,g as xt,c as Nt}from"./sweep-DCxdKCJ7.js";import{D as bt,a as wt,b as St,c as vt,d as It,e as kt}from"./dialog-BTsTbhTq.js";import{I as Be}from"./input-ePyCg58M.js";import{T as oe}from"./textarea-PFpE2rQP.js";import{u as At}from"./useQuery-CsEp9Bxp.js";import{u as ge}from"./useMutation-DmgZPe70.js";import{I as Dt}from"./IconPlus-CKegWvID.js";import{I as qe}from"./IconDatabase-CGPTWsVg.js";import{I as jt}from"./IconEdit-B7MlOvNa.js";import{I as Ct}from"./IconTrash-DKhy3iDc.js";import{I as ze}from"./IconLoader2-CRzzoIOT.js";import{I as de}from"./IconAlertTriangle-BpMpZfrl.js";import{I as Lt}from"./IconArrowRight-DGkNnTkc.js";import{I as Qt}from"./IconCopy-BsG6KBoM.js";import"./DialogTitle-nT-rcQsU.js";const Tt=[["path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0",key:"svg-0"}],["path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0",key:"svg-1"}],["path",{d:"M3 6l0 13",key:"svg-2"}],["path",{d:"M12 6l0 13",key:"svg-3"}],["path",{d:"M21 6l0 13",key:"svg-4"}]],Bt=Re("outline","book","Book",Tt);const qt=[["path",{d:"M6.657 18c-2.572 0 -4.657 -2.007 -4.657 -4.483c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.913 0 3.464 1.56 3.464 3.486c0 1.927 -1.551 3.487 -3.465 3.487h-11.878",key:"svg-0"}]],Ee=Re("outline","cloud","Cloud",qt),l=Symbol.for("drizzle:entityKind");function A(e,t){if(!e||typeof e!="object")return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,l))throw new Error(`Class "${t.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(l in n&&n[l]===t[l])return!0;n=Object.getPrototypeOf(n)}return!1}class xe{constructor(t,n){this.table=t,this.config=n,this.name=n.name,this.keyAsName=n.keyAsName,this.notNull=n.notNull,this.default=n.default,this.defaultFn=n.defaultFn,this.onUpdateFn=n.onUpdateFn,this.hasDefault=n.hasDefault,this.primary=n.primaryKey,this.isUnique=n.isUnique,this.uniqueName=n.uniqueName,this.uniqueType=n.uniqueType,this.dataType=n.dataType,this.columnType=n.columnType,this.generated=n.generated,this.generatedIdentity=n.generatedIdentity}static[l]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class zt{static[l]="ColumnBuilder";config;constructor(t,n,o){this.config={name:t,keyAsName:t==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:n,columnType:o,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(t){return this.config.default=t,this.config.hasDefault=!0,this}$defaultFn(t){return this.config.defaultFn=t,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(t){return this.config.onUpdateFn=t,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(t){this.config.name===""&&(this.config.name=t)}}const O=Symbol.for("drizzle:Name"),Pe=Symbol.for("drizzle:isPgEnum");function Et(e){return!!e&&typeof e=="function"&&Pe in e&&e[Pe]===!0}class Ve{static[l]="Subquery";constructor(t,n,o,f=!1,c=[]){this._={brand:"Subquery",sql:t,selectedFields:n,alias:o,isWith:f,usedTables:c}}}const Pt={startActiveSpan(e,t){return t()}},U=Symbol.for("drizzle:ViewBaseConfig"),le=Symbol.for("drizzle:Schema"),Oe=Symbol.for("drizzle:Columns"),Ke=Symbol.for("drizzle:ExtraConfigColumns"),ue=Symbol.for("drizzle:OriginalName"),ce=Symbol.for("drizzle:BaseName"),G=Symbol.for("drizzle:IsAlias"),Fe=Symbol.for("drizzle:ExtraConfigBuilder"),Ot=Symbol.for("drizzle:IsDrizzleTable");class I{static[l]="Table";static Symbol={Name:O,Schema:le,OriginalName:ue,Columns:Oe,ExtraConfigColumns:Ke,BaseName:ce,IsAlias:G,ExtraConfigBuilder:Fe};[O];[ue];[le];[Oe];[Ke];[ce];[G]=!1;[Ot]=!0;[Fe]=void 0;constructor(t,n,o){this[O]=this[ue]=t,this[le]=n,this[ce]=o}}function Kt(e){return e!=null&&typeof e.getSQL=="function"}function Ft(e){const t={sql:"",params:[]};for(const n of e)t.sql+=n.sql,t.params.push(...n.params),n.typings?.length&&(t.typings||(t.typings=[]),t.typings.push(...n.typings));return t}class j{static[l]="StringChunk";value;constructor(t){this.value=Array.isArray(t)?t:[t]}getSQL(){return new w([this])}}class w{constructor(t){this.queryChunks=t;for(const n of t)if(A(n,I)){const o=n[I.Symbol.Schema];this.usedTables.push(o===void 0?n[I.Symbol.Name]:o+"."+n[I.Symbol.Name])}}static[l]="SQL";decoder=Je;shouldInlineParams=!1;usedTables=[];append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Pt.startActiveSpan("drizzle.buildSQL",n=>{const o=this.buildQueryFromSourceParams(this.queryChunks,t);return n?.setAttributes({"drizzle.query.text":o.sql,"drizzle.query.params":JSON.stringify(o.params)}),o})}buildQueryFromSourceParams(t,n){const o=Object.assign({}
1,n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:f,escapeName:c,escapeParam:S,prepareTyping:g,inlineParams:_,paramStartIndex:v}=o;return Ft(t.map(d=>{if(A(d,j))return{sql:d.value.join(""),params:[]};if(A(d,pe))return{sql:c(d.value),params:[]};if(d===void 0)return{sql:"",params:[]};if(Array.isArray(d)){const p=[new j("(")];for(const[y,K]of d.entries())p.push(K),y<d.length-1&&p.push(new j(", "));return p.push(new j(")")),this.buildQueryFromSourceParams(p,o)}if(A(d,w))return this.buildQueryFromSourceParams(d.queryChunks,{...o,inlineParams:_||d.shouldInlineParams});if(A(d,I)){const p=d[I.Symbol.Schema],y=d[I.Symbol.Name];return{sql:p===void 0||d[G]?c(y):c(p)+"."+c(y),params:[]}}if(A(d,xe)){const p=f.getColumnCasing(d);if(n.invokeSource==="indexes")return{sql:c(p),params:[]};const y=d.table[I.Symbol.Schema];return{sql:d.table[G]||y===void 0?c(d.table[I.Symbol.Name])+"."+c(p):c(y)+"."+c(d.table[I.Symbol.Name])+"."+c(p),params:[]}}if(A(d,Ut)){const p=d[U].schema,y=d[U].name;return{sql:p===void 0||d[U].isAlias?c(y):c(p)+"."+c(y),params:[]}}if(A(d,Ge)){if(A(d.value,_e))return{sql:S(v.value++,d),params:[d],typings:["none"]};const p=d.value===null?null:d.encoder.mapToDriverValue(d.value);if(A(p,w))return this.buildQueryFromSourceParams([p],o);if(_)return{sql:this.mapInlineParam(p,o),params:[]};let y=["none"];return g&&(y=[g(d.encoder)]),{sql:S(v.value++,p),params:[p],typings:y}}return A(d,_e)?{sql:S(v.value++,d),params:[d],typings:["none"]}:A(d,w.Aliased)&&d.fieldAlias!==void 0?{sql:c(d.fieldAlias),params:[]}:A(d,Ve)?d._.isWith?{sql:c(d._.alias),params:[]}:this.buildQueryFromSourceParams([new j("("),d._.sql,new j(") "),new pe(d._.alias)],o):Et(d)?d.schema?{sql:c(d.schema)+"."+c(d.enumName),params:[]}:{sql:c(d.enumName),params:[]}:Kt(d)?d.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([d.getSQL()],o):this.buildQueryFromSourceParams([new j("("),d.getSQL(),new j(")")],o):_?{sql:this.mapInlineParam(d,o),params:[]}:{sql:S(v.value++,d),params:[d],typings:["none"]}}))}mapInlineParam(t,{escapeString:n}){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return t.toString();if(typeof t=="string")return n(t);if(typeof t=="object"){const o=t.toString();return n(o==="[object Object]"?JSON.stringify(t):o)}throw new Error("Unexpected param value: "+t)}getSQL(){return this}as(t){return t===void 0?this:new w.Aliased(this,t)}mapWith(t){return this.decoder=typeof t=="function"?{mapFromDriverValue:t}:t,this}inlineParams(){return this.shouldInlineParams=!0,this}if(t){return t?this:void 0}}class pe{constructor(t){this.value=t}static[l]="Name";brand;getSQL(){return new w([this])}}const Je={mapFromDriverValue:e=>e},Me={mapToDriverValue:e=>e};({...Je,...Me});class Ge{constructor(t,n=Me){this.value=t,this.encoder=n}static[l]="Param";brand;getSQL(){return new w([this])}}function T(e,...t){const n=[];(t.length>0||e.length>0&&e[0]!=="")&&n.push(new j(e[0]));for(const[o,f]of t.entries())n.push(f,new j(e[o+1]));return new w(n)}(e=>{function t(){return new w([])}e.empty=t;function n(_){return new w(_)}e.fromList=n;function o(_){return new w([new j(_)])}e.raw=o;function f(_,v){const d=[];for(const[p,y]of _.entries())p>0&&v!==void 0&&d.push(v),d.push(y);return new w(d)}e.join=f;function c(_){return new pe(_)}e.identifier=c;function S(_){return new _e(_)}e.placeholder=S;function g(_,v){return new Ge(_,v)}e.param=g})(T||(T={}));(e=>{class t{constructor(o,f){this.sql=o,this.fieldAlias=f}static[l]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(w||(w={}));class _e{constructor(t){this.name=t}static[l]="Placeholder";getSQL(){return new w([this])}}const Wt=Symbol.for("drizzle:IsDrizzleView");class Ut{static[l]="View";[U];[Wt]=!0;constructor({name:t,schema:n,selectedFields:o,query:f}){this[U]={name:t,originalName:t,schema:n,selectedFields:o,query:f,isExisting:!f,isAlias:!1}}getSQL(){return new w([this])}}xe.prototype.getSQL=function(){return new w([this])};I.prototype.getSQL=function(){return new w([this])};Ve.prototype.getSQL=function(){return new w([this])};function R(e,t){return{name:typeof e=="string"&&e.length>0?e:"",config:typeof e=="object"?e:t}}const Ye=typeof TextDecoder>"u"?null:new TextDecoder;class Rt{static[l]="SQLiteForeignKeyBuilder";reference;
1_onUpdate;_onDelete;constructor(t,n){this.reference=()=>{const{name:o,columns:f,foreignColumns:c}=t();return{name:o,columns:f,foreignTable:c[0].table,foreignColumns:c}},n&&(this._onUpdate=n.onUpdate,this._onDelete=n.onDelete)}onUpdate(t){return this._onUpdate=t,this}onDelete(t){return this._onDelete=t,this}build(t){return new Ht(t,this)}}class Ht{constructor(t,n){this.table=t,this.reference=n.reference,this.onUpdate=n._onUpdate,this.onDelete=n._onDelete}static[l]="SQLiteForeignKey";reference;onUpdate;onDelete;getName(){const{name:t,columns:n,foreignColumns:o}=this.reference(),f=n.map(g=>g.name),c=o.map(g=>g.name),S=[this.table[O],...f,o[0].table[O],...c];return t??`${S.join("_")}_fk`}}function $t(e,t){return`${e[O]}_${t.join("_")}_unique`}class C extends zt{static[l]="SQLiteColumnBuilder";foreignKeyConfigs=[];references(t,n={}){return this.foreignKeyConfigs.push({ref:t,actions:n}),this}unique(t){return this.config.isUnique=!0,this.config.uniqueName=t,this}generatedAlwaysAs(t,n){return this.config.generated={as:t,type:"always",mode:n?.mode??"virtual"},this}buildForeignKeys(t,n){return this.foreignKeyConfigs.map(({ref:o,actions:f})=>((c,S)=>{const g=new Rt(()=>{const _=c();return{columns:[t],foreignColumns:[_]}});return S.onUpdate&&g.onUpdate(S.onUpdate),S.onDelete&&g.onDelete(S.onDelete),g.build(n)})(o,f))}}class L extends xe{constructor(t,n){n.uniqueName||(n.uniqueName=$t(t,[n.name])),super(t,n),this.table=t}static[l]="SQLiteColumn"}class Vt extends C{static[l]="SQLiteBigIntBuilder";constructor(t){super(t,"bigint","SQLiteBigInt")}build(t){return new Jt(t,this.config)}}class Jt extends L{static[l]="SQLiteBigInt";getSQLType(){return"blob"}mapFromDriverValue(t){if(typeof Buffer<"u"&&Buffer.from){const n=Buffer.isBuffer(t)?t:t instanceof ArrayBuffer?Buffer.from(t):t.buffer?Buffer.from(t.buffer,t.byteOffset,t.byteLength):Buffer.from(t);return BigInt(n.toString("utf8"))}return BigInt(Ye.decode(t))}mapToDriverValue(t){return Buffer.from(t.toString())}}class Mt extends C{static[l]="SQLiteBlobJsonBuilder";constructor(t){super(t,"json","SQLiteBlobJson")}build(t){return new Gt(t,this.config)}}class Gt extends L{static[l]="SQLiteBlobJson";getSQLType(){return"blob"}mapFromDriverValue(t){if(typeof Buffer<"u"&&Buffer.from){const n=Buffer.isBuffer(t)?t:t instanceof ArrayBuffer?Buffer.from(t):t.buffer?Buffer.from(t.buffer,t.byteOffset,t.byteLength):Buffer.from(t);return JSON.parse(n.toString("utf8"))}return JSON.parse(Ye.decode(t))}mapToDriverValue(t){return Buffer.from(JSON.stringify(t))}}class Yt extends C{static[l]="SQLiteBlobBufferBuilder";constructor(t){super(t,"buffer","SQLiteBlobBuffer")}build(t){return new Zt(t,this.config)}}class Zt extends L{static[l]="SQLiteBlobBuffer";mapFromDriverValue(t){return Buffer.isBuffer(t)?t:Buffer.from(t)}getSQLType(){return"blob"}}function Xt(e,t){const{name:n,config:o}=R(e,t);return o?.mode==="json"?new Mt(n):o?.mode==="bigint"?new Vt(n):new Yt(n)}class ei extends C{static[l]="SQLiteCustomColumnBuilder";constructor(t,n,o){super(t,"custom","SQLiteCustomColumn"),this.config.fieldConfig=n,this.config.customTypeParams=o}build(t){return new ti(t,this.config)}}class ti extends L{static[l]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;constructor(t,n){super(t,n),this.sqlName=n.customTypeParams.dataType(n.fieldConfig),this.mapTo=n.customTypeParams.toDriver,this.mapFrom=n.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(t){return typeof this.mapFrom=="function"?this.mapFrom(t):t}mapToDriverValue(t){return typeof this.mapTo=="function"?this.mapTo(t):t}}function ii(e){return(t,n)=>{const{name:o,config:f}=R(t,n);return new ei(o,f,e)}}class Ne extends C{static[l]="SQLiteBaseIntegerBuilder";constructor(t,n,o){super(t,n,o),this.config.autoIncrement=!1}primaryKey(t){return t?.autoIncrement&&(this.config.autoIncrement=!0),this.config.hasDefault=!0,super.primaryKey()}}class be extends L{static[l]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return"integer"}}class si extends Ne{static[l]="SQLiteIntegerBuilder";constructor(t){super(t,"number","SQLiteInteger")}build(t){return new ni(t,this.config)}}class ni extends be{static[l]="SQLiteInteger"}class ai extends Ne{static[l]="SQLiteTimestampBuilder";constructor(t,n){super(t,"date","SQLiteTimestamp"),this.config.mode=n}defaultNow(){return this.default(T`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build(t){return new ri(t,this.config)}}class ri extends be{static[l]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue(t){return this.config.mode==="timestamp"?new Date(t*1e3):new Date(t)}mapToDriverValue(t){const n=t.getTime();return this.config.mode==="timestamp"?Math.floor(n/1e3):n}}class oi extends Ne{static[l]="SQLiteBooleanBuilder";constructor(t,n){super(t,"boolean","SQLiteBoolean"),this.config.mode=n}build(t){return new di(t,this.config)}}class di extends be{static[l]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue(t){return Number(t)===1}mapToDriverValue(t){return t?1:0}}function s(e,t){const{name:n,config:o}=R(e,t);return o?.mode==="timestamp"||o?.mode==="timestamp_ms"?new ai(n,o.mode):o?.mode==="boolean"?new oi(n,o.mode):new si(n)}class li extends C{static[l]="SQLiteNumericBuilder";constructor(t){super(t,"string","SQLiteNumeric")}build(t){return new ui(t,this.config)}}class ui extends L{static[l]="SQLiteNumeric";mapFromDriverValue(t){return typeof t=="string"?t:String(t)}getSQLType(){return"numeric"}}class ci extends C{static[l]="SQLiteNumericNumberBuilder";constructor(t){super(t,"number","SQLiteNumericNumber")}build(t){return new mi(t,this.config)}}class mi extends L{static[l]="SQLiteNumericNumber";mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}mapToDriverValue=String;getSQLType(){return"numeric"}}class pi extends C{static[l]="SQLiteNumericBigIntBuilder";constructor(t){super(t,"bigint","SQLiteNumericBigInt")}build(t){return new _i(t,this.config)}}class _i extends L{static[l]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return"numeric"}}function fi(e,t){const{name:n,config:o}=R(e,t),f=o?.mode;return f==="number"?new ci(n):f==="bigint"?new pi(n):new li(n)}class hi extends C{static[l]="SQLiteRealBuilder";constructor(t){super(t,"number","SQLiteReal")}build(t){return new yi(t,this.config)}}class yi extends L{static[l]="SQLiteReal";getSQLType(){return"real"}}function Ze(e){return new hi(e??"")}class gi extends C{static[l]="SQLiteTextBuilder";constructor(t,n){super(t,"string","SQLiteText"),this.config.enumValues=n.enum,this.config.length=n.length}build(t){return new xi(t,this.config)}}class xi extends L{static[l]="SQLiteText";enumValues=this.config.enumValues;length=this.config.length;constructor(t,n){super(t,n)}getSQLType(){return`text${this.config.length?`(${this.config.length})`:""}`}}class Ni extends C{static[l]="SQLiteTextJsonBuilder";constructor(t){super(t,"json","SQLiteTextJson")}build(t){return new bi(t,this.config)}}class bi extends L{static[l]="SQLiteTextJson";getSQLType(){return"text"}mapFromDriverValue(t){return JSON.parse(t)}mapToDriverValue(t){return JSON.stringify(t)}}function i(e,t={}){const{name:n,config:o}=R(e,t);return o.mode==="json"?new Ni(n):new gi(n,o)}function wi(){return{blob:Xt,customType:ii,integer:s,numeric:fi,real:Ze,text:i}}const fe=Symbol.for("drizzle:SQLiteInlineForeignKeys");class We extends I{static[l]="SQLiteTable";static Symbol=Object.assign({},I.Symbol,{InlineForeignKeys:fe});[I.Symbol.Columns];[fe]=[];[I.Symbol.ExtraConfigBuilder]=void 0}function Si(e,t,n,o,f=e){const c=new We(e,o,f),S=typeof t=="function"?t(wi()):t,g=Object.fromEntries(Object.entries(S).map(([v,d])=>{const p=d;p.setName(v);const y=p.build(c);return c[fe].push(...p.buildForeignKeys(y,c)),[v,y]})),_=Object.assign(c,g);return _[I.Symbol.Columns]=g,_[I.Symbol.ExtraConfigColumns]=g,n&&(_[We.Symbol.ExtraConfigBuilder]=n),_}
1const m=(e,t,n)=>Si(e,t,n);class Xe{constructor(t,n){this.name=t,this.unique=n}static[l]="SQLiteIndexBuilderOn";on(...t){return new vi(this.name,t,this.unique)}}class vi{static[l]="SQLiteIndexBuilder";config;constructor(t,n,o){this.config={name:t,columns:n,unique:o,where:void 0}}where(t){return this.config.where=t,this}build(t){return new Ii(this.config,t)}}class Ii{static[l]="SQLiteIndex";config;constructor(t,n){this.config={...t,table:n}}}function r(e){return new Xe(e,!1)}function B(e){return new Xe(e,!0)}const x=m("user",{id:i("id").primaryKey(),name:i("name").notNull(),email:i("email").notNull().unique(),emailVerified:s("email_verified",{mode:"boolean"}).default(!1).notNull(),image:i("image"),createdAt:s("created_at",{mode:"timestamp_ms"}).default(T`(cast(unixepoch('subsecond') * 1000 as integer))`).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).default(T`(cast(unixepoch('subsecond') * 1000 as integer))`).$onUpdate(()=>new Date).notNull(),role:i("role"),banned:s("banned",{mode:"boolean"}).default(!1),banReason:i("ban_reason"),banExpires:s("ban_expires",{mode:"timestamp_ms"}),normalizedEmail:i("normalized_email").unique(),customerId:i("customer_id"),registrationRegion:i("registration_region"),registrationLanguage:i("registration_language"),userSource:i("user_source"),utmSource:i("utm_source"),registrationIp:i("registration_ip")},e=>[r("user_registration_ip_created_at_idx").on(e.registrationIp,e.createdAt)]);m("session",{id:i("id").primaryKey(),expiresAt:s("expires_at",{mode:"timestamp_ms"}).notNull(),token:i("token").notNull().unique(),createdAt:s("created_at",{mode:"timestamp_ms"}).default(T`(cast(unixepoch('subsecond') * 1000 as integer))`).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).$onUpdate(()=>new Date).notNull(),ipAddress:i("ip_address"),userAgent:i("user_agent"),userId:i("user_id").notNull().references(()=>x.id,{onDelete:"cascade"}),impersonatedBy:i("impersonated_by")},e=>[r("session_userId_idx").on(e.userId)]);m("account",{id:i("id").primaryKey(),accountId:i("account_id").notNull(),providerId:i("provider_id").notNull(),userId:i("user_id").notNull().references(()=>x.id,{onDelete:"cascade"}),accessToken:i("access_token"),refreshToken:i("refresh_token"),idToken:i("id_token"),accessTokenExpiresAt:s("access_token_expires_at",{mode:"timestamp_ms"}),refreshTokenExpiresAt:s("refresh_token_expires_at",{mode:"timestamp_ms"}),scope:i("scope"),password:i("password"),createdAt:s("created_at",{mode:"timestamp_ms"}).default(T`(cast(unixepoch('subsecond') * 1000 as integer))`).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).$onUpdate(()=>new Date).notNull()},e=>[r("account_userId_idx").on(e.userId)]);m("verification",{id:i("id").primaryKey(),identifier:i("identifier").notNull(),value:i("value").notNull(),expiresAt:s("expires_at",{mode:"timestamp_ms"}).notNull(),createdAt:s("created_at",{mode:"timestamp_ms"}).default(T`(cast(unixepoch('subsecond') * 1000 as integer))`).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).default(T`(cast(unixepoch('subsecond') * 1000 as integer))`).$onUpdate(()=>new Date).notNull()},e=>[r("verification_identifier_idx").on(e.identifier)]);const ki=m("apikey",{id:i("id").primaryKey(),name:i("name"),start:i("start"),prefix:i("prefix"),key:i("key").notNull(),userId:i("user_id").notNull().references(()=>x.id,{onDelete:"cascade"}),refillInterval:s("refill_interval"),refillAmount:s("refill_amount"),lastRefillAt:s("last_refill_at",{mode:"timestamp_ms"}),enabled:s("enabled",{mode:"boolean"}).default(!0),rateLimitEnabled:s("rate_limit_enabled",{mode:"boolean"}).default(!0),rateLimitTimeWindow:s("rate_limit_time_window").default(864e5),rateLimitMax:s("rate_limit_max").default(10),requestCount:s("request_count").default(0),remaining:s("remaining"),lastRequest:s("last_request",{mode:"timestamp_ms"}),expiresAt:s("expires_at",{mode:"timestamp_ms"}),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull(),permissions:i("permissions"),metadata:i("metadata")},e=>[r("apikey_key_idx").on(e.key),r("apikey_userId_idx").on(e.userId)]);m("payment",{id:i("id").primaryKey(),priceId:i("price_id").notNull(),userId:i("user_id").notNull().references(()=>
1x.id,{onDelete:"cascade"}),customerId:i("customer_id").notNull(),subscriptionId:i("subscription_id"),sessionId:i("session_id"),invoiceId:i("invoice_id").unique(),type:i("type").notNull().$type(),scene:i("scene").$type(),interval:i("interval").$type(),status:i("status").notNull().$type(),paid:s("paid",{mode:"boolean"}).notNull().default(!1),periodStart:s("period_start",{mode:"timestamp_ms"}),periodEnd:s("period_end",{mode:"timestamp_ms"}),cancelAtPeriodEnd:s("cancel_at_period_end",{mode:"boolean"}),trialStart:s("trial_start",{mode:"timestamp_ms"}),trialEnd:s("trial_end",{mode:"timestamp_ms"}),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[r("payment_user_id_idx").on(e.userId),r("payment_customer_id_idx").on(e.customerId),r("payment_subscription_id_idx").on(e.subscriptionId),r("payment_session_id_idx").on(e.sessionId),r("payment_invoice_id_idx").on(e.invoiceId),r("payment_paid_idx").on(e.paid),r("payment_user_paid_idx").on(e.userId,e.paid)]);m("user_files",{id:i("id").primaryKey(),userId:i("user_id").notNull().references(()=>x.id,{onDelete:"cascade"}),filename:i("filename").notNull(),originalName:i("original_name").notNull(),contentType:i("content_type").notNull(),size:s("size").notNull(),r2Key:i("r2_key").notNull(),isPublic:s("is_public",{mode:"boolean"}),description:i("description"),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[r("user_files_user_id_idx").on(e.userId),r("user_files_r2_key_idx").on(e.r2Key)]);m("whois_domain_cache",{domain:i("domain").primaryKey(),existed:i("existed").notNull(),type:s("type").notNull(),parsedJson:i("parsed_json").notNull(),rawText:i("raw_text").notNull(),pricesJson:i("prices_json").notNull(),source:i("source").notNull(),checkedAt:s("checked_at",{mode:"timestamp_ms"}).notNull(),expiresAt:s("expires_at",{mode:"timestamp_ms"}).notNull()},e=>[r("whois_domain_cache_expires_at_idx").on(e.expiresAt),r("whois_domain_cache_checked_at_idx").on(e.checkedAt)]);m("domain_query_history",{id:i("id").primaryKey(),userId:i("user_id").references(()=>x.id,{onDelete:"set null"}),domain:i("domain").notNull(),queryType:i("query_type").notNull(),resultStatus:i("result_status").notNull().default("unknown"),source:i("source"),referer:i("referer"),userAgent:i("user_agent"),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull()},e=>[r("domain_query_history_user_id_idx").on(e.userId),r("domain_query_history_domain_idx").on(e.domain),r("domain_query_history_query_type_idx").on(e.queryType),r("domain_query_history_result_status_idx").on(e.resultStatus),r("domain_query_history_created_at_idx").on(e.createdAt)]);m("domain_lobster_conversations",{id:i("id").primaryKey(),sessionId:i("session_id").notNull(),clientUserId:i("client_user_id"),userId:i("user_id").references(()=>x.id,{onDelete:"set null"}),locale:i("locale").notNull().default("en"),agentId:i("agent_id"),status:i("status").notNull().$type().default("completed"),fallback:s("fallback",{mode:"boolean"}).notNull().default(!1),message:i("message").notNull(),reply:i("reply"),errorMessage:i("error_message"),domainsJson:i("domains_json").notNull().default("[]"),evidenceJson:i("evidence_json").notNull().default("{}"),durationMs:s("duration_ms"),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull()},e=>[r("domain_lobster_conversations_session_idx").on(e.sessionId),r("domain_lobster_conversations_client_user_idx").on(e.clientUserId),r("domain_lobster_conversations_user_id_idx").on(e.userId),r("domain_lobster_conversations_status_idx").on(e.status),r("domain_lobster_conversations_fallback_idx").on(e.fallback),r("domain_lobster_conversations_created_at_idx").on(e.createdAt)]);m("domain_whois_history",{id:i("id").primaryKey(),domain:i("domain").notNull(),registeredAt:i("registered_at"),expiresAt:i("expires_at"),updatedAt:i("updated_at"),registrar:i("registrar"),statusesJson:i("statuses_json").notNull().default("[]"),nameServersJson:i("name_servers_json").notNull().default("[]"),source:i("source"),observedAt:s("observed_at",{mode:"timestamp_ms"}).notNull(),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull()},e=>[r("domain_whois_history_domain_idx").on(e.domain),r("domain_whois_history_observed_at_idx").on(e.observedAt),r("domain_whois_history_domain_observed_at_idx").on(e.domain,e.observedAt)]);m("api_key_applications",{id:i("id").primaryKey(),userId:i("user_id").notNull().references(()=>
1x.id,{onDelete:"cascade"}),apiKeyId:i("api_key_id").references(()=>ki.id,{onDelete:"set null"}),status:i("status").notNull().$type().default("pending"),scope:i("scope").notNull().default("domain.query.whois"),requestedDomainLimit:s("requested_domain_limit").notNull().default(1),approvedDomainLimit:s("approved_domain_limit"),requestedDailyRequestLimit:s("requested_daily_request_limit").notNull().default(100),approvedDailyRequestLimit:s("approved_daily_request_limit"),useCase:i("use_case").notNull(),reviewNote:i("review_note"),reviewerId:i("reviewer_id").references(()=>x.id,{onDelete:"set null"}),reviewedAt:s("reviewed_at",{mode:"timestamp_ms"}),apiKeyEncrypted:i("api_key_encrypted"),apiKeyPreview:i("api_key_preview"),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[r("api_key_applications_user_id_idx").on(e.userId),r("api_key_applications_api_key_id_idx").on(e.apiKeyId),r("api_key_applications_status_idx").on(e.status),r("api_key_applications_created_at_idx").on(e.createdAt),r("api_key_applications_reviewer_id_idx").on(e.reviewerId)]);const Ai=m("domain_watches",{id:i("id").primaryKey(),userId:i("user_id").notNull().references(()=>x.id,{onDelete:"cascade"}),domain:i("domain").notNull(),enabled:s("enabled",{mode:"boolean"}).notNull().default(!0),domainExpiresAt:s("domain_expires_at",{mode:"timestamp_ms"}),lastStatus:i("last_status"),lastCheckedAt:s("last_checked_at",{mode:"timestamp_ms"}),lastCheckError:i("last_check_error"),expiryReminderSentAt:s("expiry_reminder_sent_at",{mode:"timestamp_ms"}),expiryReminderSentFor:i("expiry_reminder_sent_for"),deleteStageDetectedAt:s("delete_stage_detected_at",{mode:"timestamp_ms"}),deleteStageReminderSentAt:s("delete_stage_reminder_sent_at",{mode:"timestamp_ms"}),deleteReminderSentAt:s("delete_reminder_sent_at",{mode:"timestamp_ms"}),deleteReminderSentFor:i("delete_reminder_sent_for"),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[B("domain_watches_user_domain_idx").on(e.userId,e.domain),r("domain_watches_user_id_idx").on(e.userId),r("domain_watches_enabled_idx").on(e.enabled),r("domain_watches_domain_expires_at_idx").on(e.domainExpiresAt),r("domain_watches_last_checked_at_idx").on(e.lastCheckedAt)]),Di=m("trend_notification_groups",{id:i("id").primaryKey(),userId:i("user_id").notNull().references(()=>x.id,{onDelete:"cascade"}),name:i("name").notNull(),emailEnabled:s("email_enabled",{mode:"boolean"}
1).notNull().default(!0),recipientEmailsJson:i("recipient_emails_json").notNull().default("[]"),discordWebhookEncrypted:i("discord_webhook_encrypted"),discordWebhookPreview:i("discord_webhook_preview"),feishuWebhookEncrypted:i("feishu_webhook_encrypted"),feishuWebhookPreview:i("feishu_webhook_preview"),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[B("trend_notification_groups_user_name_idx").on(e.userId,e.name),r("trend_notification_groups_user_id_idx").on(e.userId)]),et=m("sitemap_monitors",{id:i("id").primaryKey(),userId:i("user_id").notNull().references(()=>x.id,{onDelete:"cascade"}),notificationGroupId:i("notification_group_id").references(()=>Di.id,{onDelete:"set null"}),name:i("name").notNull(),sitemapUrl:i("sitemap_url").notNull(),enabled:s("enabled",{mode:"boolean"}).notNull().default(!0),emailEnabled:s("email_enabled",{mode:"boolean"}).notNull().default(!0),recipientEmailsJson:i("recipient_emails_json").notNull().default("[]"),discordWebhookEncrypted:i("discord_webhook_encrypted"),discordWebhookPreview:i("discord_webhook_preview"),feishuWebhookEncrypted:i("feishu_webhook_encrypted"),feishuWebhookPreview:i("feishu_webhook_preview"),snapshotJson:i("snapshot_json").notNull().default("[]"),snapshotVersion:i("snapshot_version"),lastEntryCount:s("last_entry_count").notNull().default(0),lastCheckedAt:s("last_checked_at",{mode:"timestamp_ms"}),lastChangeAt:s("last_change_at",{mode:"timestamp_ms"}),lastCheckError:i("last_check_error"),lastCheckWarningsJson:i("last_check_warnings_json").notNull().default("[]"),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[B("sitemap_monitors_user_sitemap_url_idx").on(e.userId,e.sitemapUrl),r("sitemap_monitors_user_id_idx").on(e.userId),r("sitemap_monitors_notification_group_id_idx").on(e.notificationGroupId),r("sitemap_monitors_enabled_idx").on(e.enabled),r("sitemap_monitors_last_checked_at_idx").on(e.lastCheckedAt)]);m("sitemap_monitor_snapshot_chunks",{id:i("id").primaryKey(),monitorId:i("monitor_id").notNull().references(()=>et.id,{onDelete:"cascade"}),version:i("version").notNull(),chunkIndex:s("chunk_index").notNull(),snapshotJson:i("snapshot_json").notNull(),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull()},e=>[B("sitemap_snapshot_monitor_version_chunk_idx").on(e.monitorId,e.version,e.chunkIndex),r("sitemap_snapshot_monitor_id_idx").on(e.monitorId)]);m("sitemap_monitor_events",{id:i("id").primaryKey(),monitorId:i("monitor_id").notNull().references(()=>et.id,{onDelete:"cascade"}),changeType:i("change_type").notNull().$type(),url:i("url").notNull(),lastmod:i("lastmod"),pageTitle:i("page_title"),pageDescription:i("page_description"),pageHeading:i("page_heading"),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull()},e=>[r("sitemap_monitor_events_monitor_id_idx").on(e.monitorId),r("sitemap_monitor_events_created_at_idx").on(e.createdAt),r("sitemap_monitor_events_monitor_created_at_idx").on(e.monitorId,e.createdAt)]);const ji=m("github_trend_monitors",{id:i("id").primaryKey(),userId:i("user_id").notNull().references(()=>x.id,{onDelete:"cascade"}),name:i("name").notNull(),language:i("language").notNull().default(""),since:i("since").notNull().$type().default("daily"),enabled:s("enabled",{mode:"boolean"}).notNull().default(!0),emailEnabled:s("email_enabled",{mode:"boolean"}
1).notNull().default(!0),recipientEmailsJson:i("recipient_emails_json").notNull().default("[]"),discordWebhookEncrypted:i("discord_webhook_encrypted"),discordWebhookPreview:i("discord_webhook_preview"),feishuWebhookEncrypted:i("feishu_webhook_encrypted"),feishuWebhookPreview:i("feishu_webhook_preview"),snapshotJson:i("snapshot_json").notNull().default("[]"),lastRepoCount:s("last_repo_count").notNull().default(0),lastCheckedAt:s("last_checked_at",{mode:"timestamp_ms"}),lastChangeAt:s("last_change_at",{mode:"timestamp_ms"}),lastCheckError:i("last_check_error"),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[B("github_trend_monitors_user_filter_idx").on(e.userId,e.language,e.since),r("github_trend_monitors_user_id_idx").on(e.userId),r("github_trend_monitors_enabled_idx").on(e.enabled),r("github_trend_monitors_last_checked_at_idx").on(e.lastCheckedAt)]);m("github_trend_events",{id:i("id").primaryKey(),monitorId:i("monitor_id").notNull().references(()=>ji.id,{onDelete:"cascade"}),changeType:i("change_type").notNull().$type(),repository:i("repository").notNull(),repositoryUrl:i("repository_url").notNull(),description:i("description"),language:i("language"),stars:s("stars").notNull().default(0),starsSince:s("stars_since").notNull().default(0),previousRank:s("previous_rank"),currentRank:s("current_rank"),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull()},e=>[r("github_trend_events_monitor_id_idx").on(e.monitorId),r("github_trend_events_created_at_idx").on(e.createdAt),r("github_trend_events_monitor_created_at_idx").on(e.monitorId,e.createdAt)]);m("revenue_rankings",{id:i("id").primaryKey(),source:i("source").notNull().$type(),rankingDate:i("ranking_date").notNull(),startupName:i("startup_name").notNull(),startupSlug:i("startup_slug").notNull(),iconUrl:i("icon_url"),description:i("description"),websiteUrl:i("website_url"),category:i("category"),paymentProvider:i("payment_provider").notNull(),revenueRank:s("revenue_rank"),mrrCents:s("mrr_cents").notNull(),revenueLast30DaysCents:s("revenue_last_30_days_cents").notNull(),growthMrr30d:Ze("growth_mrr_30d"),articleSlug:i("article_slug"),analysisJson:i("analysis_json"),analysisStatus:i("analysis_status").notNull().$type().default("pending"),analysisError:i("analysis_error"),analyzedAt:s("analyzed_at",{mode:"timestamp_ms"}),agentId:i("agent_id"),recordedAt:s("recorded_at",{mode:"timestamp_ms"}).notNull(),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull()},e=>[B("revenue_rankings_source_date_idx").on(e.source,e.rankingDate),r("revenue_rankings_date_idx").on(e.rankingDate),B("revenue_rankings_article_slug_idx").on(e.articleSlug),r("revenue_rankings_source_rank_idx").on(e.source,e.revenueRank)]);m("revenue_ranking_subscriptions",{id:i("id").primaryKey(),userId:i("user_id").notNull().references(()=>x.id,{onDelete:"cascade"}),locale:i("locale").notNull().$type().default("en"),enabled:s("enabled",{mode:"boolean"}).notNull().default(!0),lastSentRankingDate:i("last_sent_ranking_date"),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[B("revenue_ranking_subscriptions_user_id_idx").on(e.userId),r("revenue_ranking_subscriptions_enabled_idx").on(e.enabled)]);m("domain_sweep_dictionaries",{id:i("id").primaryKey(),userId:i("user_id").notNull().references(()=>x.id,{onDelete:"cascade"}),name:i("name").notNull(),groupName:i("group_name").notNull(),entriesJson:i("entries_json").notNull(),entryCount:s("entry_count").notNull().default(0),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[r("domain_sweep_dictionaries_user_id_idx").on(e.userId),r("domain_sweep_dictionaries_group_name_idx").on(e.groupName),r("domain_sweep_dictionaries_updated_at_idx").on(e.updatedAt)]);m("domain_analysis_cache",{domain:i("domain").primaryKey(),domainRating:s("domain_rating"),ahrefsRank:s("ahrefs_rank"),backlinks:s("backlinks"),refDomains:s("ref_domains"),siteName:i("site_name"),description:i("description"),globalRank:s("global_rank"),countryRank:s("country_rank"),countryCode:i("country_code"),monthlyVisits:s("monthly_visits"),bounceRate:i("bounce_rate"),pagePerVisit:i("page_per_visit"),timeOnSite:i("time_on_site"),trafficSourcesJson:i("traffic_sources_json"),estimatedMonthlyVisitsJson:i("estimated_monthly_visits_json"),topKeywordsJson:i("top_keywords_json"),topCountrySharesJson:i("top_country_shares_json"),lastUpdatedAt:s("last_updated_at",{mode:"timestamp_ms"}).notNull(),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull()},e=>[r("domain_analysis_cache_updated_idx").on(e.lastUpdatedAt)]);m("domain_analysis_history",{id:i("id").primaryKey(),domain:i("domain").notNull(),domainRating:s("domain_rating"),ahrefsRank:s("ahrefs_rank"),backlinks:s("backlinks"),refDomains:s("ref_domains"),globalRank:s("global_rank"),countryRank:s("country_rank"),monthlyVisits:s("monthly_visits"),bounceRate:i("bounce_rate"),pagePerVisit:i("page_per_visit"),timeOnSite:i("time_on_site"),trafficSourcesJson:i("traffic_sources_json"),recordedAt:s("recorded_at",{mode:"timestamp_ms"}).notNull()},e=>[r("domain_analysis_history_domain_idx").on(e.domain),r("domain_analysis_history_recorded_idx").on(e.recordedAt),r("domain_analysis_history_domain_recorded_idx").on(e.domain,e.recordedAt)]);m("domain_business_analyses",{domain:i("domain").primaryKey(),analysisJson:i("analysis_json"),analysisStatus:i("analysis_status").notNull().$type().default("processing"),analysisError:i("analysis_error"),agentId:i("agent_id"),requestedByUserId:i("requested_by_user_id").references(()=>x.id,{onDelete:"set null"}),analyzedAt:s("analyzed_at",{mode:"timestamp_ms"}),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[r("domain_business_analyses_status_idx").on(e.analysisStatus),r("domain_business_analyses_analyzed_at_idx").on(e.analyzedAt),r("domain_business_analyses_requested_by_idx").on(e.requestedByUserId)]);m("domain_web_archive_cache",{domain:i("domain").primaryKey(),yearsJson:i("years_json").notNull(),firstTs:i("first_ts").notNull(),lastTs:i("last_ts").notNull(),statusJson:i("status_json").notNull(),lastUpdatedAt:s("last_updated_at",{mode:"timestamp_ms"}).notNull(),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull()},e=>[r("domain_web_archive_cache_updated_idx").on(e.lastUpdatedAt)]);m("spaceship_credentials",{userId:i("user_id").primaryKey().references(()=>
1x.id,{onDelete:"cascade"}),apiKeyEncrypted:i("api_key_encrypted").notNull(),apiSecretEncrypted:i("api_secret_encrypted").notNull(),apiKeyPreview:i("api_key_preview").notNull(),apiSecretPreview:i("api_secret_preview").notNull(),defaultContactId:i("default_contact_id").notNull(),contactAttributeIds:i("contact_attribute_ids"),autoRenew:s("auto_renew",{mode:"boolean"}).notNull().default(!1),privacyLevel:i("privacy_level").notNull().default("high"),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[r("spaceship_credentials_updated_at_idx").on(e.updatedAt)]);m("domain_purchases",{id:i("id").primaryKey(),userId:i("user_id").notNull().references(()=>x.id,{onDelete:"cascade"}),domain:i("domain").notNull(),registrar:i("registrar").notNull(),status:i("status").notNull(),years:s("years").notNull(),autoRenew:s("auto_renew",{mode:"boolean"}).notNull(),privacyLevel:i("privacy_level").notNull(),operationId:i("operation_id"),httpStatus:s("http_status"),errorMessage:i("error_message"),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[r("domain_purchases_user_id_idx").on(e.userId),r("domain_purchases_domain_idx").on(e.domain),r("domain_purchases_status_idx").on(e.status),r("domain_purchases_operation_id_idx").on(e.operationId),r("domain_purchases_created_at_idx").on(e.createdAt)]);m("user_credits",{userId:i("user_id").primaryKey().references(()=>x.id,{onDelete:"cascade"}),balance:s("balance").notNull().default(0),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[r("user_credits_balance_idx").on(e.balance)]);m("announcement",{id:i("id").primaryKey(),titleEn:i("title_en").notNull(),titleZh:i("title_zh").notNull(),contentEn:i("content_en").notNull(),contentZh:i("content_zh").notNull(),type:i("type").notNull().$type(),linkUrl:i("link_url"),linkTextEn:i("link_text_en"),linkTextZh:i("link_text_zh"),startAt:s("start_at",{mode:"timestamp_ms"}).notNull(),endAt:s("end_at",{mode:"timestamp_ms"}).notNull(),enabled:s("enabled",{mode:"boolean"}).notNull().default(!0),guestOnly:s("guest_only",{mode:"boolean"}).notNull().default(!1),priority:s("priority").notNull().default(0),createdBy:i("created_by").notNull().references(()=>x.id),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[r("announcement_type_idx").on(e.type),r("announcement_enabled_idx").on(e.enabled),r("announcement_start_at_idx").on(e.startAt),r("announcement_end_at_idx").on(e.endAt),r("announcement_priority_idx").on(e.priority),r("announcement_created_by_idx").on(e.createdBy)]);m("credit_transactions",{id:i("id").primaryKey(),userId:i("user_id").notNull().references(()=>x.id,{onDelete:"cascade"}),generationId:i("generation_id"),amount:s("amount").notNull(),type:i("type").notNull(),description:i("description").notNull(),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull()},e=>[r("credit_transactions_user_id_idx").on(e.userId),r("credit_transactions_generation_id_idx").on(e.generationId),r("credit_transactions_created_at_idx").on(e.createdAt)]);m("domain_catch_tasks",{id:i("id").primaryKey(),watchId:i("watch_id").notNull().references(()=>Ai.id,{onDelete:"cascade"}),userId:i("user_id").notNull().references(()=>x.id,{onDelete:"cascade"}),domain:i("domain").notNull(),status:i("status").notNull().default("monitoring"),maxPriceCents:s("max_price_cents").notNull(),deadline:s("deadline",{mode:"timestamp_ms"}).notNull(),consentAt:s("consent_at",{mode:"timestamp_ms"}).notNull(),nextCheckAt:s("next_check_at",{mode:"timestamp_ms"}).notNull(),lastCheckedAt:s("last_checked_at",{mode:"timestamp_ms"}),lastResult:i("last_result"),leaseToken:i("lease_token"),leaseUntil:s("lease_until",{mode:"timestamp_ms"}),createdAt:s("created_at",{mode:"timestamp_ms"}).notNull(),updatedAt:s("updated_at",{mode:"timestamp_ms"}).notNull()},e=>[B("domain_catch_watch_idx").on(e.watchId),r("domain_catch_due_idx").on(e.status,e.nextCheckAt),r("domain_catch_user_idx").on(e.userId)]);m("keyword_rate_limits",{key:i("key").primaryKey(),count:s("count").notNull().default(0),expiresAt:s("expires_at").notNull()},e=>[r("keyword_rate_limits_expiry").on(e.expiresAt)]);m("keyword_cache",{key:i("key").primaryKey(),payload:i("payload").notNull(),expiresAt:s("expires_at").notNull()},e=>[r("keyword_cache_expiry").on(e.expiresAt)]);const Ci=Y({method:"GET"}).middleware([Z]).handler(X("76f01d73ad8df0b1e76928aafd0ea236b41163ee06fa5e737fa0b1e3170c7f85")),Li=Y({method:"POST"}).middleware([Z]).handler(X("45eb8fe30d134ea2e77ea4ba95c1edfa057daf725e97249db1876b229401b17e")),Qi=Y({method:"POST"}).middleware([Z]).handler(X("ef6d00576bb97b332a0c511d551606b967ef1320f5d13c14c01c24a6cb102648")),Ti=Y({method:"POST"}).middleware([Z]).handler(X("77616c9f4badad690de10f706520d78aae233f775c67ae8c7cf4590bf2067300")),H={all:["domain-sweep-dictionaries"],list:()=>[...H.all,"list"]};function Bi(e=!0){return At({queryKey:H.list(),queryFn:()=>Ci(),enabled:e})}function qi(){const e=ye();return ge({mutationFn:t=>Li({data:t}),onSuccess:()=>
1{e.invalidateQueries({queryKey:H.all})}})}function zi(){const e=ye();return ge({mutationFn:t=>Qi({data:t}),onSuccess:()=>{e.invalidateQueries({queryKey:H.all})}})}function Ei(){const e=ye();return ge({mutationFn:t=>Ti({data:{id:t}}),onSuccess:()=>{e.invalidateQueries({queryKey:H.all})}})}const Pi=`.com
2.ai
3.io
4.app`,Oi=["pinyin-common"],Ue={en:{hero:{eyebrow:"Domain sweep",title:"Domain sweep from keywords",description:"Paste keywords for a direct domain sweep, or combine prefixes with built-in and saved dictionaries. Then send the clean candidate list into bulk WHOIS for verification.",chips:["Keyword list","Dictionary","Bulk WHOIS"]},stats:{dictionaries:"Dictionaries",entries:"Entries",keywords:"Keywords",suffixes:"Suffixes",generated:"Generated"},dictionary:{title:"Dictionaries",builtIn:"Built-in",cloud:"Cloud",cloudEmpty:"No cloud dictionaries yet.",cloudLoading:"Loading cloud dictionaries",newAction:"New dictionary",editAction:"Edit",deleteAction:"Delete",selected:"selected",entries:"entries",loginRequired:"Log in to save custom dictionaries.",deleteSuccess:"Dictionary deleted."},form:{keywords:"Keywords",keywordsPlaceholder:`lunni
5lutta
6nitta`,prefixes:"Optional prefixes",prefixesPlaceholder:`ai
7get
8super`,suffixes:"Domain suffixes",suffixesPlaceholder:`.com
9.ai
10.co.uk`,generate:"Generate sweep",generating:"Generating",clear:"Clear result",copy:"Copy",copied:"Copied domains.",copyFailed:"Copy failed.",joinBulk:"Add to bulk WHOIS",sent:"Candidates added to bulk WHOIS.",emptyPrefixHint:"Leave prefixes empty to scan dictionary words directly.",directKeywordHint:"No dictionary selected. Each line becomes a complete domain label."},errors:{noDictionaryOrKeywords:"Add at least one keyword or select a dictionary.",noEntries:"The selected dictionaries have no valid entries.",noSuffixes:"Add at least one valid suffix.",noGenerated:"Generate candidates before sending them to bulk WHOIS.",noValidDictionaryEntries:"Add at least one valid dictionary entry.",saveFailed:"Could not save this dictionary."},result:{title:"Candidate list",emptyTitle:"No generated candidates yet",emptyDescription:"Pick a dictionary, adjust suffixes, then generate a candidate list.",emptyDirectDescription:"Add keywords and suffixes, then generate a candidate list.",truncated:e=>`Limited to ${me} candidates from ${e} possible combinations.`,ready:e=>`${e} candidates are ready for bulk WHOIS.`},dialog:{createTitle:"New sweep dictionary",editTitle:"Edit sweep dictionary",description:"Use one entry per line. Entries are normalized to domain-safe labels.",name:"Dictionary name",group:"Group",entries:"Dictionary entries",entriesPlaceholder:`agent
11maker
12flow`,cancel:"Cancel",save:"Save dictionary",saving:"Saving"},seo:{workflow:{eyebrow:"Sweep workflow",title:"A domain sweep tool for fast naming passes",paragraphs:["Domain sweep research starts before WHOIS. A founder often has a prefix, a word pattern, or a small dictionary of pinyin, number, and product terms. QName AI turns those raw pieces into normalized domain candidates so a domain sweep can stay precise instead of becoming a messy spreadsheet.","The sweep page keeps dictionary selection, prefix input, suffix input, and generated candidates in one focused surface. Built-in dictionaries cover common number, letter, pinyin, and startup-word patterns. Cloud dictionaries let logged-in users preserve their own naming vocabulary for repeat domain sweep sessions.","After generation, the candidate list moves into bulk WHOIS without running a query automatically. That pause matters because a domain sweep can create hundreds of options. Users can review the generated domains, trim the list, then run bulk WHOIS only when the candidate set is intentional."]},direct:{title:"Direct keyword domain sweep, without a saved dictionary",paragraphs:["A direct domain sweep is the fastest path when every line is already a complete brand word. Deselect every dictionary, paste one keyword per line, and keep .ai as the only suffix. In this domain sweep mode, lunni becomes lunni.ai; QName AI does not append a dictionary word or run WHOIS automatically.","Each domain sweep applies the same normalization before generation. QName AI lowercases labels, removes duplicates, strips unsupported characters, trims edge hyphens, and ignores empty input. Commas and semicolons also separate keywords, so a copied spreadsheet row can become a clean domain sweep without manual reformatting. The keyword counter makes a predictable domain sweep easier to audit against the final candidate count.","Select a dictionary only when the domain sweep should combine parts, such as get + maker + .ai. Leave dictionaries unselected when words such as lunni, lutta, or nitta are already final. The direct domain sweep and combinatorial domain sweep share the same 1000-candidate limit and the same review step before bulk WHOIS."]},method:{title:"How QName AI keeps a domain sweep clean",paragraphs:["A useful domain sweep tool is not just a Cartesian product of every possible str
12ing. QName AI normalizes each prefix and dictionary entry into a domain-safe label, removes duplicate labels, lowercases the list, and trims edge hyphens before any suffix is attached. That keeps the generated domains readable and reduces noisy failures later in bulk WHOIS.","The order of the output is predictable: prefixes first, dictionary words second, suffixes third. If the prefix box is empty, QName AI uses an empty prefix and scans the dictionary words directly. If the suffix box contains .com, ai, and co.uk, those suffixes are normalized into the same sweep run, so a team can compare common startup endings and regional endings together.","The 1000-domain handoff limit mirrors the bulk WHOIS checker. It gives a generous batch for a naming session while still keeping the browser responsive. When a domain sweep creates more than 1000 combinations, QName AI shows the original combination count and sends only the first 1000 candidates forward for review."]},useCases:{title:"When a domain sweep is useful",items:["Run a direct domain sweep across short pinyin, initials, and number patterns before registering Chinese-friendly brand names.","Use a combinatorial domain sweep to attach product prefixes such as ai, get, or try to a private dictionary of category words.","Compare .com, .ai, .io, .app, and regional suffixes before moving into bulk WHOIS evidence."]},checklist:{title:"After the domain sweep, before bulk WHOIS",items:["Keep one idea per line in a direct domain sweep or custom dictionary so the output remains easy to audit.","Start with a narrow domain sweep dictionary, then add broader dictionaries only when the first pass feels too small.","Use multi-part suffixes such as co.uk when the product needs a country or market-specific entrance.","Review the handed-off list on the bulk WHOIS page before spending lookup quota or team attention."]},faq:{title:"Domain Sweep FAQ",items:[{q:"Does a domain sweep check availability?",a:"No. The sweep tool generates clean candidates. Availability is checked after the list is handed to the bulk WHOIS page."},{q:"Why does QName AI limit sweep output to 1000 domains?",a:"The limit matches the bulk WHOIS workspace, keeps browser performance predictable, and prevents accidental oversized lookup batches."},{q:"Can I save my own sweep dictionary?",a:"Yes. Logged-in users can save cloud dictionaries that sync with their QName AI account and reuse them later."},{q:"Can suffixes include multi-part TLDs?",a:"Yes. Inputs such as .com, ai, and co.uk are normalized before candidates are generated."},{q:"Can I run a domain sweep without a saved dictionary?",a:"Yes. Deselect every dictionary and paste complete keywords into the Keywords field. A direct domain sweep attaches each suffix to each cleaned keyword without adding another word. You can generate and review the candidate list without logging in or saving a cloud dictionary, then move it to bulk WHOIS when the list is ready."}]}}},zh:{hero:{eyebrow:"扫米工具",title:"用关键词直接扫米",description:"直接粘贴关键词扫米,也可以把前缀、字典词和后缀组合成候选,再带入批量 WHOIS 验证注册状态。",chips:["关键词","字典","批量 WHOIS"]},stats:{dictionaries:"字典",entries:"词条",keywords:"关键词",suffixes:"后缀",generated:"候选"},dictionary:{title:"扫米字典",builtIn:"内置",cloud:"云端",cloudEmpty:"还没有云端字典。",cloudLoading:"正在加载云端字典",newAction:"新增字典",editAction:"编辑",deleteAction:"删除",selected:"已选",entries:"词条",loginRequired:"登录后才能保存自定义字典。",deleteSuccess:"字典已删除。"},form:{keywords:"关键词",keywordsPlaceholder:`lunni
13lutta
14nitta`,prefixes:"可选前缀",prefixesPlaceholder:`ai
15get
16super`,suffixes:"域名后缀",suffixesPlaceholder:`.com
17.ai
18.co.uk`,generate:"开始扫米",generating:"正在生成",clear:"清空结果",copy:"复制",copied:"域名已复制。",copyFailed:"复制失败。",joinBulk:"加入批量 WHOIS",sent:"候选域名已带入批量 WHOIS。",emptyPrefixHint:"前缀留空时,会直接用字典词生成域名。",directKeywordHint:"未选择字典时,每一行都会直接作为完整域名主体。"},errors:{noDictionaryOrKeywords:"请添加至少一个关键词,或选择一个字典。",noEntries:"已选字典没有有效词条。",noSuffixes:"请至少添加一个有效后缀。",noGenerated:"请先生成候选域名,再加入批量 WHOIS。",noValidDictionaryEntries:"请至少添加一个有效字典词条。",saveFailed:"无法保存这个字典。"},result:{title:"候选列表",emptyTitle:"还没有生成候选",emptyDescription:"选择字典、调整后缀后,即可开始扫米。",emptyDirectDescription:"添加关键词和后缀后,即可开始扫米。",truncated:e=>`已从 ${e} 个可能组合中截取前 ${me} 个候选。`,ready:e=>`${e} 个候选可加入批量 WHOIS。`},dialog:{createTitle:"新增扫米字典",editTitle:"编辑扫米字典",description:"每行一个词条。保存前会自动清洗为域名安全标签。",name:"字典名称",group:"分组",entries:"字典内容",entriesPlaceholder:`agent
19maker
20flow`,cancel:"取消",save:"保存字典",saving:"保存中"},seo:{workflow:{eyebrow:"扫米工作流",title:"为快速命名准备的扫米工具",paragraphs:["扫米通常发生在 WHOIS 查询之前。创始人手里可能有一个前缀、一组拼音规律、数字偏好,或者从产品语境里沉淀下来的私有词库。QName AI 会先把这些片段清洗成合法域名标签,让扫米结果保持干净,而不是变成难以复核的表格。","扫米页面把字典选择、前缀输入、后缀输入和候选列表放在同一个工作台里。内置字典覆盖数字、字母、拼音声母、常见单拼和创业英文词;登录用户可以保存云端字典,把自己的命名语料留给之后的扫米会话继续使用。","生成候选后,QName AI 只把列表带入批量 WHOIS 页面,不会自动开始查询。这个确认步骤很重要,因为一次扫米可能生成数百个域名。用户可以先复核候选、删除不需要的行,再决定什么时候运行批量 WHOIS。"]},direct:{title:"不用保存字典,直接粘贴关键词扫米",paragraphs:["当每一行本身就是完整品牌词时,直接关键词模式最快。取消所有字典选择,每行粘贴一个关键词,并把后缀只保留为 .ai。在这种扫米模式下,lunni 会生成 lunni.ai,不会再附加字典词,也不会自动触发 WHOIS 查询。","每次扫米都会沿用相同清洗规则:统一小写、去重、移除不支持的字符、修剪首尾连字符,并忽略空行。逗号、分号也可以分隔关键词,因此从表格复制过来的内容不必逐行重排。页面上的关键词计数能帮助你核对有效输入和最终候选数量是否一致。","只有需要组合片段时才选择字典,例如 get + maker + .ai;lunni、lutta、nitta 已经是完整词时则保持字典未选。直接关键词扫米和字典组合扫米共用 1000 个候选上限,也都会在进入批量 WHOIS 前保留人工复核步骤。"]},method:{title:"QName AI 如何让扫米结果可复核",paragraphs:["有效的扫米工具不是把所有字符随意相乘。QName AI 会先把前缀和字典词清洗成域名 label 可接受的格式,统一转小写、去掉重复词条,并移除首尾连字符,然后再拼接后缀。这样生成出来的域名更容易阅读,也能减少进入批量 WHOIS 后才发现格式无效的噪音。","扫米结果的顺序是稳定的:先按前缀顺序,再按字典顺序,最后按后缀顺序。如果前缀输入为空,QName AI 会用空前缀直接扫描字典词;如果后缀里同时写了 .com、ai、co.uk,这些后缀会在同一次扫米里被规范化,方便比较创业常用后缀和地区后缀。","1000 个候选的带入上限和批量 WHOIS 工作台一致。这个数量足够覆盖一次命名会话,同时能保持浏览器响应稳定。当扫米组合超过上限时,页面会显示原始组合数,并只把前 1000 个候选送到批量 WHOIS 页面等待确认。"]},useCases:{title:"什么时候适合扫米",items:["注册中文友好品牌名前,直接扫一批短拼、声母和数字关键词。","需要组合时,把 ai、get、try 等产品前缀接到自己的行业词库上,快速形成候选。","在进入批量 WHOIS 前,先比较 .com、.ai、.io、.app 和地区后缀的组合空间。"]},checklist:{title:"扫米后进入批量 WHOIS 前",items:["直接粘贴关键词或编辑自定义字典时,都保持一行一个想法,后续复核会更轻松。","先用更窄的扫米字典扫一轮,如果候选太少,再叠加更宽的数字、字母或英文词库。","需要面向国家或地区入口时,可以把 co.uk 这类多级后缀直接放进同一次扫米。","带入批量 WHOIS 后先确认列表,再消耗查询配额和团队注意力。"]},faq:{title:"扫米 FAQ",items:[{q:"扫米会直接检查域名是否可注册吗?",a:"不会。扫米工具只负责生成干净候选。真正的可用性验证会在候选带入批量 WHOIS 页面后进行。"},{q:"为什么扫米结果最多 1000 个?",a:"这个限制和批é‡
20 WHOIS 工作台保持一致,可以保证浏览器性能稳定,也避免误触超大批量查询。"},{q:"可以保存自己的扫米字典吗?",a:"可以。登录用户可以保存云端字典,之后在 QName AI 账号下继续复用。"},{q:"后缀可以填写多级后缀吗?",a:"可以。.com、ai、co.uk 这类输入都会在生成候选前统一清洗。"},{q:"不保存字典也能直接扫一批关键词吗?",a:"可以。取消所有字典选择,把完整关键词粘贴到“关键词”输入框即可。直接关键词模式会先清洗每个词,再分别附加后缀,不会额外拼接字典词。无需登录或保存云端字典,也能先生成并复核候选,再把确认后的列表带入批量 WHOIS。"}]}}}};function Ki(){return $e(typeof window<"u"?window.location.pathname:void 0).toLowerCase().startsWith("zh")?Ue.zh:Ue.en}function he(){return $e(typeof window<"u"?window.location.pathname:void 0).toLowerCase().startsWith("zh")}function Fi(){const e=he();return gt.map(t=>({id:t.id,source:"builtin",name:e?t.nameZh:t.name,groupName:e?t.groupNameZh:t.groupName,description:e?t.descriptionZh:t.description,entries:t.entries}))}function Wi(e){return{id:e.id,source:"cloud",name:e.name,groupName:e.groupName,description:`${e.entryCount} entries`,entries:e.entries}}function Ui(e){return e.reduce((t,n)=>t+n.entries.length,0)}async function Ri(e){if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}function Hi({copy:e}){return a.jsxs("div",{className:"space-y-14 pt-16",children:[a.jsxs("section",{className:"grid gap-7 lg:grid-cols-[0.78fr_1.22fr]",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-sm font-medium text-primary",children:e.seo.workflow.eyebrow}),a.jsx("h2",{className:"text-3xl font-semibold tracking-normal sm:text-4xl",children:e.seo.workflow.title})]}),a.jsx("div",{className:"grid gap-4",children:e.seo.workflow.paragraphs.map(t=>a.jsx("p",{className:"text-base leading-8 text-muted-foreground",children:t},t))})]}),a.jsxs("section",{className:"grid gap-4 md:grid-cols-[0.7fr_1.3fr]",children:[a.jsx("h2",{className:"text-2xl font-semibold tracking-normal",children:e.seo.useCases.title}),a.jsx("div",{className:"grid gap-3",children:e.seo.useCases.items.map(t=>a.jsxs("div",{className:"apple-panel-muted flex items-start gap-3 p-4",children:[a.jsx(He,{className:"mt-1 size-4 shrink-0 text-primary"}),a.jsx("p",{className:"leading-7 text-muted-foreground",children:t})]},t))})]}),a.jsxs("section",{className:"grid gap-7 lg:grid-cols-[0.8fr_1.2fr]",children:[a.jsx("h2",{className:"text-2xl font-semibold tracking-normal",children:e.seo.direct.title}),a.jsx("div",{className:"grid gap-4",children:e.seo.direct.paragraphs.map(t=>a.jsx("p",{className:"text-base leading-8 text-muted-foreground",children:t},t))})]}),a.jsxs("section",{className:"grid gap-7 lg:grid-cols-[0.8fr_1.2fr]",children:[a.jsx("h2",{className:"text-2xl font-semibold tracking-normal",children:e.seo.method.title}),a.jsx("div",{className:"grid gap-4",children:e.seo.method.paragraphs.map(t=>a.jsx("p",{className:"text-base leading-8 text-muted-foreground",children:t},t))})]}),a.jsxs("section",{className:"grid gap-4 md:grid-cols-[0.7fr_1.3fr]",children:[a.jsx("h2",{className:"text-2xl font-semibold tracking-normal",children:e.seo.checklist.title}),a.jsx("div",{className:"grid gap-3",children:e.seo.checklist.items.map((t,n)=>a.jsxs("div",{className:"apple-panel-muted flex items-start gap-3 p-4",children:[a.jsx("span",{className:"mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-sm font-semibold text-primary",children:n+1}),a.jsx("p",{className:"leading-7 text-muted-foreground",children:t})]},t))})]}),a.jsxs("section",{className:"space-y-4",children:[a.jsx("h2",{className:"text-2xl font-semibold tracking-normal",children:e.seo.faq.title}),a.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:e.seo.faq.items.map(t=>a.jsxs("details",{className:"apple-panel p-4",children:[a.jsx("summary",{className:"cursor-pointer list-none font-semibold",children:t.q}),a.jsx("p",{className:"mt-3 leading-7 text-muted-foreground",children:t.a})]},t.q))})]})]})}function $i(){const e=Ki(),{data:t,isPending:n}=pt.useSession(),[o,f]=b.useState(!1),c=!!t?.user,S=b.useMemo(()=>
20Fi(),[]),g=Bi(o&&c),_=qi(),v=zi(),d=Ei(),p=b.useMemo(()=>g.data?.items.map(Wi)??[],[g.data?.items]),y=b.useMemo(()=>[...S,...p],[S,p]),[K,$]=b.useState(Oi),[ee,we]=b.useState(""),[te,tt]=b.useState(Pi),[k,Se]=b.useState(null),[ve,z]=b.useState(""),[it,F]=b.useState(!1),[ie,Ie]=b.useState(null),[ke,se]=b.useState(""),[Ae,ne]=b.useState(""),[De,ae]=b.useState(""),[je,W]=b.useState("");b.useEffect(()=>{f(!0);const u=new URLSearchParams(window.location.search).get("keywords");u&&(we(u.slice(0,810)),$([]))},[]);const D=b.useMemo(()=>y.filter(u=>K.includes(u.id)),[y,K]),Ce=b.useMemo(()=>D.flatMap(u=>u.entries),[D]),re=b.useMemo(()=>yt(te),[te]),V=b.useMemo(()=>Te(ee),[ee]),st=u=>{$(N=>N.includes(u)?N.filter(h=>h!==u):[...N,u])},nt=()=>{const u=!D.length;if(u&&!V.length){z(e.errors.noDictionaryOrKeywords);return}if(!u&&!Ce.length){z(e.errors.noEntries);return}if(!re.length){z(e.errors.noSuffixes);return}z(""),Se(xt({dictionaryEntries:u?V:Ce,prefixes:u?[]:V,suffixes:re}))},at=async()=>{if(!k?.domains.length){z(e.errors.noGenerated);return}try{await Ri(k.domains.join(`
21`)),P.success(e.form.copied)}catch{P.error(e.form.copyFailed)}},rt=()=>{if(!k?.domains.length){z(e.errors.noGenerated);return}window.sessionStorage.setItem(Nt,JSON.stringify({createdAt:Date.now(),domains:k.domains,source:"domain-sweep"})),P.success(e.form.sent),window.location.assign(`${ft(ht.BulkWhois)}?source=sweep`)},ot=()=>{if(!c){P.error(e.dictionary.loginRequired);return}Ie(null),se(""),ne(he()?"自定义":"Custom"),ae(""),W(""),F(!0)},dt=u=>{const N=g.data?.items.find(h=>h.id===u);N&&(Ie(N),se(N.name),ne(N.groupName),ae(N.entries.join(`
22`)),W(""),F(!0))},lt=async()=>{if(!c){P.error(e.dictionary.loginRequired);return}const u=Te(De);if(!u.length){W(e.errors.noValidDictionaryEntries);return}const N={entries:u,groupName:Ae.trim()||(he()?"自定义":"Custom"),name:ke.trim()};if(!N.name){W(e.dialog.name);return}try{const q=(ie?await v.mutateAsync({...N,id:ie.id}):await _.mutateAsync(N)).item?.id;q&&$(E=>E.includes(q)?E:[...E,q]),F(!1)}catch{W(e.errors.saveFailed)}},ut=async u=>{await d.mutateAsync(u),$(N=>N.filter(h=>h!==u)),P.success(e.dictionary.deleteSuccess)},ct=b.useMemo(()=>{const u=new Map;for(const N of y){const h=u.get(N.groupName)??[];h.push(N),u.set(N.groupName,h)}return[...u.entries()]},[y]),mt=[{label:e.stats.dictionaries,value:D.length},{label:D.length?e.stats.entries:e.stats.keywords,value:D.length?Ui(D):V.length},{label:e.stats.suffixes,value:re.length},{label:e.stats.generated,value:k?.domains.length??0}];return a.jsxs("div",{className:"mx-auto w-full max-w-7xl px-4 pb-24 pt-8 md:px-6",children:[a.jsxs("section",{className:"grid gap-6 lg:grid-cols-[minmax(0,1fr)_320px] lg:items-end",children:[a.jsxs("header",{className:"max-w-4xl space-y-5",children:[a.jsx("div",{className:"flex flex-wrap gap-2",children:e.hero.chips.map(u=>a.jsx("span",{className:"apple-chip px-2.5 py-1 text-xs font-medium text-muted-foreground",children:u},u))}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm font-medium text-primary",children:e.hero.eyebrow}),a.jsx("h1",{className:"max-w-4xl text-balance text-4xl font-semibold leading-tight tracking-normal sm:text-5xl lg:text-6xl",children:e.hero.title}),a.jsx("p",{className:"max-w-3xl text-base leading-7 text-muted-foreground sm:text-lg",children:e.hero.description})]})]}),a.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4 lg:grid-cols-2",children:mt.map(u=>a.jsxs("div",{className:"apple-panel-muted px-3 py-2",children:[a.jsx("span",{className:"block text-xs text-muted-foreground",children:u.label}),a.jsx("span",{className:"mt-1 block text-xl font-semibold",children:u.value})]},u.label))})]}),a.jsxs("section",{className:"mt-8 grid gap-5 lg:grid-cols-[300px_minmax(0,1fr)_360px]",children:[a.jsxs("aside",{className:"apple-panel h-fit p-4 lg:sticky lg:top-24",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold",children:e.dictionary.title}),a.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[D.length," ",e.dictionary.selected]})]}),a.jsx(Q,{"aria-label":e.dictionary.newAction,onClick:ot,size:"icon-sm",type:"button",variant:"outline",children:a.jsx(Dt,{className:"size-4"})})]}),a.jsxs("div",{className:"mt-4 space-y-5",children:[ct.map(([u,N])=>a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-normal text-muted-foreground",children:u}),a.jsx("div",{className:"space-y-1.5",children:N.map(h=>{const q=K.includes(h.id);return a.jsxs("div",{className:Le("flex min-h-10 w-full items-center gap-1 rounded-md border px-1.5 py-1 transition",q?"border-primary/45 bg-primary/10":"border-border/70 bg-background/70 hover:border-primary/30"),title:h.description,children:[a.jsxs("button",{"aria-label":`${h.name} ${h.description} ${h.entries.length} ${e.dictionary.entries}`,"aria-pressed":q,className:"flex min-w-0 flex-1 items-center gap-2 rounded-sm px-1.5 py-1.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35",onClick:()=>st(h.id),type:"button",children:[a.jsx("span",{className:Le("flex size-5 shrink-0 items-center justify-center rounded-md border",q?"border-primary bg-primary text-primary-foreground":"border-border bg-background"),children:q?a.jsx(He,{className:"size-3"}):null}),h.source==="cloud"?a.jsx(Ee,{className:"size-3.5 shrink-0 text-primary"}):a.jsx(qe,{className:"size-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:h.name}),a.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:h.entries.length})]}),h.source==="cloud"?a.jsxs("span",{className:"flex shrink-0 gap-1",children:[a.jsx(Q,{"aria-label":`${e.dictionary.editAction} ${h.name}`,onClick:E=>{E.stopPropagation(),dt(h.id)},size:"icon-sm",type:"button",variant:"ghost",children:a.jsx(jt,{className:"size-3"})}),a.jsx(Q,{"aria-label":`${e.dictionary.deleteAction} ${h.name}`,className:"text-destructive hover:text-destructive",disabled:d.isPending,onClick:E=>{E.stopPropagation(),ut(h.id)},size:"icon-sm",type:"button",variant:"ghost",children:a.jsx(Ct,{className:"size-3"})})]}):null]},h.id)})})]},u)),o&&!n&&!c?a.jsxs(J,{children:[a.jsx(Ee,{className:"size-4"}),a.jsx(M,{children:e.dictionary.loginRequired})]}):null,c&&g.isLoading?a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(ze,{className:"size-4 animate-spin"}),e.dictionary.cloudLoading]}):null,c&&!g.isLoading&&!p.length?a.jsx("p",{className:"text-sm text-muted-foreground",children:e.dictionary.cloudEmpty}):null]})]}),a.jsx("div",{className:"space-y-5",children:a.jsxs("section",{className:"apple-panel p-4 md:p-5",children:[a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsxs("label",{className:"space-y-2",htmlFor:"domain-sweep-prefixes",children:[a.jsxs("span",{className:"flex items-center gap-2 text-sm font-semibold",children:[a.jsx(Bt,{className:"size-4 text-primary"}),D.length?e.form.prefixes:e.form.keywords]}),a.jsx(oe,{className:"min-h-44 resize-y rounded-md bg-background/80 font-mono text-sm leading-6",id:"domain-sweep-prefixes",onChange:u=>we(u.target.value),placeholder:D.length?e.form.prefixesPlaceholder:e.form.keywordsPlaceholder,value:ee}),a.jsx("span",{className:"block text-xs text-muted-foreground",children:D.length?e.form.emptyPrefixHint:e.form.directKeywordHint})]}),a.jsxs("label",{className:"space-y-2",htmlFor:"domain-sweep-suffixes",children:[a.jsxs("span",{className:"flex items-center gap-2 text-sm font-semibold",children:[a.jsx(qe,{className:"size-4 text-primary"}),e.form.suffixes]}),a.jsx(oe,{className:"min-h-44 resize-y rounded-md bg-background/80 font-mono text-sm leading-6",id:"domain-sweep-suffixes",onChange:u=>tt(u.target.value),placeholder:e.form.suffixesPlaceholder,value:te})]})]}),ve?a.jsxs(J,{className:"mt-4",variant:"destructive",children:[a.jsx(de,{className:"size-4"}),a.jsx(M,{children:ve})]}):null,a.jsxs("div",{className:"mt-5 flex flex-wrap gap-3",children:[a.jsxs(Q,{className:"h-10 rounded-md",onClick:nt,type:"button",children:[a.jsx(Qe,{className:"size-4"}),e.form.generate]}),a.jsx(Q,{className:"h-10 rounded-md",disabled:!k,onClick:()=>{Se(null),z("")},type:"button",variant:"outline",children:e.form.clear})]})]})}),a.jsxs("aside",{className:"apple-panel h-fit p-4 lg:sticky lg:top-24",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold",children:e.result.title}),a.jsx("p",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:k?.domains.length?e.result.ready(k.domains.length):D.length?e.result.emptyDescription:e.result.emptyDirectDescription})]}),k?.truncated?a.jsx(_t,{variant:"destructive",children:me}):null]}),k?.truncated?a.jsxs(J,{className:"mt-4",children:[a.jsx(de,{className:"size-4"}),a.jsx(M,{children:e.result.truncated(k.estimatedTotal)})]}):null,k?.domains.length?a.jsx("div",{className:"mt-4 max-h-[420px] overflow-auto rounded-md border border-border/70 bg-background/70",children:k.domains.slice(0,160).map(u=>a.jsx("div",{className:"border-b border-border/60 px-3 py-2 font-mono text-sm last:border-b-0",children:u},u))}):a.jsxs("div",{className:"mt-4 rounded-md border border-dashed border-border/80 p-6 text-center",children:[a.jsx(Qe,{className:"mx-auto 
22size-6 text-muted-foreground"}),a.jsx("p",{className:"mt-3 font-semibold",children:e.result.emptyTitle})]}),a.jsxs("div",{className:"mt-4 grid gap-2",children:[a.jsxs(Q,{className:"h-10 rounded-md",disabled:!k?.domains.length,onClick:rt,type:"button",children:[e.form.joinBulk,a.jsx(Lt,{className:"size-4"})]}),a.jsxs(Q,{className:"h-10 rounded-md",disabled:!k?.domains.length,onClick:()=>{at()},type:"button",variant:"outline",children:[a.jsx(Qt,{className:"size-4"}),e.form.copy]})]})]})]}),a.jsx(Hi,{copy:e}),a.jsx(bt,{onOpenChange:F,open:it,children:a.jsxs(wt,{className:"sm:max-w-2xl",children:[a.jsxs(St,{children:[a.jsx(vt,{children:ie?e.dialog.editTitle:e.dialog.createTitle}),a.jsx(It,{children:e.dialog.description})]}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[a.jsxs("label",{className:"space-y-2",htmlFor:"domain-sweep-dictionary-name",children:[a.jsx("span",{className:"text-sm font-semibold",children:e.dialog.name}),a.jsx(Be,{className:"h-10 rounded-md",id:"domain-sweep-dictionary-name",onChange:u=>se(u.target.value),value:ke})]}),a.jsxs("label",{className:"space-y-2",htmlFor:"domain-sweep-dictionary-group",children:[a.jsx("span",{className:"text-sm font-semibold",children:e.dialog.group}),a.jsx(Be,{className:"h-10 rounded-md",id:"domain-sweep-dictionary-group",onChange:u=>ne(u.target.value),value:Ae})]})]}),a.jsxs("label",{className:"space-y-2",htmlFor:"domain-sweep-dictionary-entries",children:[a.jsx("span",{className:"text-sm font-semibold",children:e.dialog.entries}),a.jsx(oe,{className:"min-h-56 resize-y rounded-md font-mono text-sm leading-6",id:"domain-sweep-dictionary-entries",onChange:u=>ae(u.target.value),placeholder:e.dialog.entriesPlaceholder,value:De})]}),je?a.jsxs(J,{variant:"destructive",children:[a.jsx(de,{className:"size-4"}),a.jsx(M,{children:je})]}):null]}),a.jsxs(kt,{children:[a.jsx(Q,{disabled:_.isPending||v.isPending,onClick:()=>F(!1),type:"button",variant:"outline",children:e.dialog.cancel}),a.jsxs(Q,{disabled:_.isPending||v.isPending,onClick:()=>{lt()},type:"button",children:[_.isPending||v.isPending?a.jsx(ze,{className:"size-4 animate-spin"}):null,_.isPending||v.isPending?e.dialog.saving:e.dialog.save]})]})]})})]})}function us(){return a.jsx($i,{})}export{us as component};

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.