sonamu 0.10.5 → 0.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/base-frame.d.ts +2 -0
- package/dist/api/base-frame.d.ts.map +1 -1
- package/dist/api/base-frame.js +8 -1
- package/dist/api/decorators.js +1 -1
- package/dist/api/sonamu.js +1 -1
- package/dist/bin/cli.js +195 -187
- package/dist/cone/cone-generator.js +3 -9
- package/dist/database/base-model.js +2 -2
- package/dist/database/knex.d.ts.map +1 -1
- package/dist/database/knex.js +2 -2
- package/dist/database/puri.d.ts +17 -0
- package/dist/database/puri.d.ts.map +1 -1
- package/dist/database/puri.js +102 -3
- package/dist/entity/entity-manager.js +1 -1
- package/dist/index.js +3 -3
- package/dist/migration/code-generation.js +6 -6
- package/dist/migration/migrator.d.ts.map +1 -1
- package/dist/migration/migrator.js +52 -7
- package/dist/migration/slack-confirm.js +1 -1
- package/dist/naite/naite-reporter.js +1 -1
- package/dist/syncer/checksum.js +1 -1
- package/dist/syncer/code-generator.js +1 -1
- package/dist/syncer/entity-operations.js +1 -1
- package/dist/syncer/syncer-actions.js +1 -1
- package/dist/syncer/syncer.js +1 -1
- package/dist/ui-web/assets/{index-BLX4zN8c.js → index-D0MHYbxl.js} +1 -1
- package/dist/ui-web/assets/index-Dx_JX4aQ.css +1 -0
- package/dist/ui-web/index.html +2 -2
- package/dist/utils/formatter.js +1 -1
- package/package.json +3 -3
- package/src/api/base-frame.ts +14 -1
- package/src/bin/cli.ts +268 -280
- package/src/cone/cone-generator.ts +2 -18
- package/src/database/__tests__/puri.test.ts +183 -0
- package/src/database/knex.ts +4 -1
- package/src/database/puri.ts +229 -2
- package/src/database/puri.types.test-d.ts +56 -0
- package/src/migration/code-generation.ts +5 -5
- package/src/migration/migrator.ts +81 -7
- package/src/skills/AGENTS.md +76 -50
- package/src/skills/sonamu/SKILL.md +46 -227
- package/src/skills/{sonamu/ai-agents.md → sonamu-ai-agents/SKILL.md} +3 -3
- package/src/skills/{sonamu/api.md → sonamu-api/SKILL.md} +3 -2
- package/src/skills/{sonamu/auth.md → sonamu-auth/SKILL.md} +9 -4
- package/src/skills/{sonamu/auth-plugins.md → sonamu-auth/references/plugins.md} +2 -7
- package/src/skills/sonamu-auth/references/user-id-migration-followups.md +192 -0
- package/src/skills/{sonamu/auth-migration.md → sonamu-auth/references/user-id-migration.md} +1 -195
- package/src/skills/sonamu-config/SKILL.md +203 -0
- package/src/skills/{sonamu → sonamu-config/references}/database.md +3 -8
- package/src/skills/sonamu-config/references/environments.md +178 -0
- package/src/skills/sonamu-config/references/server-options.md +400 -0
- package/src/skills/sonamu-entity/SKILL.md +180 -0
- package/src/skills/{sonamu/entity-validation-checklist.md → sonamu-entity/references/creation-workflow.md} +117 -8
- package/src/skills/sonamu-entity/references/design-guides.md +243 -0
- package/src/skills/sonamu-entity/references/field-types.md +170 -0
- package/src/skills/sonamu-entity/references/relations-detail.md +245 -0
- package/src/skills/{sonamu/entity-relations.md → sonamu-entity/references/relations.md} +1 -258
- package/src/skills/{sonamu → sonamu-entity/references}/subset.md +1 -11
- package/src/skills/sonamu-fixture/SKILL.md +180 -0
- package/src/skills/{sonamu/fixture-cli.md → sonamu-fixture/references/cli-usage.md} +5 -176
- package/src/skills/{sonamu → sonamu-fixture/references}/cone.md +4 -14
- package/src/skills/sonamu-frontend/SKILL.md +142 -0
- package/src/skills/sonamu-frontend/references/components.md +323 -0
- package/src/skills/sonamu-frontend/references/examples.md +64 -0
- package/src/skills/sonamu-frontend/references/hooks.md +273 -0
- package/src/skills/sonamu-frontend/references/runtime.md +165 -0
- package/src/skills/{sonamu → sonamu-frontend/references}/scaffolding.md +3 -8
- package/src/skills/{sonamu/i18n.md → sonamu-i18n/SKILL.md} +2 -2
- package/src/skills/{sonamu/migration.md → sonamu-migration/SKILL.md} +1 -1
- package/src/skills/{sonamu/naite.md → sonamu-naite/SKILL.md} +5 -5
- package/src/skills/sonamu-query/SKILL.md +48 -0
- package/src/skills/sonamu-query/references/model-patterns.md +390 -0
- package/src/skills/{sonamu → sonamu-query/references}/model.md +1 -401
- package/src/skills/{sonamu → sonamu-query/references}/puri.md +31 -243
- package/src/skills/sonamu-query/references/search.md +238 -0
- package/src/skills/{sonamu → sonamu-query/references}/upsert.md +1 -6
- package/src/skills/{sonamu/tasks.md → sonamu-tasks/SKILL.md} +1 -1
- package/src/skills/sonamu-testing/SKILL.md +251 -0
- package/src/skills/{sonamu/testing-devrunner.md → sonamu-testing/references/devrunner.md} +4 -9
- package/src/skills/sonamu-testing/references/helpers.md +185 -0
- package/src/skills/sonamu-testing/references/patterns.md +263 -0
- package/src/skills/sonamu-testing/references/pitfalls.md +588 -0
- package/src/skills/sonamu-testing/references/quick-start.md +285 -0
- package/src/skills/sonamu-testing/references/type-safety.md +172 -0
- package/src/skills/sonamu-testing/references/writing-plan.md +375 -0
- package/src/skills/{sonamu/vector.md → sonamu-vector/SKILL.md} +1 -1
- package/dist/ui-web/assets/index-Dx4ap5i4.css +0 -1
- package/src/skills/commands/sonamu-skills.md +0 -20
- package/src/skills/project/README.md +0 -19
- package/src/skills/project/architecture.md +0 -373
- package/src/skills/sonamu/cdd.md +0 -129
- package/src/skills/sonamu/config.md +0 -772
- package/src/skills/sonamu/create-sonamu.md +0 -208
- package/src/skills/sonamu/entity-basic.md +0 -678
- package/src/skills/sonamu/framework-change.md +0 -96
- package/src/skills/sonamu/frontend.md +0 -915
- package/src/skills/sonamu/project-init.md +0 -477
- package/src/skills/sonamu/skill-contribution.md +0 -247
- package/src/skills/sonamu/testing.md +0 -2163
|
@@ -99,7 +99,7 @@ Error generating stack: `+e.message+`
|
|
|
99
99
|
`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(`
|
|
100
100
|
`),r=t===-1?-1:n.indexOf(`
|
|
101
101
|
`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=`
|
|
102
|
-
`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=KI(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&bL.assertOptions(n,{silentJSONParsing:xL.transitional(xL.boolean),forcedJSONParsing:xL.transitional(xL.boolean),clarifyTimeoutError:xL.transitional(xL.boolean),legacyInterceptorReqResOrdering:xL.transitional(xL.boolean)},!1),r!=null&&(q.isFunction(r)?t.paramsSerializer={serialize:r}:bL.assertOptions(r,{encode:xL.function,serialize:xL.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),bL.assertOptions(t,{baseUrl:xL.spelling(`baseURL`),withXsrfToken:xL.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&q.merge(i.common,i[t.method]);i&&q.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=kI.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||tI;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[hL.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=hL.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=KI(this.defaults,e),$F(WI(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};q.forEach([`delete`,`get`,`head`,`options`],function(e){SL.prototype[e]=function(t,n){return this.request(KI(n||{},{method:e,url:t,data:(n||{}).data}))}}),q.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(KI(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}SL.prototype[e]=t(),SL.prototype[e+`Form`]=t(!0)});var CL=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new MI(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function wL(e){return function(t){return e.apply(null,t)}}function TL(e){return q.isObject(e)&&e.isAxiosError===!0}var EL={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(EL).forEach(([e,t])=>{EL[t]=e});function DL(e){let t=new SL(e),n=jP(SL.prototype.request,t);return q.extend(n,SL.prototype,t,{allOwnKeys:!0}),q.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return DL(KI(e,t))},n}var OL=DL(hI);OL.Axios=SL,OL.CanceledError=MI,OL.CancelToken=CL,OL.isCancel=jI,OL.VERSION=gL,OL.toFormData=JF,OL.AxiosError=HF,OL.Cancel=OL.CanceledError,OL.all=function(e){return Promise.all(e)},OL.spread=wL,OL.isAxiosError=TL,OL.mergeConfig=KI,OL.AxiosHeaders=kI,OL.formToJSON=e=>pI(q.isHTMLForm(e)?new FormData(e):e),OL.getAdapter=pL.getAdapter,OL.HttpStatusCode=EL,OL.default=OL;var kL=u(AP(),1),AL=``;async function jL(e){try{return(await OL({baseURL:AL,...e})).data}catch(e){if(OL.isAxiosError(e)&&e.response&&e.response.data){let t=e.response.data;throw new ML(e.response.status,t.message,t.issues)}throw e}}var ML=class extends Error{code;message;issues;isSonamuError;constructor(e,t,n){super(t),this.code=e,this.message=t,this.issues=n,this.isSonamuError=!0}};function NL(e){return e&&e.isSonamuError===!0}function PL(e){NL(e)?alert(e.message):alert(`에러 발생`)}var J;(function(e){function t(){return jL({method:`GET`,url:`/sonamu-ui/api/sonamu/config`})}e.getSonamuConfig=t;function n(){return N_({queryKey:[`entities`,`findMany`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/entity/findMany`})})}e.useEntities=n;function r(e){return N_({queryKey:[`entity`,`typeIds`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/entity/typeIds`,params:{filter:e,reload:`1`}})})}e.useTypeIds=r;function i(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/create`,data:{form:e}})}e.createEntity=i;function a(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/del`,data:{entityId:e}})}e.delEntity=a;function o(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyEntityBase`,data:{entityId:e,newValues:t}})}e.modifyEntityBase=o;function s(e,t,n,r){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifySubset`,data:{entityId:e,subsetKey:t,fields:n,fieldsInternal:r}})}e.modifySubset=s;function c(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/delSubset`,data:{entityId:e,subsetKey:t}})}e.delSubset=c;function l(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/createProp`,data:{entityId:e,at:n,newProp:t}})}e.createProp=l;function u(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyProp`,data:{entityId:e,at:n,newProp:t}})}e.modifyProp=u;function d(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/delProp`,data:{entityId:e,at:t}})}e.delProp=d;function f(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/moveProp`,data:{entityId:e,at:t,to:n}})}e.moveProp=f;function p(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyIndexes`,data:{entityId:e,indexes:t}})}e.modifyIndexes=p;function m(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyEnumLabels`,data:{entityId:e,enumLabels:t}})}e.modifyEnumLabels=m;function h(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/createEnumId`,data:e})}e.createEnumId=h;function g(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyEnumId`,data:{entityId:e,enumId:t}})}e.modifyEnumId=g;function _(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/deleteEnumId`,data:e})}e.deleteEnumId=_;function v(e){return jL({method:`GET`,url:`/sonamu-ui/api/entity/getTableColumns`,params:{entityId:e}})}e.getTableColumns=v;function y(){return N_({queryKey:[`migrations`,`status`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/migrations/status`})})}e.useMigrationStatus=y;function b(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/runAction`,data:{action:e,targets:t,...n}})}e.migrationsRunAction=b;function x(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/checkApproval`,data:{channel:e,ts:t}})}e.migrationsCheckApproval=x;function S(e,t,n,r){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/forceApproval`,data:{channel:e,ts:t,reason:n,requestor:r}})}e.migrationsForceApproval=S;function C(e){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/delCodes`,data:{codeNames:e}})}e.migrationsDelCodes=C;function w(){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/generatePreparedCodes`,data:{}})}e.migrationsGeneratePreparedCodes=w;function T(e){return jL({method:`GET`,url:`/sonamu-ui/api/tools/openVscode`,params:e})}e.openVscode=T;function E(e){return jL({method:`GET`,url:`/sonamu-ui/api/tools/getSuggestion`,params:e})}e.getSuggestion=E;function D(e){let t=e.entityIds.length>0&&e.templateKeys.length>0;return N_({queryKey:[`scaffolding`,`getStatus`,e],queryFn:()=>jL({method:`POST`,url:`/sonamu-ui/api/scaffolding/getStatus`,data:e}),enabled:t})}e.useScaffoldingStatus=D;function O(e){return jL({method:`POST`,url:`/sonamu-ui/api/scaffolding/generate`,data:{options:e}})}e.scaffoldingGenerate=O;function k(e){return jL({method:`POST`,url:`/sonamu-ui/api/scaffolding/preview`,data:{option:e}})}e.scaffoldingPreview=k;function A(e){return jL({method:`GET`,url:`/sonamu-ui/api/openai/messages`,params:{id:e}})}e.getMessages=A;function j(e){return jL({method:`POST`,url:`/sonamu-ui/api/openai/chat`,data:{message:e}})}e.chat=j;function M(){return jL({method:`POST`,url:`/sonamu-ui/api/openai/clearThread`})}e.clearThread=M;function N(e,t,n,r){return jL({method:`POST`,url:`/sonamu-ui/api/fixture`,data:{sourceDB:e,targetDB:t,search:n,duplicateCheck:r}})}e.getFixtures=N;function P(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/fixture/import`,data:{db:e,fixtures:t}})}e.importFixtures=P;function F(){return N_({queryKey:[`i18n`,`dictionary`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/i18n/dictionary`})})}e.useI18nDictionary=F;function ee(e){let t=new FormData;return t.append(`file`,e),jL({method:`POST`,url:`/sonamu-ui/api/i18n/import`,data:t,headers:{"Content-Type":`multipart/form-data`}})}e.importI18n=ee;function te(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/update`,data:e})}e.updateI18n=te;function ne(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/create`,data:e})}e.createI18n=ne;function I(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/delete`,data:{key:e}})}e.deleteI18n=I;function re(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/checkUsage`,data:{keys:e}})}e.checkI18nUsage=re;function ie(){return N_({queryKey:[`test`,`status`],queryFn:()=>jL({method:`GET`,url:`/__test__/status`})})}e.useTestStatus=ie;function ae(e){return N_({queryKey:[`tasks`,`workflowRuns`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowRuns`,params:{...e?.limit?{limit:String(e.limit)}:{},...e?.after?{after:e.after}:{},...e?.before?{before:e.before}:{},...e?.status?.length?{status:e.status.join(`,`)}:{},...e?.workflowName?{workflowName:e.workflowName}:{},...e?.createdAfter?{createdAfter:e.createdAfter}:{},...e?.createdBefore?{createdBefore:e.createdBefore}:{},order:`desc`}}),refetchInterval:5e3})}e.useWorkflowRuns=ae;function oe(e){return N_({queryKey:[`tasks`,`workflowRun`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}`}),refetchInterval:5e3})}e.useWorkflowRun=oe;function se(e){return N_({queryKey:[`tasks`,`stepAttempts`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/steps`}),refetchInterval:5e3})}e.useStepAttempts=se;function ce(){return N_({queryKey:[`tasks`,`workflowDefinitions`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowDefinitions`})})}e.useWorkflowDefinitions=ce;function le(e){return jL({method:`POST`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/cancel`})}e.cancelWorkflowRun=le;function ue(e){return jL({method:`POST`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/pause`})}e.pauseWorkflowRun=ue;function de(e){return jL({method:`POST`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/resume`})}e.resumeWorkflowRun=de;function fe(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`entity`,cone:t}})}e.updateEntityCone=fe;function pe(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`prop`,propName:t,cone:n}})}e.updatePropCone=pe;function me(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`enum`,enumId:t,cone:n}})}e.updateEnumCone=me;function he(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`subset`,subsetKey:t,cone:n}})}e.updateSubsetCone=he;function ge(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/generateCones`,data:{entityId:e,...t}})}e.generateCones=ge})(J||={});var FL=.3,IL=`bg-amber-200/60 text-amber-900 rounded-sm`;function LL(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(r.length===0||r.length>n.length)return null;let i=n.indexOf(r);if(i!==-1)return{score:1,indices:Array.from({length:r.length},(e,t)=>i+t)};let a=[],o=0;for(let e=0;e<n.length&&o<r.length;e++)n[e]===r[o]&&(a.push(e),o++);if(o<r.length)return null;let s=0;for(let t=0;t<a.length;t++){let n=a[t];t>0&&n===a[t-1]+1?s+=1:n===0||RL(e,n)?s+=.8:s+=.1}return{score:s/a.length,indices:a}}function RL(e,t){if(t===0)return!0;let n=e[t-1],r=e[t];return n===`_`||n===` `||n===`-`||n===`.`||n===n.toLowerCase()&&r===r.toUpperCase()&&r!==r.toLowerCase()}function zL({text:e,search:t,indices:n}){if(!t)return(0,z.jsx)(`span`,{children:e});let r=n??LL(e,t)?.indices;if(!r||r.length===0)return(0,z.jsx)(`span`,{children:e});if(r.every((e,t)=>t===0||e===r[t-1]+1)){let t=r[0],n=r[r.length-1]+1;return(0,z.jsxs)(`span`,{children:[e.slice(0,t),(0,z.jsx)(`span`,{className:IL,children:e.slice(t,n)}),e.slice(n)]})}let i=[],a=0;for(let t of r)t>a&&i.push(e.slice(a,t)),i.push((0,z.jsx)(`span`,{className:IL,children:e[t]},t)),a=t+1;return a<e.length&&i.push(e.slice(a)),(0,z.jsx)(`span`,{children:i})}function BL({open:e,onClose:t}){let[n,r]=(0,m.useState)(``),i=uP(),{data:a}=J.useEntities(),{entities:o}=a??{},s=(0,m.useMemo)(()=>!o||!n?[]:o.map(e=>{let t=LL(`${e.id} ${e.title}`,n),r=t!==null&&t.score>=FL,i=e.props.filter(e=>{let t=LL(`${e.name} ${e.desc??``}`,n);return t!==null&&t.score>=FL}),a=Object.entries(e.subsets).flatMap(([e,t])=>t.filter(t=>{let r=LL(`${e} ${t}`,n);return r!==null&&r.score>=FL}).map(t=>({subsetKey:e,field:t}))),o=Object.keys(e.enumLabels).filter(e=>{let t=LL(e,n);return t!==null&&t.score>=FL});return r||i.length>0||a.length>0||o.length>0?{entity:e,entityMatch:r,matchedProps:i,matchedSubsets:a,matchedEnums:o,bestScore:Math.max(t?.score??0,...i.map(e=>LL(`${e.name} ${e.desc??``}`,n)?.score??0),...a.map(({subsetKey:e,field:t})=>LL(`${e} ${t}`,n)?.score??0),...o.map(e=>LL(e,n)?.score??0))}:null}).filter(Boolean).toSorted((e,t)=>(t?.bestScore??0)-(e?.bestScore??0)),[o,n]),c=(e,n)=>{r(``),t(),i({to:e}),n&&l(n)},l=e=>{let t=0,n=setInterval(()=>{t++;let r=document.getElementById(e);r?(clearInterval(n),r.scrollIntoView({behavior:`instant`,block:`center`}),r.style.backgroundColor=`#fef3c7`,r.style.boxShadow=`0 0 0 2px #fbbf24`,setTimeout(()=>{r.style.backgroundColor=``,r.style.boxShadow=``,r.style.transition=`background-color 1s, box-shadow 1s`},1e3)):t>=50&&clearInterval(n)},100)};return(0,z.jsxs)(sf,{open:e,onOpenChange:e=>{e||(r(``),t())},commandProps:{shouldFilter:!1},children:[(0,z.jsx)(cf,{placeholder:`Search entities...`,value:n,onValueChange:r}),(0,z.jsxs)(lf,{className:`max-h-[60vh]`,children:[n&&s.length===0&&(0,z.jsx)(uf,{children:`검색 결과가 없습니다.`}),s.map(e=>{if(!e)return null;let{entity:t,entityMatch:r,matchedProps:i,matchedSubsets:a,matchedEnums:o}=e;return(0,z.jsxs)(df,{heading:(0,z.jsx)(zL,{text:`${t.id} ${t.title}`,search:n}),children:[r&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(pf,{value:`entity:${t.id} ${t.title}`,onSelect:()=>c(`/entities/${t.id}`),children:(0,z.jsx)(zL,{text:`${t.id} (${t.title})`,search:n})}),(0,z.jsxs)(pf,{value:`scaffolding:${t.id} ${t.title}`,onSelect:()=>c(`/scaffolding`,t.id),children:[`Scaffolding >`,` `,(0,z.jsx)(zL,{text:`${t.id}(${t.title})`,search:n})]})]}),i.map(e=>(0,z.jsxs)(pf,{value:`prop:${e.name} ${e.desc??``} ${t.id}`,onSelect:()=>c(`/entities/${t.id}`,`prop-${e.name}`),children:[`prop > `,(0,z.jsx)(zL,{text:e.name,search:n}),e.desc?(0,z.jsxs)(`span`,{children:[` (`,(0,z.jsx)(zL,{text:e.desc,search:n}),`)`]}):null]},`prop-${e.name}`)),a.map(({subsetKey:e,field:r})=>(0,z.jsxs)(pf,{value:`subset:${e} ${r} ${t.id}`,onSelect:()=>c(`/entities/${t.id}`,r),children:[`Subset`,e,` > `,(0,z.jsx)(zL,{text:r,search:n})]},`subset-${e}-${r}`)),o.map(e=>(0,z.jsxs)(pf,{value:`enum:${e} ${t.id}`,onSelect:()=>c(`/entities/${t.id}`,`enum-${e}`),children:[`enum > `,(0,z.jsx)(zL,{text:e,search:n})]},`enum-${e}`))]},t.id)})]})]})}function VL({children:e}){let{SD:t}=kP(),n=DP(),r=uie(),i=[{name:t(`nav.entities`),path:`/entities`},{name:t(`nav.migration`),path:`/migrations`},{name:t(`nav.scaffolding`),path:`/scaffolding`},{name:t(`nav.fixture`),path:`/fixture`},{name:t(`nav.i18n`),path:`/i18n`},{name:t(`nav.tasks`),path:`/tasks`},{name:t(`nav.testResults`),path:`/test-results`},{name:t(`nav.cdd`),path:`/cdd`}],a=rie(),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(null),u=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),s(!0))};return(0,m.useEffect)(()=>(document.addEventListener(`keydown`,u),()=>{document.removeEventListener(`keydown`,u)}),[]),(0,m.useEffect)(()=>{J.getSonamuConfig().then(e=>{e.projectName&&(l(e.projectName),document.title=`${e.projectName}: Sonamu UI`)})},[]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`app`,children:[(0,z.jsxs)(`div`,{className:`w-full h-gnb bg-sidebar-bg text-white sticky top-0 left-0 flex items-center z-100 border-b border-white/10 justify-between`,children:[(0,z.jsxs)(`div`,{className:`flex`,children:[(0,z.jsxs)(`div`,{className:`p-4 font-bold w-sidemenu tracking-[-0.5px]`,children:[(0,z.jsx)(`span`,{children:`🌲 \xA0 Sonamu UI`}),(0,z.jsxs)(`span`,{className:`font-normal text-text-muted text-[0.9em] ml-2`,children:[`\xA0 `,c]})]}),(0,z.jsx)(`div`,{className:`flex gap-[0.3em] text-[0.9em]`,children:i.map((e,t)=>(0,z.jsx)(mP,{className:(0,kL.default)(`self-center px-6 py-[0.8em] cursor-pointer text-center text-text-light! no-underline rounded-md transition-all duration-200`,`hover:bg-white/10 hover:text-white!`,{"bg-white/15! font-semibold text-white!":a.pathname.includes(e.path)}),to:e.path,children:(0,z.jsx)(`div`,{children:e.name})},t))})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`select`,{value:n,onChange:e=>r(e.target.value),className:`px-2 py-[0.4em] rounded-md border border-white/10 bg-black/20 cursor-pointer text-text-muted text-[0.85em] transition-all duration-200 hover:border-accent hover:text-white`,children:OP.map(e=>(0,z.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,z.jsxs)(`button`,{type:`button`,className:`mr-4 px-4 py-[0.4em] rounded-[20px] border border-white/10 bg-black/20 cursor-pointer text-text-muted text-[0.9em] transition-all duration-200 hover:border-accent hover:text-white *:mr-2`,onClick:()=>s(!0),children:[(0,z.jsx)(`span`,{children:`🔍`}),(0,z.jsx)(`span`,{children:t(`nav.search`)}),(0,z.jsx)(`kbd`,{className:`keycap`,children:`⌘`}),(0,z.jsx)(`kbd`,{className:`keycap`,children:`K`})]})]})]}),(0,z.jsx)(`div`,{className:`content`,children:e})]}),(0,z.jsx)(BL,{open:o,onClose:()=>s(!1)}),(0,z.jsx)(Kee,{})]})}var HL=Vre()({component:UL});function UL(){return(0,z.jsx)(VL,{children:(0,z.jsx)(CP,{})})}function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(null,arguments)}function WL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var GL={},KL=(0,m.createContext)(GL),qL=(e,t)=>Y({},e,t),JL=()=>(0,m.useContext)(KL),YL=(0,m.createContext)(()=>{});YL.displayName=`JVR.DispatchShowTools`;function XL(){return(0,m.useReducer)(qL,GL)}function ZL(){return(0,m.useContext)(YL)}var QL=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(KL.Provider,{value:t,children:(0,z.jsx)(YL.Provider,{value:n,children:r})})};QL.displayName=`JVR.ShowTools`;var $L={},eR=(0,m.createContext)($L),tR=(e,t)=>Y({},e,t),nR=()=>(0,m.useContext)(eR),rR=(0,m.createContext)(()=>{});rR.displayName=`JVR.DispatchExpands`;function iR(){return(0,m.useReducer)(tR,$L)}function aR(){return(0,m.useContext)(rR)}var oR=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(eR.Provider,{value:t,children:(0,z.jsx)(rR.Provider,{value:n,children:r})})};oR.displayName=`JVR.Expands`;var sR={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},cR=(0,m.createContext)(sR),lR=(e,t)=>Y({},e,t),uR=()=>(0,m.useContext)(cR),dR=(0,m.createContext)(()=>{});dR.displayName=`JVR.DispatchTypes`;function fR(){return(0,m.useReducer)(lR,sR)}function pR(){return(0,m.useContext)(dR)}function mR(e){var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(cR.Provider,{value:t,children:(0,z.jsx)(dR.Provider,{value:n,children:r})})}mR.displayName=`JVR.Types`;var hR=[`style`];function gR(e){var{style:t}=e,n=WL(e,hR);return(0,z.jsx)(`svg`,Y({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:Y({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t)},n,{children:(0,z.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}gR.displayName=`JVR.TriangleArrow`;var _R={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,z.jsx)(gR,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},vR=(0,m.createContext)(_R),yR=(e,t)=>Y({},e,t),bR=()=>(0,m.useContext)(vR),xR=(0,m.createContext)(()=>{});xR.displayName=`JVR.DispatchSymbols`;function SR(){return(0,m.useReducer)(yR,_R)}function CR(){return(0,m.useContext)(xR)}var wR=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(vR.Provider,{value:t,children:(0,z.jsx)(xR.Provider,{value:n,children:r})})};wR.displayName=`JVR.Symbols`;var TR={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},ER=(0,m.createContext)(TR),DR=(e,t)=>Y({},e,t),OR=()=>(0,m.useContext)(ER),kR=(0,m.createContext)(()=>{});kR.displayName=`JVR.DispatchSection`;function AR(){return(0,m.useReducer)(DR,TR)}function jR(){return(0,m.useContext)(kR)}var MR=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(ER.Provider,{value:t,children:(0,z.jsx)(kR.Provider,{value:n,children:r})})};MR.displayName=`JVR.Section`;var NR={objectSortKeys:!1,indentWidth:15},PR=(0,m.createContext)(NR);PR.displayName=`JVR.Context`;var FR=(0,m.createContext)(()=>{});FR.displayName=`JVR.DispatchContext`;function IR(e,t){return Y({},e,t)}var LR=()=>(0,m.useContext)(PR),RR=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,m.useReducer)(IR,Object.assign({},NR,n)),[o,s]=XL(),[c,l]=iR(),[u,d]=fR(),[f,p]=SR(),[h,g]=AR();return(0,m.useEffect)(()=>a(Y({},n)),[n]),(0,z.jsx)(PR.Provider,{value:i,children:(0,z.jsx)(FR.Provider,{value:a,children:(0,z.jsx)(QL,{initial:o,dispatch:s,children:(0,z.jsx)(oR,{initial:c,dispatch:l,children:(0,z.jsx)(mR,{initial:Y({},u,r),dispatch:d,children:(0,z.jsx)(wR,{initial:f,dispatch:p,children:(0,z.jsx)(MR,{initial:h,dispatch:g,children:t})})})})})})})};RR.displayName=`JVR.Provider`;function zR(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var BR=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],VR=[`as`,`render`],HR=[`as`,`render`],UR=[`as`,`render`],WR=[`as`,`style`,`render`],GR=[`as`,`render`],KR=[`as`,`render`],qR=[`as`,`render`],JR=[`as`,`render`],YR=e=>{var{Quote:t={}}=bR(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=WL(e,BR);if(n)return null;var{as:c,render:l}=t,u=WL(t,VR),d=c||`span`,f=Y({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,z.jsx)(d,Y({},f))};YR.displayName=`JVR.Quote`;var XR=e=>{var{ValueQuote:t={}}=bR(),n=Y({},(zR(e),e)),{as:r,render:i}=t,a=WL(t,HR),o=r||`span`,s=Y({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,z.jsx)(o,Y({},s))};XR.displayName=`JVR.ValueQuote`;var ZR=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=bR(),{as:o,render:s}=a,c=WL(a,UR),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,z.jsx)(l,Y({},c))};ZR.displayName=`JVR.Colon`;var QR=e=>{var{Arrow:t={}}=bR(),n=nR(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=WL(t,WR),m=u||`span`,h=f&&typeof f==`function`,g=Y({},p,{"data-expanded":l,style:Y({},d,i)});return h&&f(g,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,z.jsx)(m,Y({},p,{style:Y({},d,i)}))};QR.displayName=`JVR.Arrow`;var $R=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=bR(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=WL(o,GR),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,z.jsx)(f,Y({},d))}var{as:p,render:m}=s,h=WL(s,KR),g=p||`span`;return m&&typeof m==`function`&&m(h,c)||(0,z.jsx)(g,Y({},h))};$R.displayName=`JVR.BracketsOpen`;var ez=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=bR();if(t){var{as:u,render:d}=c,f=WL(c,qR),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,z.jsx)(p,Y({},f))}var{as:m,render:h}=l,g=WL(l,JR),_=m||`span`;return h&&typeof h==`function`&&h(g,s)||(0,z.jsx)(_,Y({},g))};ez.displayName=`JVR.BracketsClose`;var tz=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=nR(),{collapsed:c,shouldExpandNodeInitially:l}=LR(),u=typeof c==`boolean`?c:typeof c==`number`?a>c:!1,d=s[r]??(l?!1:u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},h={keyName:t,value:n,keys:o,parentValue:i},g=Array.isArray(n),_=n instanceof Set;return(0,z.jsx)(`div`,{style:m,children:(0,z.jsx)(ez,Y({isBrackets:g||_},h,{isVisiable:!0}))})};tz.displayName=`JVR.NestedClose`;var nz=[`as`,`render`],rz=[`as`,`render`],iz=[`as`,`render`],az=[`as`,`render`],oz=[`as`,`render`],sz=[`as`,`render`],cz=[`as`,`render`],lz=[`as`,`render`],uz=[`as`,`render`],dz=[`as`,`render`],fz=[`as`,`render`],pz=[`as`,`render`],mz=[`as`,`render`],hz=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},gz=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=uR();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=WL(r,nz);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,z.jsx)(a||`span`,Y({},s))};gz.displayName=`JVR.SetComp`;var _z=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=uR();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=WL(r,rz);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,z.jsx)(a||`span`,Y({},s))};_z.displayName=`JVR.MapComp`;var vz={opacity:.75,paddingRight:4},yz=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=uR(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=LR(),{as:c,render:l}=i,u=WL(i,iz),d=t,[f,p]=(0,m.useState)(o&&d.length>o);(0,m.useEffect)(()=>p(o&&d.length>o),[o]);var h=c||`span`,g=Y({},vz,i.style||{});o>0&&(u.style=Y({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var _=f?``+d.slice(0,o)+s:d,v=l&&typeof l==`function`,y=v&&l(Y({},u,{style:g}),{type:`type`,value:t,keyName:n,keys:r}),b=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,x=v&&l(Y({},u,{children:_,className:b}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(y||(0,z.jsx)(h,Y({},u,{style:g}))),x||(0,z.jsxs)(m.Fragment,{children:[(0,z.jsx)(XR,{}),(0,z.jsx)(h,Y({},u,{className:b,children:_})),(0,z.jsx)(XR,{})]})]})};yz.displayName=`JVR.TypeString`;var bz=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,az),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};bz.displayName=`JVR.TypeTrue`;var xz=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,oz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};xz.displayName=`JVR.TypeFalse`;var Sz=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,sz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Sz.displayName=`JVR.TypeFloat`;var Cz=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,cz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Cz.displayName=`JVR.TypeInt`;var wz=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,lz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:hz(t?.toString())}))]})};wz.displayName=`JVR.TypeFloat`;var Tz=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,uz),l=o||`span`,u=Y({},vz,i.style),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsxs)(`a`,Y({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,z.jsx)(XR,{}),t?.href,(0,z.jsx)(XR,{})]}))]})};Tz.displayName=`JVR.TypeUrl`;var Ez=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,dz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,h=d&&s(Y({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),h||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:p}))]})};Ez.displayName=`JVR.TypeDate`;var Dz=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,fz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p]})};Dz.displayName=`JVR.TypeUndefined`;var Oz=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,pz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p]})};Oz.displayName=`JVR.TypeNull`;var kz=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,mz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p]})};kz.displayName=`JVR.TypeNan`;var mie=e=>Number(e)===e&&e%1!=0||isNaN(e),Az=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,z.jsx)(Tz,Y({},i,{children:t})):typeof t==`string`?(0,z.jsx)(yz,Y({},i,{children:t})):t===!0?(0,z.jsx)(bz,Y({},i,{children:t})):t===!1?(0,z.jsx)(xz,Y({},i,{children:t})):t===null?(0,z.jsx)(Oz,Y({},i,{children:t})):t===void 0?(0,z.jsx)(Dz,Y({},i,{children:t})):t instanceof Date?(0,z.jsx)(Ez,Y({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,z.jsx)(kz,Y({},i,{children:t})):typeof t==`number`&&mie(t)?(0,z.jsx)(Sz,Y({},i,{children:t})):typeof t==`bigint`?(0,z.jsx)(wz,Y({},i,{children:t})):typeof t==`number`?(0,z.jsx)(Cz,Y({},i,{children:t})):null};Az.displayName=`JVR.Value`;function jz(e,t,n){var r=CR(),i=Y({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:Y({},e.style,t.style),children:t.children||e.children});(0,m.useEffect)(()=>r({[n]:i}),[t])}function Mz(e,t,n){var r=pR(),i=Y({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:Y({},e.style,t.style),children:t.children||e.children});(0,m.useEffect)(()=>r({[n]:i}),[t])}function Nz(e,t,n){var r=jR(),i=Y({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:Y({},e.style,t.style),children:t.children||e.children});(0,m.useEffect)(()=>r({[n]:i}),[t])}var hie=[`as`,`render`],Pz=e=>{var{KeyName:t={}}=OR();return Nz(t,e,`KeyName`),null};Pz.displayName=`JVR.KeyName`;var Fz=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=OR(),{as:c,render:l}=s,u=WL(s,hie);u.style=Y({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(Y({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,z.jsx)(d,Y({},u,{children:t}))};Fz.displayName=`JVR.KeyNameComp`;var gie=[`children`,`value`,`parentValue`,`keyName`,`keys`],_ie=[`as`,`render`,`children`],Iz=e=>{var{Row:t={}}=OR();return Nz(t,e,`Row`),null};Iz.displayName=`JVR.Row`;var Lz=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=WL(e,gie),{Row:s={}}=OR(),{as:c,render:l}=s,u=WL(s,_ie),d=c||`div`;return l&&typeof l==`function`&&l(Y({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,z.jsx)(d,Y({},o,u,{children:t}))};Lz.displayName=`JVR.RowComp`;function vie(e){var t=(0,m.useRef)();return(0,m.useEffect)(()=>{t.current=e}),t.current}function yie(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=vie(t),a=(0,m.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,m.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var bie=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],xie=[`as`,`render`],Rz=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=WL(e,bie),{onCopied:c,enableClipboard:l,beforeCopy:u}=LR(),d=JL()[i],[f,p]=(0,m.useState)(!1),{Copied:h={}}=OR(),g=h?.beforeCopy;if(l===!1||!d)return null;var _={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?hz(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?hz(t):t,2);var l=o||g||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:v}=h,y=WL(h,xie),b=Y({},y,s,_,{style:Y({},y.style,s.style,_.style)});return v&&typeof v==`function`&&v(Y({},b,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,z.jsx)(`svg`,Y({viewBox:`0 0 32 36`},b,{children:(0,z.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,z.jsx)(`svg`,Y({viewBox:`0 0 32 36`},b,{children:(0,z.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};Rz.displayName=`JVR.Copied`;function zz(){var e=(0,m.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var Bz=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=nR(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=LR(),f=typeof u==`boolean`?u:typeof u==`number`?i>u:!1,p=s[r]??(d?!1:f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,z.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,z.jsx)(Hz,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};Bz.displayName=`JVR.KeyValues`;var Vz=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=LR(),o=typeof t==`number`,s=(0,m.useRef)(null);yie({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,z.jsxs)(m.Fragment,{children:[(0,z.jsxs)(`span`,{ref:s,children:[(0,z.jsx)(YR,Y({isNumber:o,"data-placement":`left`},c)),(0,z.jsx)(Fz,Y({},c,{children:t})),(0,z.jsx)(YR,Y({isNumber:o,"data-placement":`right`},c))]}),(0,z.jsx)(ZR,Y({},c))]})};Vz.displayName=`JVR.KayName`;var Hz=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=ZL(),s=zz(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;return n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u?(0,z.jsx)(Xz,{keyName:t,value:l?Array.from(n):u?Object.fromEntries(n):n,parentValue:r,initialValue:n,keys:a,level:i+1}):(0,z.jsxs)(Lz,Y({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,z.jsx)(Vz,{keyName:t,value:n,keys:a,parentValue:r}),(0,z.jsx)(Az,{keyName:t,value:n,keys:a}),(0,z.jsx)(Rz,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};Hz.displayName=`JVR.KeyValuesItem`;var Sie=[`value`,`keyName`],Cie=[`as`,`render`],Uz=e=>{var{CountInfoExtra:t={}}=OR();return Nz(t,e,`CountInfoExtra`),null};Uz.displayName=`JVR.CountInfoExtra`;var Wz=e=>{var{value:t={},keyName:n}=e,r=WL(e,Sie),{CountInfoExtra:i={}}=OR(),{as:a,render:o}=i,s=WL(i,Cie);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=Y({},s,r);return l&&o(u,{value:t,keyName:n})||(0,z.jsx)(c,Y({},u))};Wz.displayName=`JVR.CountInfoExtraComps`;var wie=[`value`,`keyName`],Tie=[`as`,`render`],Gz=e=>{var{CountInfo:t={}}=OR();return Nz(t,e,`CountInfo`),null};Gz.displayName=`JVR.CountInfo`;var Kz=e=>{var{value:t={},keyName:n}=e,r=WL(e,wie),{displayObjectSize:i}=LR(),{CountInfo:a={}}=OR();if(!i)return null;var{as:o,render:s}=a,c=WL(a,Tie),l=o||`span`;c.style=Y({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=Y({},c,r);return s&&typeof s==`function`&&s(Y({},d,{"data-length":u}),{value:t,keyName:n})||(0,z.jsx)(l,Y({},d))};Kz.displayName=`JVR.CountInfoComp`;var Eie=[`as`,`render`],qz=e=>{var{Ellipsis:t={}}=OR();return Nz(t,e,`Ellipsis`),null};qz.displayName=`JVR.Ellipsis`;var Jz=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=OR(),{as:a,render:o}=i,s=WL(i,Eie),c=a||`span`;return o&&typeof o==`function`&&o(Y({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,z.jsx)(c,Y({},s)))};Jz.displayName=`JVR.EllipsisComp`;var Yz=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=nR(),l=aR(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=LR(),p=typeof d==`boolean`?d:typeof d==`number`?s>d:!1,m=c[n]??(f?!1:p),h=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!h);var g=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},_={display:`inline-flex`,alignItems:`center`},v={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},y=Object.keys(a).length,b=typeof a==`object`,x=Array.isArray(a),S=a instanceof Set,C=y!==0&&(x||S||b),w={style:_};C&&(w.onClick=g);var T={keyName:t,value:a,keys:r,parentValue:o};return(0,z.jsxs)(`span`,Y({},w,{children:[C&&(0,z.jsx)(QR,Y({style:v,expandKey:n},T)),(t||typeof t==`number`)&&(0,z.jsx)(Vz,Y({},T)),(0,z.jsx)(gz,{value:i,keyName:t}),(0,z.jsx)(_z,{value:i,keyName:t}),(0,z.jsx)($R,Y({isBrackets:x||S},T)),(0,z.jsx)(Jz,{keyName:t,value:a,isExpanded:m}),(0,z.jsx)(ez,Y({isVisiable:m||!C,isBrackets:x||S},T)),(0,z.jsx)(Kz,{value:a,keyName:t}),(0,z.jsx)(Wz,{value:a,keyName:t}),(0,z.jsx)(Rz,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};Yz.displayName=`JVR.NestedOpen`;var Die=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],Xz=(0,m.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=WL(e,Die),u=ZL(),d=zz();return(0,z.jsxs)(`div`,Y({className:[n,`w-rjv-inner`].filter(Boolean).join(` `),ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,z.jsx)(Yz,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,z.jsx)(Bz,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,z.jsx)(tz,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});Xz.displayName=`JVR.Container`;var Zz=e=>{var{BraceLeft:t={}}=bR();return jz(t,e,`BraceLeft`),null};Zz.displayName=`JVR.BraceLeft`;var Qz=e=>{var{BraceRight:t={}}=bR();return jz(t,e,`BraceRight`),null};Qz.displayName=`JVR.BraceRight`;var $z=e=>{var{BracketsLeft:t={}}=bR();return jz(t,e,`BracketsLeft`),null};$z.displayName=`JVR.BracketsLeft`;var eB=e=>{var{BracketsRight:t={}}=bR();return jz(t,e,`BracketsRight`),null};eB.displayName=`JVR.BracketsRight`;var tB=e=>{var{Arrow:t={}}=bR();return jz(t,e,`Arrow`),null};tB.displayName=`JVR.Arrow`;var nB=e=>{var{Colon:t={}}=bR();return jz(t,e,`Colon`),null};nB.displayName=`JVR.Colon`;var rB=e=>{var{Quote:t={}}=bR();return jz(t,e,`Quote`),null};rB.displayName=`JVR.Quote`;var iB=e=>{var{ValueQuote:t={}}=bR();return jz(t,e,`ValueQuote`),null};iB.displayName=`JVR.ValueQuote`;var aB=e=>{var{Bigint:t={}}=uR();return Mz(t,e,`Bigint`),null};aB.displayName=`JVR.Bigint`;var oB=e=>{var{Date:t={}}=uR();return Mz(t,e,`Date`),null};oB.displayName=`JVR.Date`;var sB=e=>{var{False:t={}}=uR();return Mz(t,e,`False`),null};sB.displayName=`JVR.False`;var cB=e=>{var{Float:t={}}=uR();return Mz(t,e,`Float`),null};cB.displayName=`JVR.Float`;var lB=e=>{var{Int:t={}}=uR();return Mz(t,e,`Int`),null};lB.displayName=`JVR.Int`;var uB=e=>{var{Map:t={}}=uR();return Mz(t,e,`Map`),null};uB.displayName=`JVR.Map`;var dB=e=>{var{Nan:t={}}=uR();return Mz(t,e,`Nan`),null};dB.displayName=`JVR.Nan`;var fB=e=>{var{Null:t={}}=uR();return Mz(t,e,`Null`),null};fB.displayName=`JVR.Null`;var pB=e=>{var{Set:t={}}=uR();return Mz(t,e,`Set`),null};pB.displayName=`JVR.Set`;var mB=e=>{var{Str:t={}}=uR();return Mz(t,e,`Str`),null};mB.displayName=`JVR.StringText`;var hB=e=>{var{True:t={}}=uR();return Mz(t,e,`True`),null};hB.displayName=`JVR.True`;var gB=e=>{var{Undefined:t={}}=uR();return Mz(t,e,`Undefined`),null};gB.displayName=`JVR.Undefined`;var _B=e=>{var{Url:t={}}=uR();return Mz(t,e,`Url`),null};_B.displayName=`JVR.Url`;var vB=e=>{var{Copied:t={}}=OR();return Nz(t,e,`Copied`),null};vB.displayName=`JVR.Copied`;var Oie=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],yB=(0,m.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:h=!1,onExpand:g,onCopied:_,beforeCopy:v}=e,y=WL(e,Oie),b=Y({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),x=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,z.jsxs)(RR,{initialState:{value:i,objectSortKeys:h,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:_,onExpand:g,beforeCopy:v},initialTypes:{displayDataTypes:m},children:[(0,z.jsx)(Xz,Y({value:i},y,{ref:t,className:x,style:b})),a]})});yB.Bigint=aB,yB.Date=oB,yB.False=sB,yB.Float=cB,yB.Int=lB,yB.Map=uB,yB.Nan=dB,yB.Null=fB,yB.Set=pB,yB.String=mB,yB.True=hB,yB.Undefined=gB,yB.Url=_B,yB.ValueQuote=iB,yB.Arrow=tB,yB.Colon=nB,yB.Quote=rB,yB.Ellipsis=qz,yB.BraceLeft=Zz,yB.BraceRight=Qz,yB.BracketsLeft=$z,yB.BracketsRight=eB,yB.Copied=vB,yB.CountInfo=Gz,yB.CountInfoExtra=Uz,yB.KeyName=Pz,yB.Row=Iz,yB.displayName=`JVR.JsonView`;var kie=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:12,cy:12,r:10}),(0,z.jsx)(`path`,{d:`m9 12l2 2l4-4`})]})}),bB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m6 9l6 6l6-6`})}),xB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m9 18l6-6l-6-6`})}),SB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`circle`,{cx:12,cy:12,r:10,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2})}),CB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}),(0,z.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5M10 9H8m8 4H8m8 4H8`})]})}),wB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`})}),Aie=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:12,cy:12,r:10}),(0,z.jsx)(`path`,{d:`M8 12h8`})]})}),TB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})}),EB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:12,cy:12,r:10}),(0,z.jsx)(`path`,{d:`m15 9l-6 6m0-6l6 6`})]})}),DB=`sonamu.ui.test-result-viewer.v1`,jie=100,OB=5*1024*1024;function Mie(){try{let e=sessionStorage.getItem(DB);if(e===null)return{runs:[]};let t=JSON.parse(e);return Pie(t)?t:{runs:[]}}catch{return{runs:[]}}}function Nie(e){return new TextEncoder().encode(e).length}function kB(e){let t=JSON.stringify(e),n=Nie(t);try{return sessionStorage.setItem(DB,t),{ok:!0}}catch(t){if(AB(t)&&e.runs.length>1){let t={runs:e.runs.slice(0,Math.ceil(e.runs.length/2))};try{return sessionStorage.setItem(DB,JSON.stringify(t)),{ok:!0}}catch{return{ok:!1,reason:`quota-exceeded`,payloadBytes:n,quotaHintBytes:OB}}}return AB(t)?{ok:!1,reason:`quota-exceeded`,payloadBytes:n,quotaHintBytes:OB}:(console.warn(`[sonamu] sessionStorage write failed:`,t),{ok:!0})}}function AB(e){return e instanceof DOMException?e.name===`QuotaExceededError`||e.code===22:!1}function Pie(e){if(typeof e!=`object`||!e)return!1;let t=e;return Array.isArray(t.runs)}function Fie(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function Iie(){let[e,t]=(0,m.useState)(Mie),[n,r]=(0,m.useState)(null),i=(0,m.useRef)(new Set);return{history:e,storageWarning:n,addRun:(0,m.useCallback)(e=>{t(t=>{let n={...e,dateKey:Fie(e.finishedAt)},a=[n,...t.runs];a.sort((e,t)=>new Date(t.finishedAt).getTime()-new Date(e.finishedAt).getTime());let o=a.slice(0,jie),s={runs:o},c=o.filter(e=>!i.current.has(e.runId)),l=kB({runs:c});return!l.ok&&l.reason===`quota-exceeded`?(i.current.add(n.runId),kB({runs:c.filter(e=>e.runId!==n.runId)}),r({runId:n.runId,reason:`quota-exceeded`,payloadBytes:l.payloadBytes,quotaHintBytes:l.quotaHintBytes})):r(null),s})},[]),clearHistory:(0,m.useCallback)(()=>{t({runs:[]}),r(null),i.current.clear();try{sessionStorage.removeItem(DB)}catch{}},[])}}function jB(e){return typeof e==`object`&&!!e}function MB(e){return e.schemaVersion===1}function Lie(e){return jB(e)?typeof e.ready==`boolean`&&typeof e.running==`boolean`&&(e.lastRunAt===null||typeof e.lastRunAt==`string`):!1}function Rie(e){return!jB(e)||!MB(e)?!1:typeof e.serverTime==`string`&&Lie(e.status)}function zie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.queuedAt==`string`&&jB(e.request)}function Bie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.startedAt==`string`}function Vie(e){if(!jB(e)||!MB(e)||typeof e.runId!=`string`||typeof e.startedAt!=`string`||typeof e.finishedAt!=`string`||!jB(e.result))return!1;let t=e.result;return typeof t.ok==`boolean`&&jB(t.summary)&&Array.isArray(t.results)}function Hie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.finishedAt==`string`&&jB(e.error)&&typeof e.error.message==`string`}function Uie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.startedAt==`string`&&typeof e.at==`string`&&(e.kind===`file`||e.kind===`suite`||e.kind===`test`)&&(e.phase===`ready`||e.phase===`result`)&&typeof e.fileId==`string`&&typeof e.nodeId==`string`&&(e.parentId===null||typeof e.parentId==`string`)&&jB(e.node)}function Wie(e){return!jB(e)||!MB(e)?!1:typeof e.at==`string`}var Gie={snapshot:Rie,runQueued:zie,runStarted:Bie,runCompleted:Vie,runErrored:Hie,runNodeProgress:Uie,heartbeat:Wie},Kie=`/__test__/events`,qie=3e4;function Jie(e){let t=e?.enabled??!0,[n,r]=(0,m.useState)(!1),i=(0,m.useRef)(null),a=(0,m.useRef)(new Map),o=(0,m.useRef)(0),s=(0,m.useRef)(null),c=(0,m.useRef)(!1),l=(0,m.useCallback)(()=>{if(c.current)return;let e=new EventSource(Kie);i.current=e,e.onopen=()=>{c.current||(o.current=0,r(!0))},e.onerror=()=>{c.current||(e.close(),i.current=null,r(!1),u())};for(let t of[`snapshot`,`runQueued`,`runStarted`,`runCompleted`,`runErrored`,`runNodeProgress`,`heartbeat`])e.addEventListener(t,e=>{if(!c.current)try{let n=JSON.parse(e.data),r=Gie[t];if(r(n)){let e=a.current.get(t);if(e)for(let t of e)t(n)}}catch{}})},[]),u=(0,m.useCallback)(()=>{if(c.current)return;let e=Math.min(1e3*2**o.current,qie);o.current+=1,s.current=setTimeout(()=>{s.current=null,l()},e)},[l]);return(0,m.useEffect)(()=>{if(c.current=!1,t)return l(),()=>{c.current=!0,s.current!==null&&(clearTimeout(s.current),s.current=null),i.current&&=(i.current.close(),null)}},[l,t]),{connected:n,on:(0,m.useCallback)((e,t)=>{let n=a.current.get(e);n||(n=new Set,a.current.set(e,n));let r=t;return n.add(r),()=>{n.delete(r)}},[])}}var Yie=hP(`/test-results`)({component:Zie});function NB(e){let t=0,n=0,r=0,i=0;for(let a of e)t+=a.counts.total,n+=a.counts.passed,r+=a.counts.failed,i+=a.counts.skipped;return{total:t,passed:n,failed:r,skipped:i}}function PB(e,t){return t.some(e=>e.state===`running`)?`running`:t.some(e=>e.state===`failed`)?`failed`:t.every(e=>e.state===`passed`||e.state===`skipped`||e.state===`todo`)?t.some(e=>e.state===`passed`)?`passed`:`skipped`:e.state}function FB(e,t,n,r){if(e.id===t){let t=e.children.findIndex(e=>e.id===n.id),i;if(t>=0){if(r===`ready`&&e.children[t].state!==`running`)return e;i=[...e.children],i[t]=n}else i=[...e.children,n];let a=NB(i),o=PB(e,i);return{...e,children:i,counts:a,state:o}}let i=!1,a=e.children.map(e=>{if(i)return e;let a=FB(e,t,n,r);return a!==e&&(i=!0),a});if(!i)return e;let o=NB(a),s=PB(e,a);return{...e,children:a,counts:o,state:s}}function Xie(e,t){if(!e||t.runId!==e.runId)return e;let n=new Map(e.fileResults);if(t.kind===`file`||t.parentId===null)t.phase===`ready`&&n.has(t.fileId)||n.set(t.fileId,t.node);else{let r=n.get(t.fileId);if(!r)return e;let i=FB(r,t.parentId,t.node,t.phase);n.set(t.fileId,i)}return{...e,fileResults:n}}function Zie(){let{SD:e}=kP(),t=J.useTestStatus(),n=t.data?.sseAvailable??!1,{connected:r,on:i}=Jie({enabled:n}),{history:a,storageWarning:o,addRun:s,clearHistory:c}=Iie(),[l,u]=(0,m.useState)(null),[d,f]=(0,m.useState)(!0),[p,h]=(0,m.useState)(null),[g,_]=(0,m.useState)(null),[v,y]=(0,m.useState)(null),b=(0,m.useRef)([]),x=(0,m.useRef)(null),S=(0,m.useCallback)(()=>(x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),b.current.splice(0)),[]),C=(0,m.useCallback)(()=>{x.current===null&&(x.current=requestAnimationFrame(()=>{x.current=null;let e=b.current.splice(0);e.length!==0&&y(t=>{let n=t;for(let t of e)n=Xie(n,t);return n})}))},[]);(0,m.useEffect)(()=>{f(!r)},[r]),(0,m.useEffect)(()=>{let e=[];return e.push(i(`snapshot`,e=>{u(e.status)})),e.push(i(`runStarted`,e=>{b.current.length=0,x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),u(e=>e&&{...e,running:!0}),y({runId:e.runId,startedAt:e.startedAt,fileResults:new Map}),h(null)})),e.push(i(`runNodeProgress`,e=>{b.current.push(e),C()})),e.push(i(`runCompleted`,e=>{S(),u(t=>t&&{...t,running:!1,lastRunAt:e.finishedAt}),s({runId:e.runId,startedAt:e.startedAt,finishedAt:e.finishedAt,result:e.result}),y(null),h(e.runId)})),e.push(i(`runErrored`,e=>{S(),u(t=>t&&{...t,running:!1,lastRunAt:e.finishedAt}),y(null)})),()=>{for(let t of e)t();x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),b.current.length=0}},[i,s,S,C]);let w=(0,m.useMemo)(()=>p?a.runs.find(e=>e.runId===p)??null:null,[p,a.runs]),T=(0,m.useMemo)(()=>!w||!o||o.runId!==w.runId?null:o,[w,o]),E=(0,m.useMemo)(()=>v?Array.from(v.fileResults.values()):null,[v]),D=(0,m.useMemo)(()=>{if(!E)return null;let e=0,t=0,n=0,r=0,i=0;for(let a of E)e+=a.counts.total,t+=a.counts.passed,n+=a.counts.failed,r+=a.counts.skipped,a.durationMs&&(i+=a.durationMs);return{total:e,passed:t,failed:n,skipped:r,durationMs:i}},[E]),O=!p&&v!==null,k=(0,m.useMemo)(()=>O&&E?E:w?w.result.results:null,[O,E,w]),A=(0,m.useMemo)(()=>{if(!k)return new Map;let e=new Map,t=n=>{for(let r of n)e.set(r.id,r),r.children.length>0&&t(r.children)};return t(k),e},[k]),j=(0,m.useMemo)(()=>g?A.get(g)??null:null,[A,g]),M=(0,m.useCallback)(e=>{h(e),_(null)},[]),N=(0,m.useCallback)(()=>{h(null),_(null)},[]);return t.isSuccess&&!n?(0,z.jsx)(`div`,{className:`flex items-center justify-center h-[calc(100vh-var(--gnb-height,48px))]`,children:(0,z.jsx)(`div`,{className:`text-center`,children:(0,z.jsx)(`p`,{className:`text-gray-600 text-sm`,children:e(`testResults.sseNotAvailable`)})})}):(0,z.jsxs)(`div`,{className:`flex flex-col h-[calc(100vh-var(--gnb-height,48px))]`,children:[(0,z.jsx)(Qie,{connected:r,connecting:d,managerStatus:l}),(0,z.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,z.jsx)($ie,{runs:a.runs,selectedRunId:p,onSelectRun:M,onClearHistory:c,liveRun:v,showLiveRun:O,onSelectLiveRun:N}),(0,z.jsx)(`div`,{className:`flex-1 overflow-auto`,children:O&&E&&D?(0,z.jsx)(rae,{results:E,summary:D,selectedNodeId:g,selectedNode:j,onSelectNode:_}):w?(0,z.jsx)(nae,{run:w,storageWarning:T,selectedNodeId:g,selectedNode:j,onSelectNode:_}):(0,z.jsx)(`div`,{className:`flex items-center justify-center h-full text-gray-400`,children:e(`testResults.noHistory`)})})]})]})}function Qie({connected:e,connecting:t,managerStatus:n}){let{SD:r}=kP();return(0,z.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2 bg-gray-50 border-b border-gray-200 text-sm shrink-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block w-2.5 h-2.5 rounded-full`,{"bg-green-500":e,"bg-yellow-400 animate-pulse":t&&!e,"bg-gray-400":!e&&!t})}),(0,z.jsx)(`span`,{className:`text-gray-600`,children:r(e?`testResults.connected`:t?`testResults.connecting`:`testResults.disconnected`)})]}),n?.running&&(0,z.jsx)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 bg-blue-100 text-blue-700 text-xs font-medium rounded-full animate-pulse`,children:`Running`})]})}function $ie({runs:e,selectedRunId:t,onSelectRun:n,onClearHistory:r,liveRun:i,showLiveRun:a,onSelectLiveRun:o}){let{SD:s}=kP(),c=(0,m.useMemo)(()=>{let t=new Map;for(let n of e){let e=t.get(n.dateKey);e?e.push(n):t.set(n.dateKey,[n])}let n=Array.from(t.entries());return n.sort((e,t)=>t[0].localeCompare(e[0])),n},[e]);return(0,z.jsxs)(`div`,{className:`w-60 shrink-0 flex flex-col border-r border-gray-200 bg-gray-50 overflow-hidden`,children:[(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2`,children:[i&&(0,z.jsx)(`button`,{type:`button`,"aria-label":s(`testResults.liveRunning`),className:(0,kL.default)(`w-full text-left px-2 py-1.5 rounded text-sm cursor-pointer transition-colors mb-2`,{"bg-blue-100 text-blue-900":a,"hover:bg-gray-200":!a}),onClick:o,children:(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full bg-blue-500 animate-pulse`}),(0,z.jsx)(`span`,{className:`text-xs font-semibold text-blue-700`,children:s(`testResults.liveRunning`)})]})}),e.length===0&&!i?(0,z.jsx)(`div`,{className:`text-center text-gray-400 text-sm py-8`,children:s(`testResults.noHistory`)}):c.map(([e,r])=>(0,z.jsxs)(`div`,{className:`mb-3`,children:[(0,z.jsx)(`div`,{className:`text-xs font-semibold text-gray-500 px-2 py-1`,children:e}),r.map(e=>(0,z.jsx)(`button`,{type:`button`,className:(0,kL.default)(`w-full text-left px-2 py-1.5 rounded text-sm cursor-pointer transition-colors`,{"bg-blue-100 text-blue-900":t===e.runId,"hover:bg-gray-200":t!==e.runId}),onClick:()=>n(e.runId),children:(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,z.jsx)(eae,{summary:e.result.summary}),(0,z.jsx)(`span`,{className:`text-xs text-gray-400 ml-auto`,children:tae(e.finishedAt)})]})},e.runId))]},e))]}),e.length>0&&(0,z.jsx)(`div`,{className:`p-2 border-t border-gray-200`,children:(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(TB,{}),onClick:r,className:`w-full`,children:s(`testResults.clearHistory`)})})]})}function eae({summary:e}){return(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.passed>0&&(0,z.jsx)(`span`,{className:`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded bg-green-100 text-green-700`,children:e.passed}),e.failed>0&&(0,z.jsx)(`span`,{className:`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded bg-red-100 text-red-700`,children:e.failed}),e.skipped>0&&(0,z.jsx)(`span`,{className:`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded bg-gray-100 text-gray-500`,children:e.skipped})]})}function tae(e){let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`}function nae({run:e,storageWarning:t,selectedNodeId:n,selectedNode:r,onSelectNode:i}){return(0,z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,z.jsx)(IB,{summary:e.result.summary,storageWarning:t}),(0,z.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,z.jsx)(zB,{results:e.result.results,selectedNodeId:n,onSelectNode:i}),(0,z.jsx)(VB,{node:r})]})]})}function rae({results:e,summary:t,selectedNodeId:n,selectedNode:r,onSelectNode:i}){return(0,z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,z.jsx)(IB,{summary:t}),(0,z.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,z.jsx)(zB,{results:e,selectedNodeId:n,onSelectNode:i}),(0,z.jsx)(VB,{node:r})]})]})}function IB({summary:e,storageWarning:t=null}){let{SD:n}=kP();return(0,z.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-3 bg-white border-b border-gray-200 text-sm shrink-0`,children:[(0,z.jsxs)(`span`,{className:`text-gray-600`,children:[n(`testResults.summary.total`),`: `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.total})]}),(0,z.jsxs)(`span`,{className:`text-green-600`,children:[n(`testResults.summary.passed`),`: `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.passed})]}),(0,z.jsxs)(`span`,{className:`text-red-600`,children:[n(`testResults.summary.failed`),`: `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.failed})]}),(0,z.jsxs)(`span`,{className:`text-gray-500`,children:[n(`testResults.summary.skipped`),`:`,` `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.skipped})]}),(0,z.jsxs)(`span`,{className:`text-gray-500`,children:[n(`testResults.summary.duration`),`:`,` `,(0,z.jsx)(`span`,{className:`font-mono`,children:LB(e.durationMs)})]}),t?.reason===`quota-exceeded`&&(0,z.jsxs)(`span`,{className:`text-amber-700 text-xs`,children:[n(`testResults.storageWarning.quotaExceeded`),` (`,n(`testResults.storageWarning.limit`),`: `,RB(t.quotaHintBytes),`,`,n(`testResults.storageWarning.resultSize`),`:`,` `,RB(t.payloadBytes),`)`]})]})}function LB(e){return e>=6e4?`${(e/6e4).toFixed(1)}m`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(2)}ms`}function RB(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(2)}MB`:e>=1024?`${(e/1024).toFixed(1)}KB`:`${e}B`}function iae(e){let t=new Set,n=e=>{if(e.children.length===0)return e.state===`failed`;let r=!1;for(let t of e.children)n(t)&&(r=!0);return r&&t.add(e.id),r};for(let r of e)t.add(r.id),n(r);return t}function aae(e,t){let n=e=>{if(e.name.toLowerCase().includes(t))return e;let r=e.children.flatMap(e=>{let t=n(e);return t?[t]:[]});return r.length>0?{...e,children:r}:null};return e.flatMap(e=>{let t=n(e);return t?[t]:[]})}function oae(e){let t=new Set,n=e=>{t.add(e.id);for(let t of e.children)n(t)};for(let t of e)n(t);return t}function sae(e,t){let n=[],r=(e,i)=>{let a=e.children.length>0;if(n.push({node:e,depth:i,hasChildren:a}),a&&t.has(e.id))for(let t of e.children)r(t,i+1)};for(let t of e)r(t,0);return n}function zB({results:e,selectedNodeId:t,onSelectNode:n}){let{SD:r}=kP(),[i,a]=(0,m.useState)(()=>iae(e)),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(``),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{let e=setTimeout(()=>l(o),300);return()=>clearTimeout(e)},[o]);let d=(0,m.useMemo)(()=>{let t=c.toLowerCase();return t?aae(e,t):e},[e,c]);(0,m.useEffect)(()=>{c?(u.current===null&&(u.current=new Set(i)),a(oae(d))):u.current!==null&&(a(u.current),u.current=null)},[c,d]);let f=(0,m.useRef)(e);(0,m.useEffect)(()=>{if(f.current!==e){if(f.current=e,u.current!==null)return;a(t=>{let n=new Set(t),r=e=>{if(e.children.length===0)return e.state===`failed`;let t=!1;for(let n of e.children)r(n)&&(t=!0);return t&&n.add(e.id),t};for(let t of e)n.has(t.id)||n.add(t.id),r(t);return n})}},[e]);let p=(0,m.useMemo)(()=>sae(d,i),[d,i]),h=(0,m.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return(0,z.jsxs)(`div`,{className:`w-120 shrink-0 border-r border-gray-200 overflow-y-auto p-2`,children:[(0,z.jsxs)(`div`,{className:`relative mb-2`,children:[(0,z.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:r(`testResults.tree.searchPlaceholder`),className:`w-full text-xs px-2 py-1 pr-6 border border-gray-200 rounded outline-none focus:border-blue-400`}),o&&(0,z.jsx)(`button`,{type:`button`,"aria-label":r(`testResults.tree.clearSearch`),className:`absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600`,onClick:()=>{s(``),l(``)},children:(0,z.jsx)(EB,{className:`w-3.5 h-3.5`})})]}),p.map(e=>(0,z.jsx)(cae,{row:e,isSelected:t===e.node.id,expanded:i.has(e.node.id),onSelectNode:n,onToggleExpand:h},e.node.id)),c&&p.length===0&&(0,z.jsx)(`div`,{className:`text-xs text-gray-400 px-2 py-1`,children:r(`testResults.tree.noMatches`)})]})}var cae=(0,m.memo)(function({row:e,isSelected:t,expanded:n,onSelectNode:r,onToggleExpand:i}){return(0,z.jsxs)(`button`,{type:`button`,className:(0,kL.default)(`w-full flex items-center gap-1.5 px-2 py-1 rounded text-sm cursor-pointer transition-colors text-left`,{"bg-blue-100":t,"hover:bg-gray-100":!t}),style:{paddingLeft:`${e.depth*16+8}px`},onClick:()=>{r(e.node.id),e.hasChildren&&i(e.node.id)},children:[e.hasChildren?n?(0,z.jsx)(bB,{className:`w-3.5 h-3.5 text-gray-400 shrink-0`}):(0,z.jsx)(xB,{className:`w-3.5 h-3.5 text-gray-400 shrink-0`}):(0,z.jsx)(`span`,{className:`w-3.5 shrink-0`}),(0,z.jsx)(BB,{state:e.node.state,kind:e.node.kind}),(0,z.jsx)(`span`,{className:(0,kL.default)(`truncate`,{"text-red-600":e.node.state===`failed`,"text-green-700":e.node.state===`passed`,"text-gray-400":e.node.state===`skipped`||e.node.state===`todo`}),children:e.node.name}),e.node.durationMs!==null&&(0,z.jsx)(`span`,{className:`ml-auto text-xs text-gray-400 font-mono shrink-0`,children:LB(e.node.durationMs)})]})});function BB({state:e,kind:t}){return t===`file`?(0,z.jsx)(CB,{className:(0,kL.default)(`w-4 h-4 shrink-0`,{"text-green-600":e===`passed`,"text-red-500":e===`failed`,"text-gray-400":e===`skipped`||e===`todo`||e===`unknown`,"text-blue-500":e===`running`})}):t===`suite`?(0,z.jsx)(wB,{className:(0,kL.default)(`w-4 h-4 shrink-0`,{"text-green-600":e===`passed`,"text-red-500":e===`failed`,"text-gray-400":e===`skipped`||e===`todo`||e===`unknown`,"text-blue-500":e===`running`})}):e===`passed`?(0,z.jsx)(kie,{className:`w-4 h-4 text-green-600 shrink-0`}):e===`failed`?(0,z.jsx)(EB,{className:`w-4 h-4 text-red-500 shrink-0`}):e===`skipped`||e===`todo`?(0,z.jsx)(Aie,{className:`w-4 h-4 text-gray-400 shrink-0`}):(0,z.jsx)(SB,{className:`w-4 h-4 text-gray-400 shrink-0`})}var VB=(0,m.memo)(function({node:e}){return e?(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4 space-y-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,z.jsx)(BB,{state:e.state,kind:e.kind}),(0,z.jsx)(`span`,{className:`font-semibold`,children:e.fullName}),e.durationMs!==null&&(0,z.jsx)(`span`,{className:`text-gray-400 font-mono text-xs`,children:LB(e.durationMs)})]}),e.error&&(0,z.jsx)(lae,{error:e.error}),(0,z.jsx)(dae,{traces:e.traces})]}):(0,z.jsx)(`div`,{className:`flex-1`})});function lae({error:e}){let{SD:t}=kP();return(0,z.jsxs)(`div`,{className:`border border-red-200 rounded-md overflow-hidden`,children:[(0,z.jsx)(`div`,{className:`px-3 py-1.5 bg-red-50 text-red-700 text-xs font-semibold border-b border-red-200`,children:t(`testResults.detail.error`)}),(0,z.jsxs)(`pre`,{className:`p-3 text-xs text-red-800 bg-red-50/50 overflow-x-auto whitespace-pre-wrap`,children:[e.message,e.stack&&`\n\n${e.stack}`]})]})}function uae(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}function HB(e,t){if(!t)return e;let n=e.toLowerCase(),r=t.toLowerCase(),i=[],a=0,o=n.indexOf(r,a);for(;o!==-1;)o>a&&i.push(e.slice(a,o)),i.push((0,z.jsx)(`mark`,{className:`bg-yellow-200 text-yellow-900`,children:e.slice(o,o+r.length)},o)),a=o+r.length,o=n.indexOf(r,a);return a<e.length&&i.push(e.slice(a)),i.length>0?i:e}function dae({traces:e}){let{SD:t}=kP(),[n,r]=(0,m.useState)(()=>new Set),[i,a]=(0,m.useState)(``),[o,s]=(0,m.useState)(``),c=(0,m.useRef)(new Map),l=(0,m.useRef)(e);l.current!==e&&(l.current=e,c.current.clear()),(0,m.useEffect)(()=>{let e=setTimeout(()=>s(i),300);return()=>clearTimeout(e)},[i]);let u=(0,m.useMemo)(()=>{let t=o.toLowerCase();return e.reduce((e,n,r)=>{let i=`${n.key}-${n.at}-${r}`,a=c.current.get(i);return a===void 0&&(a=`${n.key} ${JSON.stringify(n.value)}`.toLowerCase(),c.current.set(i,a)),(!o||a.includes(t))&&e.push({trace:n,originalIndex:r}),e},[])},[e,o]),d=(0,m.useCallback)(e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),f=(0,m.useCallback)(()=>{r(new Set(e.map((e,t)=>`${e.key}-${e.at}-${t}`)))},[e]),p=(0,m.useCallback)(()=>{r(new Set)},[]);return(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-gray-600 mb-1`,children:[t(`testResults.detail.traces`),(0,z.jsxs)(`span`,{className:`flex gap-1 font-normal`,children:[(0,z.jsx)(`button`,{type:`button`,className:`text-blue-500 hover:text-blue-700`,onClick:f,children:t(`testResults.detail.expandAll`)}),(0,z.jsx)(`span`,{className:`text-gray-300`,children:`/`}),(0,z.jsx)(`button`,{type:`button`,className:`text-blue-500 hover:text-blue-700`,onClick:p,children:t(`testResults.detail.collapseAll`)})]})]}),(0,z.jsxs)(`div`,{className:`relative mb-1.5`,children:[(0,z.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:t(`testResults.detail.searchPlaceholder`),className:`w-full text-xs px-2 py-1 pr-6 border border-gray-200 rounded outline-none focus:border-blue-400`}),i&&(0,z.jsx)(`button`,{type:`button`,"aria-label":t(`testResults.detail.clearSearch`),className:`absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600`,onClick:()=>{a(``),s(``)},children:(0,z.jsx)(EB,{className:`w-3.5 h-3.5`})})]}),u.length===0&&e.length===0?(0,z.jsx)(`div`,{className:`text-xs text-gray-400`,children:t(`testResults.detail.noTraces`)}):u.length===0?(0,z.jsx)(`div`,{className:`text-xs text-gray-400`,children:t(`testResults.detail.noTraceMatches`)}):(0,z.jsx)(`div`,{className:`space-y-1.5`,children:u.map(({trace:e,originalIndex:t})=>{let r=`${e.key}-${e.at}-${t}`,i=n.has(r),a=uae(e.value),s=typeof a==`object`&&a?a:{value:a};return(0,z.jsxs)(`div`,{className:`text-xs border border-gray-100 rounded overflow-hidden`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`flex items-center w-full px-2 py-1 bg-gray-50 cursor-pointer text-left`,onClick:()=>d(r),children:[i?(0,z.jsx)(bB,{className:`w-3 h-3 text-gray-400 mr-1 shrink-0`}):(0,z.jsx)(xB,{className:`w-3 h-3 text-gray-400 mr-1 shrink-0`}),(0,z.jsx)(`span`,{className:`font-mono font-semibold text-blue-700`,children:e.key}),(0,z.jsxs)(`span`,{className:`ml-3 text-gray-400 text-[11px]`,children:[e.filePath,`:`,e.lineNumber]})]}),i&&(0,z.jsx)(`div`,{className:`px-2 py-1.5 overflow-x-auto`,children:(0,z.jsx)(yB,{value:s,collapsed:!1,displayDataTypes:!1,indentWidth:12,enableClipboard:!1,style:{fontSize:`12px`},children:o&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(yB.KeyName,{render:(e,{keyName:t})=>{let n=String(t);return(0,z.jsx)(`span`,{...e,children:HB(n,o)})}}),(0,z.jsx)(yB.String,{render:(e,{value:t})=>{let n=String(t);return(0,z.jsx)(`span`,{...e,children:HB(n,o)})}})]})})})]},r)})})]})}var fae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m15 18l-6-6l6-6`})}),UB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:12,cy:12,r:10}),(0,z.jsx)(`path`,{d:`M10 15V9m4 6V9`})]})}),WB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`}),(0,z.jsx)(`circle`,{cx:12,cy:12,r:10})]})}),GB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9a9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,z.jsx)(`path`,{d:`M21 3v5h-5m5 4a9 9 0 0 1-9 9a9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,z.jsx)(`path`,{d:`M8 16H3v5`})]})}),pae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,z.jsx)(`path`,{d:`M3 3v5h5`})]})}),KB={pending:`bg-yellow-100 text-yellow-800 border-yellow-200`,running:`bg-blue-100 text-blue-800 border-blue-200`,sleeping:`bg-purple-100 text-purple-800 border-purple-200`,succeeded:`bg-green-100 text-green-800 border-green-200`,completed:`bg-green-100 text-green-800 border-green-200`,failed:`bg-red-100 text-red-800 border-red-200`,paused:`bg-orange-100 text-orange-800 border-orange-200`,canceled:`bg-gray-100 text-gray-800 border-gray-200`};function qB(e,t){return e?new Date(e).toLocaleString(t??`ko`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):`-`}function JB(e,t){if(!e)return`-`;let n=new Date(e).getTime(),r=(t?new Date(t).getTime():Date.now())-n;return r<1e3?`${r}ms`:r<6e4?`${(r/1e3).toFixed(1)}s`:r<36e5?`${Math.floor(r/6e4)}m ${Math.floor(r%6e4/1e3)}s`:`${Math.floor(r/36e5)}h ${Math.floor(r%36e5/6e4)}m`}var mae={options:[`pending`,`running`,`sleeping`,`paused`,`completed`,`failed`,`canceled`]},hae={pending:`PENDING`,running:`RUNNING`,sleeping:`SLEEPING`,paused:`PAUSED`,completed:`COMPLETED`,failed:`FAILED`,canceled:`CANCELED`};function YB(e){return e>=6e4?`${e/6e4}m`:e>=1e3?`${e/1e3}s`:`${e}ms`}function gae(e){if(!e)return`-`;let t=[];return e.maxAttempts&&t.push(`최대 ${e.maxAttempts}회`),e.initialIntervalMs&&t.push(`초기 ${YB(e.initialIntervalMs)}`),e.backoffCoefficient&&t.push(`배수 ${e.backoffCoefficient}x`),e.maximumIntervalMs&&t.push(`최대간격 ${YB(e.maximumIntervalMs)}`),e.hasDynamicPolicy&&t.push(`(+ dynamic)`),t.length>0?t.join(` · `):`-`}function _ae({startedAt:e}){let[,t]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(n)},[e]),(0,z.jsx)(`span`,{className:`font-mono text-sm`,children:JB(e,null)})}var vae={succeeded:`bg-green-100 text-green-700 border-green-200`,completed:`bg-green-100 text-green-700 border-green-200`,running:`bg-blue-100 text-blue-700 border-blue-200 animate-pulse`,failed:`bg-red-100 text-red-700 border-red-200`};function yae({steps:e}){return e.length===0?null:(0,z.jsxs)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:[e.map((e,t)=>(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t>0&&(0,z.jsx)(`span`,{className:`text-gray-300 text-xs`,children:`→`}),(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block px-1.5 py-0.5 text-[11px] font-mono rounded border`,vae[e.status]??`bg-gray-100 text-gray-600 border-gray-200`),children:e.stepName})]},e.id)),(0,z.jsx)(`span`,{className:`text-gray-300 text-xs ml-0.5`,children:`→ ···`})]})}function bae({run:e}){let{SD:t}=kP(),[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(!1),{data:c}=J.useStepAttempts(e.id),l=c?.data??[],u=[`pending`,`running`,`sleeping`].includes(e.status),d=e.status===`paused`;return(0,z.jsxs)(`div`,{className:`flex items-center gap-4 p-3 bg-white border border-blue-200 rounded-md`,children:[(0,z.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,z.jsx)(mP,{to:`/tasks/$workflowRunId`,params:{workflowRunId:e.id},className:`text-blue-600 hover:underline no-underline font-medium text-sm truncate`,children:e.workflowName}),(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded border shrink-0`,KB[e.status]??`bg-gray-100 text-gray-800`),children:e.status.toUpperCase()})]}),l.length>0?(0,z.jsx)(yae,{steps:l}):(0,z.jsx)(`span`,{className:`text-xs text-gray-400`,children:t(`tasks.active.noStepsYet`)})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,z.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[(0,z.jsxs)(`span`,{className:`mr-1`,children:[t(`tasks.active.elapsed`),`:`]}),(0,z.jsx)(_ae,{startedAt:e.startedAt})]}),u&&(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(UB,{}),disabled:i,onClick:()=>{confirm(t(`tasks.pauseConfirm`))&&(a(!0),J.pauseWorkflowRun(e.id).catch(PL).finally(()=>a(!1)))},children:t(`tasks.pause`)}),d&&(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(WB,{}),disabled:o,onClick:()=>{s(!0),J.resumeWorkflowRun(e.id).catch(PL).finally(()=>s(!1))},children:t(`tasks.resume`)}),(0,z.jsx)(B,{size:`xs`,variant:`destructive`,icon:(0,z.jsx)(EB,{}),disabled:n,onClick:()=>{confirm(t(`tasks.cancelConfirm`))&&(r(!0),J.cancelWorkflowRun(e.id).catch(PL).finally(()=>r(!1)))},children:t(`tasks.cancel`)})]})]})}function xae(){let{SD:e}=kP(),{data:t}=J.useWorkflowRuns({status:[`pending`,`running`,`sleeping`,`paused`]}),n=t?.data??[];return n.length===0?null:(0,z.jsxs)(`div`,{className:`block p-4 bg-blue-50 border-2 border-blue-300 rounded-md shadow-sm mb-4`,children:[(0,z.jsx)(`h3`,{className:`text-lg font-semibold mb-3 text-blue-900`,children:e(`tasks.active.title`)}),(0,z.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map(e=>(0,z.jsx)(bae,{run:e},e.id))})]})}var Sae=hP(`/tasks`)({component:Cae});function Cae(){let{SD:e}=kP(),t=DP(),[n,r]=(0,m.useState)({}),[i,a]=(0,m.useState)([]),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(),[u,d]=(0,m.useState)(),{data:f}=J.useWorkflowDefinitions(),p=f?.definitions??[],h=(0,m.useMemo)(()=>({options:p.map(e=>e.name)}),[p]),g=(0,m.useMemo)(()=>Object.fromEntries(p.map(e=>[e.name,e.name])),[p]),_=i.length>0||o!==``||c||u,{data:v,error:y,refetch:b,isLoading:x}=J.useWorkflowRuns({limit:50,...n,...i.length>0?{status:i}:{},...o?{workflowName:o}:{},...c?{createdAfter:c.toISOString()}:{},...u?{createdBefore:u.toISOString()}:{}}),S=v?.data??[],C=v?.pagination;return y?(0,z.jsx)(`div`,{className:`p-8`,children:(0,z.jsx)(`div`,{className:`max-w-2xl mx-auto my-[30vh] p-8 bg-white border-2 border-red-500 rounded-md whitespace-pre-line leading-8`,children:y.message})}):(0,z.jsxs)(`div`,{className:`p-8`,children:[(0,z.jsx)(xae,{}),(0,z.jsxs)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm mb-4`,children:[(0,z.jsx)(`h3`,{className:`text-xl font-semibold mb-4`,children:e(`tasks.definitions`)}),p.length===0?(0,z.jsx)(`div`,{className:`text-center py-8 text-gray-400`,children:e(`tasks.noDefinitions`)}):(0,z.jsxs)(wj,{className:`text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsx)(Oj,{children:e(`tasks.workflowName`)}),(0,z.jsx)(Oj,{children:e(`tasks.version`)}),(0,z.jsx)(Oj,{children:e(`tasks.schedule`)}),(0,z.jsx)(Oj,{children:e(`tasks.retryPolicy`)})]})}),(0,z.jsx)(Ej,{children:p.map(e=>(0,z.jsxs)(Dj,{className:`hover:bg-gray-50`,children:[(0,z.jsx)(kj,{className:`font-medium`,children:e.name}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:e.version??(0,z.jsx)(`span`,{className:`italic text-gray-400`,children:`(unversioned)`})}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:e.schedules.length>0?e.schedules.map(e=>(0,z.jsxs)(`div`,{className:`mb-1 last:mb-0`,children:[(0,z.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,z.jsx)(`span`,{className:`ml-1 font-mono text-gray-400`,children:e.expression})]},e.name)):`-`}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:gae(e.retryPolicy)})]},e.id))})]})]}),(0,z.jsxs)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,z.jsx)(`h3`,{className:`text-xl font-semibold`,children:e(`tasks.title`)}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[e(`tasks.autoRefresh`),`: 5s`]}),(0,z.jsx)(B,{size:`xs`,icon:(0,z.jsx)(GB,{}),onClick:()=>b(),children:e(`common.refresh`)})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 mb-4 flex-wrap`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.status`)}),(0,z.jsx)(yg,{enum:mae,labels:hae,value:i,onValueChange:e=>{a(e??[]),r({})},multiple:!0,placeholder:e(`common.all`),className:`w-[200px]`})]}),h.options.length>0&&(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.workflowName`)}),(0,z.jsx)(yg,{enum:h,labels:g,value:o,onValueChange:e=>{s(e??``),r({})},clearable:!0,placeholder:e(`common.all`),className:`w-[200px]`})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.createdAfter`)}),(0,z.jsx)(ag,{value:c,onValueChange:e=>{l(e),r({})},className:`w-[180px]`})]}),(0,z.jsx)(`span`,{className:`text-gray-400`,children:`~`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.createdBefore`)}),(0,z.jsx)(ag,{value:u,onValueChange:e=>{d(e),r({})},className:`w-[180px]`})]}),_&&(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(pae,{}),onClick:()=>{a([]),s(``),l(void 0),d(void 0),r({})},children:e(`tasks.filter.reset`)})]}),x&&(0,z.jsx)(`div`,{className:`text-center py-8`,children:e(`common.loading`)}),!x&&(0,z.jsxs)(wj,{className:`text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsx)(Oj,{children:e(`tasks.workflowName`)}),(0,z.jsx)(Oj,{children:e(`tasks.version`)}),(0,z.jsx)(Oj,{children:e(`tasks.status`)}),(0,z.jsx)(Oj,{children:e(`tasks.attempts`)}),(0,z.jsx)(Oj,{children:e(`tasks.createdAt`)}),(0,z.jsx)(Oj,{children:e(`tasks.startedAt`)}),(0,z.jsx)(Oj,{children:e(`tasks.finishedAt`)}),(0,z.jsx)(Oj,{children:e(`tasks.duration`)})]})}),(0,z.jsxs)(Ej,{children:[S.length===0&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:8,className:`text-center py-8 text-gray-400`,children:e(`tasks.noData`)})}),S.map(e=>(0,z.jsxs)(Dj,{className:`hover:bg-gray-50`,children:[(0,z.jsx)(kj,{children:(0,z.jsx)(mP,{to:`/tasks/$workflowRunId`,params:{workflowRunId:e.id},className:`text-blue-600 hover:underline no-underline`,children:e.workflowName})}),(0,z.jsx)(kj,{className:`text-gray-500`,children:e.version??`-`}),(0,z.jsx)(kj,{children:(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block px-2 py-0.5 text-xs font-bold rounded border`,KB[e.status]??`bg-gray-100 text-gray-800`),children:e.status.toUpperCase()})}),(0,z.jsx)(kj,{className:`text-center`,children:e.attempts}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:qB(e.createdAt,t)}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:qB(e.startedAt,t)}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:qB(e.finishedAt,t)}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs font-mono`,children:JB(e.startedAt,e.finishedAt)})]},e.id))]})]}),C&&(C.prev||C.next)&&(0,z.jsxs)(`div`,{className:`flex justify-center gap-2 mt-4`,children:[(0,z.jsx)(B,{size:`sm`,variant:`outline`,icon:(0,z.jsx)(fae,{}),disabled:!C.prev,onClick:()=>{C.prev&&r({before:C.prev})},children:e(`tasks.prev`)}),(0,z.jsxs)(B,{size:`sm`,variant:`outline`,disabled:!C.next,onClick:()=>{C.next&&r({after:C.next})},children:[e(`tasks.next`),(0,z.jsx)(`span`,{children:(0,z.jsx)(xB,{className:`w-4 h-4`})})]})]})]})]})}var XB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M20 6L9 17l-5-5`})}),ZB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m16 18l6-6l-6-6M8 6l-6 6l6 6`})}),QB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`})}),$B=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M18 6L6 18M6 6l12 12`})}),wae=hP(`/scaffolding`)({component:Tae});function Tae({}){let{SD:e}=kP(),{data:t}=J.useEntities(),{entities:n}=t??{},[r,i]=(0,m.useState)({entityIds:[],templateKeys:[]}),[a,o]=(0,m.useState)({open:!1,pathAndCodes:null}),[s,c]=(0,m.useState)({}),l=(n??[]).filter(e=>!e.parentId),u=[`model`,`model_test`,`view_list`,`view_search_input`,`view_form`],d=e=>{i({...r,entityIds:e})},f=e=>{i({...r,templateKeys:u.filter(t=>e.includes(t))})},{data:p,isLoading:h,refetch:g}=J.useScaffoldingStatus(r),{statuses:_}=p??{},v=e=>[e.entityId,e.templateKey].join(`///`),y=[{label:`Entity`,tc:e=>(0,z.jsx)(z.Fragment,{children:e.entityId}),fit:!0},{label:`TemplateKey`,tc:e=>(0,z.jsx)(z.Fragment,{children:e.templateKey}),fit:!0},{label:e(`common.path`),tc:e=>(0,z.jsx)(z.Fragment,{children:e.subPath})},{label:e(`scaffolding.isExists`),tc:e=>(0,z.jsx)(z.Fragment,{children:e.isExists?(0,z.jsx)(B,{icon:(0,z.jsx)(ZB,{}),size:`xs`,variant:`yellow`,onClick:t=>{t.stopPropagation(),J.openVscode({absPath:e.fullPath})}}):(0,z.jsx)($B,{})}),fit:!0},{label:(0,z.jsx)(B,{size:`xs`,variant:`destructive`,icon:(0,z.jsx)(XB,{}),onClick:e=>{e.stopPropagation(),b()},children:e(`common.overwrite`)}),tc:e=>(0,z.jsx)(z.Fragment,{children:e.isExists&&(0,z.jsx)(el,{checked:s[v(e)]?.overwrite??!1,onCheckedChange:t=>{c({...s,[v(e)]:{overwrite:t??!1}})}})}),fit:!0},{label:e(`common.preview`),tc:t=>(0,z.jsx)(B,{size:`xs`,variant:`green`,onClick:e=>{e.stopPropagation(),S(t)},children:e(`common.preview`)}),fit:!0}],b=()=>{if(!_)return;let e=_.filter(e=>e.isExists);e.every(e=>s[v(e)]?.overwrite??!1)?c({}):c(e.reduce((e,t)=>(e[v(t)]={overwrite:!0},e),{}))},x=()=>{if(!_)return;let e=_.map(e=>({entityId:e.entityId,templateKey:e.templateKey,overwrite:s[v(e)]?.overwrite??!1}));J.scaffoldingGenerate(e).then(()=>{g()}).catch(PL)},S=e=>{J.scaffoldingPreview(e).then(({pathAndCodes:e})=>{o({open:!0,pathAndCodes:e})}).catch(PL)};return(0,z.jsxs)(`div`,{className:`flex justify-start min-h-[calc(100vh-50px)]`,children:[(0,z.jsxs)(`div`,{className:`bg-sidebar-bg text-white pl-4 pr-0 h-[calc(100vh-var(--spacing-gnb))] sticky left-0 top-gnb w-[250px] overflow-y-auto`,children:[(0,z.jsx)(`h3`,{children:e(`scaffolding.entities`)}),(0,z.jsx)(`div`,{className:`py-3 text-center`,children:r.entityIds.length===l.length?(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>d([]),children:e(`scaffolding.uncheckAllEntities`)}):(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>d(l.map(e=>e.id)),children:e(`scaffolding.checkAllEntities`)})}),l.map(e=>(0,z.jsx)(`div`,{className:`flex items-center pb-2`,id:e.id,children:(0,z.jsx)(el,{checked:r.entityIds.includes(e.id),label:e.id,onCheckedChange:t=>{d(t?[...r.entityIds,e.id]:r.entityIds.filter(t=>t!==e.id))}})},e.id))]}),(0,z.jsx)(`div`,{className:`bg-sidebar-bg pl-8 border-l border-[#85aa8a] h-[calc(100vh-var(--spacing-gnb))] sticky left-0 top-gnb text-white w-[250px] overflow-y-auto`,children:(0,z.jsxs)(`div`,{className:`pb-4`,children:[(0,z.jsx)(`h4`,{className:`mb-1`,children:e(`scaffolding.template`).replace(`{name}`,`Entity`)}),(0,z.jsx)(`div`,{className:`py-3 text-center`,children:r.templateKeys.length===u.length?(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>f([]),children:e(`scaffolding.uncheckAll`)}):(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>f(u),children:e(`scaffolding.checkAll`)})}),u.map(e=>(0,z.jsx)(`div`,{className:`flex items-center pb-2`,children:(0,z.jsx)(el,{checked:r.templateKeys.includes(e),label:e,onCheckedChange:t=>{f(t?[...r.templateKeys,e]:r.templateKeys.filter(t=>t!==e))}})},e))]})}),(0,z.jsx)(`div`,{className:`flex-1 p-4`,children:(0,z.jsxs)(`div`,{children:[!_&&!h&&(0,z.jsx)(`div`,{className:`w-[50em] my-[30vh] mx-auto whitespace-pre-line p-[3em] bg-white leading-[2em] border-2 border-orange-500`,children:e(`scaffolding.selectPrompt`)}),_&&(0,z.jsxs)(`div`,{children:[_.length>0&&(0,z.jsx)(B,{size:`sm`,variant:`default`,icon:(0,z.jsx)(QB,{}),onClick:()=>x(),children:e(`scaffolding.generateTemplates`).replace(`{count}`,String(_.length)).replace(`{overwriteCount}`,String(Object.keys(s).length))}),(0,z.jsxs)(wj,{className:`mt-4 text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsx)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:y.map((e,t)=>(0,z.jsx)(Oj,{fit:e.fit,className:`py-2 px-3`,children:e.label},t))})}),(0,z.jsx)(Ej,{children:_.map((e,t)=>(0,z.jsx)(m.Fragment,{children:(0,z.jsx)(Dj,{className:e.isExists?`bg-red-50`:`bg-green-50`,children:y.map((t,n)=>(0,z.jsx)(kj,{fit:t.fit,className:`py-2 px-3`,children:t.tc(e)},n))})},t))})]})]})]})}),(0,z.jsx)(td,{open:a.open,onOpenChange:e=>{e||o({open:!1,pathAndCodes:null})},children:(0,z.jsxs)(id,{className:`max-w-4xl max-h-[80vh] overflow-y-auto`,children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{children:e(`scaffolding.previewTitle`)}),(0,z.jsx)(cd,{children:e(`scaffolding.previewDesc`)})]}),(0,z.jsx)(`div`,{className:`space-y-4`,children:a.pathAndCodes?.map(e=>(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`mb-2 text-lg font-bold text-gray-700`,children:e.path}),(0,z.jsx)(`pre`,{className:`bg-green-50 text-gray-900 p-4 rounded-lg overflow-x-auto text-sm font-mono leading-relaxed`,children:(0,z.jsx)(`code`,{children:e.code})})]},e.path))??(0,z.jsx)(`p`,{children:e(`scaffolding.noPreviewData`)})})]})})]})}var Eae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:9,cy:12,r:3}),(0,z.jsx)(`rect`,{width:20,height:14,x:2,y:5,rx:7})]})}),Dae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:15,cy:12,r:3}),(0,z.jsx)(`rect`,{width:20,height:14,x:2,y:5,rx:7})]})}),eV=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})}),tV=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21 12a9 9 0 1 1-6.219-8.56`})});function Oae({action:e,targets:t,conns:n,open:r,onOpenChange:i,onCompleted:a}){let[o,s]=(0,m.useState)(!1),{form:c,register:l}=eM(Uk({doShadowDbTesting:_k()}),{doShadowDbTesting:e===`apply`}),[u,d]=(0,m.useState)({status:`idle`}),[f,p]=(0,m.useState)(!1),[h,g]=(0,m.useState)(``),_=(0,m.useRef)(null),v=(n,r)=>{_.current=setInterval(async()=>{try{let{approved:o,rejected:s}=await J.migrationsCheckApproval(n,r);o?(y(),`type`in await J.migrationsRunAction(e,t)||(i(!1),a?.())):s&&(y(),d({status:`rejected`}))}catch(e){console.error(`Polling error:`,e)}},2e3)},y=()=>{_.current&&=(clearInterval(_.current),null)};(0,m.useEffect)(()=>{r||(y(),d({status:`idle`}),g(``))},[r]),(0,m.useEffect)(()=>()=>y(),[]);let b=async()=>{s(!0);try{c.doShadowDbTesting&&await J.migrationsRunAction(`shadow`,t);let n=await J.migrationsRunAction(e,t);`type`in n&&n.type===`pending`?(d({status:`pending`,channel:n.channel,ts:n.ts}),v(n.channel,n.ts)):(i(!1),a?.())}catch(e){PL(e)}finally{s(!1)}},x=async()=>{if(!(!u.channel||!u.ts)){s(!0);try{await J.migrationsForceApproval(u.channel,u.ts,h),`type`in await J.migrationsRunAction(e,t,{force:!0,forceReason:h})||(i(!1),a?.())}catch(e){PL(e)}finally{s(!1),p(!1)}}};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(td,{open:r,onOpenChange:i,children:(0,z.jsxs)(id,{className:`max-w-4xl max-h-[90vh] flex flex-col`,children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{children:`Migrations Action Form`}),(0,z.jsxs)(cd,{children:[`Execute migration action: `,e.toUpperCase()]})]}),(0,z.jsx)(`div`,{className:`overflow-y-auto flex-1 p-4`,children:(0,z.jsx)(`div`,{className:`form ${o?`loading`:``}`,children:(0,z.jsxs)(`div`,{className:`ui basic segment`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`h4`,{children:[`Action: `,e.toUpperCase()]}),(0,z.jsx)(`p`,{children:`\xA0`})]}),(0,z.jsxs)(`div`,{className:`targets`,children:[(0,z.jsx)(`h4`,{children:`Targets`}),(0,z.jsx)(`div`,{className:`flex w-full gap-2 my-4`,children:n.map(e=>(0,z.jsxs)(`div`,{className:(0,kL.default)(`flex-1 text-center p-4 bg-[#f1fff5] border border-[#b1f3c4] rounded-[0.3em] opacity-30`,{"bg-[#b1f3c4] text-green-600 font-bold opacity-100":t.includes(e.connKey)}),children:[t.includes(e.connKey)&&(0,z.jsx)(XB,{className:`h-4 w-4 inline-block mr-1`}),e.name]},e.name))})]}),e===`apply`&&(0,z.jsxs)(`div`,{className:`shadow-db-testing`,children:[(0,z.jsx)(`h4`,{children:`Shadow DB Testing`}),(0,z.jsx)(Cj,{...l(`doShadowDbTesting`)})]}),u.status===`pending`&&(0,z.jsxs)(`div`,{className:`p-4 bg-yellow-50 border border-yellow-200 rounded mt-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,z.jsx)(tV,{className:`h-4 w-4 animate-spin`}),(0,z.jsx)(`span`,{className:`font-medium`,children:`승인 대기중...`})]}),(0,z.jsx)(`p`,{className:`text-sm text-gray-600 mb-4`,children:`슬랙에서 ✅ 이모지를 눌러 승인해주세요.`}),(0,z.jsx)(B,{variant:`outline`,onClick:()=>p(!0),children:`Force 진행`})]}),u.status===`rejected`&&(0,z.jsx)(`div`,{className:`p-4 bg-red-50 border border-red-200 rounded mt-4`,children:(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)($B,{className:`h-4 w-4 text-red-600`}),(0,z.jsx)(`span`,{className:`font-medium text-red-600`,children:`마이그레이션이 거절되었습니다.`})]})})]})})}),(0,z.jsx)(od,{children:(0,z.jsx)(B,{onClick:b,icon:(0,z.jsx)(QB,{}),disabled:o||u.status===`pending`,children:`Commit`})})]})}),(0,z.jsx)(td,{open:f,onOpenChange:p,children:(0,z.jsxs)(id,{children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{children:`Force 진행`}),(0,z.jsx)(cd,{children:`승인 없이 진행합니다. 사유를 입력해주세요.`})]}),(0,z.jsx)(Qj,{placeholder:`사유 입력...`,value:h,onChange:e=>g(e.target.value)}),(0,z.jsxs)(od,{children:[(0,z.jsx)(B,{variant:`outline`,onClick:()=>p(!1),children:`취소`}),(0,z.jsx)(B,{onClick:x,disabled:!h.trim()||o,children:`진행`})]})]})})]})}var kae=hP(`/migrations`)({component:Aae});function Aae(e){let{SD:t}=kP(),{data:n,error:r,refetch:i}=J.useMigrationStatus(),{status:a}=n??{},{preparedCodes:o,conns:s,codes:c}=a??{},l=a?.error,u=!r&&!n,[d,f]=(0,m.useState)(!1),[p,h]=(0,m.useState)([]),[g,_]=(0,m.useState)([]),[v,y]=(0,m.useState)(!1),[b,x]=(0,m.useState)(null),[S,C]=(0,m.useState)(!1),w=e=>{let t=new Set((s??[]).map(e=>e.connKey)),n=(()=>{switch(e){case`ALL`:return[`test`,`fixture`,`development`,`staging`,`production`];case`LOCAL`:return[`test`];case`REMOTE`:return[`development`,`staging`,`production`];case`TESTING`:return[`test`,`fixture`];case`FIXTURE`:return[`fixture`]}})().filter(e=>t.has(e));n.length!==0&&(n.filter(e=>p.includes(e)).length===n.length?h(p.filter(e=>!n.includes(e))):jne(n,p).length>0?h(n):h(pj([...p,...n])))},T=()=>{g.length!==0&&confirm(t(`migration.confirm.deleteCodes`).replace(`{count}`,String(g.length)))&&(f(!0),J.migrationsDelCodes(g).then(()=>{i()}).catch(PL).finally(()=>{f(!1)}))},E=()=>{f(!0),J.migrationsGeneratePreparedCodes().then(()=>{setTimeout(()=>{i()},500)}).catch(PL).finally(()=>{f(!1)})},D=(e,t)=>{s&&(x({action:e,targets:t??p}),y(!0))},O=()=>{i()},k=()=>{c&&(g.length===0?_(c.map(e=>e.name)):_([]))};return r?(0,z.jsx)(`div`,{className:`p-8`,children:(0,z.jsx)(`div`,{className:`w-[50em] my-[30vh] mx-auto whitespace-pre-line p-[3em] bg-white leading-[2em] border-2 border-red-500`,children:r.message})}):(0,z.jsxs)(`div`,{className:`p-8`,children:[(0,z.jsxs)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm ${d||u?`opacity-50 pointer-events-none`:``}`,children:[o&&(0,z.jsxs)(`div`,{className:`p-4`,children:[(0,z.jsxs)(`h3`,{className:`relative `,children:[t(`migration.preparedCodes`),` `,(0,z.jsxs)(`div`,{className:`absolute right-0 top-0 flex gap-2`,children:[(0,z.jsx)(B,{icon:S?(0,z.jsx)(Dae,{}):(0,z.jsx)(Eae,{}),size:`xs`,onClick:()=>C(!S),children:t(`migration.toggleCodes`)}),(0,z.jsx)(B,{size:`xs`,icon:(0,z.jsx)(QB,{}),onClick:()=>E(),children:t(`migration.generate`)})]})]}),(0,z.jsxs)(wj,{children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsx)(Oj,{children:t(`common.type`)}),(0,z.jsx)(Oj,{children:t(`common.table`)}),(0,z.jsx)(Oj,{children:t(`common.name`)}),(0,z.jsx)(Oj,{children:t(`common.code`)})]})}),(0,z.jsxs)(Ej,{children:[l&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,children:l})}),!l&&o.length===0&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,className:`text-center`,children:t(`migration.noPreparedCodes`)})}),o.map((e,n)=>(0,z.jsxs)(Dj,{children:[(0,z.jsx)(kj,{children:e.type}),(0,z.jsx)(kj,{children:e.table}),(0,z.jsx)(kj,{children:e.title}),(0,z.jsx)(kj,{style:{padding:0,width:700,textAlign:`center`},children:(0,z.jsx)(jae,{code:e.formatted??``,open:S,collapsedText:t(`migration.codeCollapsed`)})})]},n))]})]}),(0,z.jsx)(`div`,{className:`border-b border-gray-200`})]}),(0,z.jsxs)(`div`,{className:`p-4`,children:[(0,z.jsx)(`h3`,{children:t(`migration.codeFiles`)}),(0,z.jsxs)(`div`,{className:`flex gap-8`,children:[(0,z.jsx)(`div`,{className:`flex-1`,children:(0,z.jsx)(B,{variant:`destructive`,icon:(0,z.jsx)(eV,{}),disabled:g.length===0,onClick:()=>T(),children:t(`migration.deleteCodes`)})}),(0,z.jsx)(`div`,{className:`flex gap-2 justify-end`,children:[`ALL`,`LOCAL`,`REMOTE`,`TESTING`,`FIXTURE`].map(e=>(0,z.jsx)(B,{variant:`yellow`,onClick:()=>w(e),children:e},e))}),(0,z.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,z.jsx)(B,{variant:`default`,icon:(0,z.jsx)(QB,{}),disabled:p.length===0||!!l,onClick:()=>D(`apply`),children:t(`migration.applyToLatest`)}),(0,z.jsx)(B,{variant:`destructive`,icon:(0,z.jsx)(GB,{}),disabled:p.length===0||!!l,onClick:()=>D(`rollback`),children:t(`migration.rollback`)})]})]}),s&&c&&(0,z.jsxs)(wj,{className:`mt-4 text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsxs)(Oj,{className:`flex items-center gap-1`,children:[`Name`,` `,(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),size:`xs`,variant:`blue`,onClick:()=>k()})]}),s.map((e,t)=>(0,z.jsx)(Oj,{style:{width:`150px`},className:(0,kL.default)(`py-2 px-3`,{"bg-[#dafde6]":p.includes(e.connKey)}),children:(0,z.jsx)(el,{disabled:e.status===`error`||!!l,checked:p.includes(e.connKey),label:(0,z.jsxs)(vv,{children:[(0,z.jsx)(yv,{children:`${e.name} / ${e.status}`}),(0,z.jsx)(bv,{children:(0,z.jsx)(`p`,{children:e.connString})})]}),onCheckedChange:t=>{h(t?pj([...p,e.connKey]):p.filter(t=>t!==e.connKey))}})},t))]})}),(0,z.jsxs)(Ej,{children:[s.some(e=>e.status===`error`||!!l)&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,children:(0,z.jsx)(`b`,{children:t(`migration.error.connections`)})})}),c.length===0&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,children:t(`migration.noCodeFiles`)})}),c.map((e,t)=>(0,z.jsx)(m.Fragment,{children:(0,z.jsxs)(Dj,{children:[(0,z.jsxs)(kj,{className:`flex items-center gap-1`,children:[(0,z.jsx)(el,{checked:g.includes(e.name),label:e.name,onCheckedChange:t=>{_(t?pj([...g,e.name]):g.filter(t=>t!==e.name))}}),`\xA0`,` `,(0,z.jsx)(B,{size:`xs`,variant:`secondary`,icon:(0,z.jsx)(ZB,{}),onClick:()=>{J.openVscode({absPath:e.path})}})]}),s.map((t,n)=>(0,z.jsx)(kj,{className:(0,kL.default)(`text-center py-2 px-3`,{"bg-[#dafde6]":p.includes(t.connKey)}),children:t.pending.includes(e.name)?(0,z.jsx)(`span`,{className:`inline-block px-2 py-1 text-xs font-bold rounded bg-yellow-500 text-white`,children:`PENDING`}):t.status===`error`||l?(0,z.jsx)(`span`,{className:`inline-block px-2 py-1 text-xs font-bold rounded bg-red-500 text-white`,children:`ERROR`}):(0,z.jsx)(`span`,{className:`inline-block px-2 py-1 text-xs font-bold rounded bg-green-500 text-white`,children:`APPLIED`})},n))]})},t))]})]})]})]}),s&&b&&(0,z.jsx)(Oae,{action:b.action,targets:b.targets,conns:s,open:v,onOpenChange:y,onCompleted:O})]})}function jae({code:e,open:t,collapsedText:n}){return(0,z.jsx)(`div`,{className:`flex items-start`,children:t?(0,z.jsx)(`pre`,{className:`bg-green-50 text-gray-900 p-4 rounded-lg overflow-x-auto text-sm font-mono leading-relaxed text-left`,children:(0,z.jsx)(`code`,{children:e})}):(0,z.jsx)(`div`,{className:`m-auto`,children:n})})}var Mae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,z.jsx)(`path`,{d:`m7 10l5 5l5-5`})]})}),nV=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 12h14m-7-7v14`})}),Nae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 3v12m5-7l-5-5l-5 5m14 7v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`})}),Pae=hP(`/i18n`)({component:Fae});function Fae(){let{SD:e}=kP(),{data:t,error:n,refetch:r}=J.useI18nDictionary(),{rows:i,locales:a,defaultLocale:o,stats:s}=t??{},c=!n&&!t,[l,u]=(0,m.useState)(!1),d=(0,m.useRef)(null),[f,p]=(0,m.useState)(null),[h,g]=(0,m.useState)(``),_=(0,m.useRef)(null),[v,y]=(0,m.useState)(new Set),[b,x]=(0,m.useState)(null),[S,C]=(0,m.useState)(!1),[w,T]=(0,m.useState)(``),[E,D]=(0,m.useState)({});(0,m.useEffect)(()=>{f&&_.current&&(_.current.focus(),_.current.select())},[f]),(0,m.useEffect)(()=>{!i||i.length===0||(async()=>{let e=i.filter(e=>e.source===`project`).map(e=>e.key);if(e.length!==0)try{let t=await J.checkI18nUsage(e);if(t.error){x(t.error);return}y(new Set(t.unusedKeys)),x(null)}catch{}})()},[i]);let O=()=>{window.location.href=`/sonamu-ui/api/i18n/export`},k=()=>{d.current?.click()},A=async e=>{let t=e.target.files?.[0];if(t){u(!0);try{await J.importI18n(t),await r(),alert(`Import completed successfully!`)}catch(e){PL(e)}finally{u(!1),d.current&&(d.current.value=``)}}},j=(e,t)=>{if(e.source===`sonamu`)return;let n=t===`key`?e.key:e[t]??``;p({key:e.key,field:t}),g(n)},M=async e=>{if(!f||!a)return;let{field:t}=f,n=e.key;if(h===(t===`key`?e.key:e[t]??``)){p(null);return}u(!0);try{if(t===`key`){let t={};for(let n of a)e[n]&&(t[n]=e[n]);await J.updateI18n({oldKey:n,newKey:h,source:e.source,values:t})}else await J.updateI18n({oldKey:n,newKey:n,source:e.source,values:{[t]:h}});await r()}catch(e){PL(e)}finally{u(!1),p(null)}},N=()=>{p(null),g(``)},P=()=>{T(``),D({}),C(!0)},F=async()=>{if(!w.trim()){alert(`키를 입력해주세요`);return}u(!0);try{await J.createI18n({key:w.trim(),values:E}),C(!1),await r()}catch(e){PL(e)}finally{u(!1)}},ee=async t=>{if(confirm(e(`i18n.confirm.delete`).replace(`{key}`,t))){u(!0);try{await J.deleteI18n(t),await r()}catch(e){PL(e)}finally{u(!1)}}},te=(e,t)=>{e.key===`Enter`?(e.preventDefault(),M(t)):e.key===`Escape`&&(e.preventDefault(),N())},ne=(e,t,n,r)=>{let i=f?.key===e.key&&f?.field===t,a=e.source!==`sonamu`;return i?(0,z.jsx)(kj,{className:r,children:(0,z.jsx)(`input`,{ref:_,type:`text`,value:h,onChange:e=>g(e.target.value),onBlur:()=>M(e),onKeyDown:t=>te(t,e),className:`w-full px-2 py-1 text-sm border border-blue-400 rounded outline-none focus:ring-2 focus:ring-blue-200`})}):(0,z.jsx)(kj,{className:`${r} ${a?`cursor-pointer hover:bg-blue-50`:``}`,onDoubleClick:()=>a&&j(e,t),children:n})};return(0,z.jsxs)(`div`,{className:`p-8`,children:[(0,z.jsx)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm ${l||c?`opacity-50 pointer-events-none`:``}`,children:(0,z.jsxs)(`div`,{className:`p-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,style:{display:`flex`,alignItems:`baseline`},children:[(0,z.jsx)(`h3`,{children:e(`i18n.title`)}),(0,z.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>r(),disabled:l,icon:(0,z.jsx)(GB,{className:`w-4 h-4`})})]}),(0,z.jsxs)(`div`,{className:`flex gap-2 mb-4`,children:[(0,z.jsx)(B,{onClick:P,disabled:l,icon:(0,z.jsx)(nV,{className:`w-4 h-4`}),children:e(`i18n.addKey`)}),(0,z.jsx)(B,{onClick:O,disabled:l,icon:(0,z.jsx)(Nae,{className:`w-4 h-4`}),children:e(`i18n.exportExcel`)}),(0,z.jsx)(B,{onClick:k,disabled:l,icon:(0,z.jsx)(Mae,{className:`w-4 h-4`}),children:e(`i18n.importExcel`)}),(0,z.jsx)(`input`,{type:`file`,ref:d,onChange:A,accept:`.xlsx,.xls`,className:`hidden`})]}),(0,z.jsx)(`p`,{className:`text-sm text-gray-500 mb-4`,children:e(`i18n.editHint`)}),b&&(0,z.jsxs)(`p`,{className:`text-sm text-yellow-600 mb-4 p-2 bg-yellow-50 rounded`,children:[`⚠ `,b]}),c&&(0,z.jsx)(`div`,{className:`text-gray-500`,children:e(`common.loading`)}),n&&(0,z.jsxs)(`div`,{className:`text-red-500`,children:[e(`common.error`),`: `,String(n)]}),i&&a&&(0,z.jsxs)(wj,{containerClassName:`border rounded-lg overflow-auto max-h-[calc(100vh-250px)]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{children:[(0,z.jsx)(Oj,{className:`sticky top-0 z-10 min-w-[300px] bg-gray-100`,children:e(`i18n.key`)}),(0,z.jsx)(Oj,{className:`sticky top-0 z-10 min-w-[100px] bg-gray-100`,children:e(`i18n.source`)}),a.map(e=>(0,z.jsxs)(Oj,{className:`sticky top-0 z-10 min-w-[200px] bg-gray-100`,children:[e,e===o&&` (default)`,s?.[e]&&(0,z.jsxs)(`span`,{className:`ml-2 text-xs ${s[e].percent===100?`text-green-600`:s[e].percent>=80?`text-yellow-600`:`text-red-600`}`,children:[s[e].percent,`%`]})]},e)),(0,z.jsx)(Oj,{className:`sticky top-0 z-10 w-[60px] bg-gray-100`})]})}),(0,z.jsx)(Ej,{children:i.map(e=>(0,z.jsxs)(Dj,{className:e.source===`sonamu`?`bg-gray-50 text-gray-500`:void 0,children:[ne(e,`key`,(0,z.jsxs)(z.Fragment,{children:[!b&&v.has(e.key)&&(0,z.jsx)(`span`,{className:`text-red-500 mr-1`,title:`미사용 키`,children:`❗`}),e.key]}),`font-mono text-sm`),(0,z.jsx)(kj,{children:(0,z.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded ${e.source===`entity`?`bg-blue-100 text-blue-700`:e.source===`sonamu`?`bg-gray-200 text-gray-600`:`bg-green-100 text-green-700`}`,children:e.source})}),a.map(t=>{let n=!e[t];return ne(e,t,n?(0,z.jsx)(`span`,{className:`text-yellow-600`,children:`⚠ -`}):e[t],`text-sm ${n?`bg-yellow-50`:``}`)}),(0,z.jsx)(kj,{children:e.source===`project`&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>ee(e.key),className:`p-1 text-gray-400 hover:text-red-500 transition-colors`,title:`Delete key`,children:(0,z.jsx)(TB,{className:`w-4 h-4`})})})]},e.key))})]}),(0,z.jsx)(`div`,{className:`mt-4 text-sm text-gray-500`,children:i&&(0,z.jsx)(`span`,{children:e(`i18n.totalKeys`).replace(`{count}`,String(i.length))})})]})}),S&&a&&(0,z.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,children:(0,z.jsxs)(`div`,{className:`bg-white rounded-lg shadow-xl w-full max-w-md p-6`,children:[(0,z.jsx)(`h3`,{className:`text-lg font-semibold mb-4`,children:e(`i18n.modal.addNewKey`)}),(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:e(`i18n.key`)}),(0,z.jsx)(`input`,{type:`text`,value:w,onChange:e=>T(e.target.value),placeholder:`e.g. common.myNewKey`,className:`w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),a.map(t=>(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:[t,t===o&&` (default)`]}),(0,z.jsx)(`input`,{type:`text`,value:E[t]??``,onChange:e=>D(n=>({...n,[t]:e.target.value})),placeholder:e(`i18n.modal.valueFor`).replace(`{locale}`,t),className:`w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500`})]},t))]}),(0,z.jsxs)(`div`,{className:`flex justify-end gap-2 mt-6`,children:[(0,z.jsx)(B,{variant:`outline`,onClick:()=>C(!1),disabled:l,children:e(`common.cancel`)}),(0,z.jsx)(B,{onClick:F,disabled:l,children:e(l?`i18n.creating`:`common.create`)})]})]})})]})}var Iae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`ellipse`,{cx:12,cy:5,rx:9,ry:3}),(0,z.jsx)(`path`,{d:`M3 5v14a9 3 0 0 0 18 0V5`}),(0,z.jsx)(`path`,{d:`M3 12a9 3 0 0 0 18 0`})]})}),Lae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`rect`,{width:18,height:18,x:3,y:3,rx:2}),(0,z.jsx)(`path`,{d:`M3 9h18M3 15h18M9 3v18m6-18v18`})]})}),rV=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`m21 21l-4.34-4.34`}),(0,z.jsx)(`circle`,{cx:11,cy:11,r:8})]})}),Rae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M12 3v18`}),(0,z.jsx)(`rect`,{width:18,height:18,x:3,y:3,rx:2}),(0,z.jsx)(`path`,{d:`M3 9h18M3 15h18`})]})}),iV=`vercel.ai.error`,zae=Symbol.for(iV),aV,Bae=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[aV]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,iV)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}};aV=zae;var oV=Bae;function sV(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.message:JSON.stringify(e)}var cV=`AI_InvalidArgumentError`,lV=`vercel.ai.error.${cV}`,Vae=Symbol.for(lV),uV,Hae=class extends oV{constructor({message:e,cause:t,argument:n}){super({name:cV,message:e,cause:t}),this[uV]=!0,this.argument=n}static isInstance(e){return oV.hasMarker(e,lV)}};uV=Vae;var dV=`AI_JSONParseError`,fV=`vercel.ai.error.${dV}`,Uae=Symbol.for(fV),pV,mV=class extends oV{constructor({text:e,cause:t}){super({name:dV,message:`JSON parsing failed: Text: ${e}.
|
|
102
|
+
`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=KI(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&bL.assertOptions(n,{silentJSONParsing:xL.transitional(xL.boolean),forcedJSONParsing:xL.transitional(xL.boolean),clarifyTimeoutError:xL.transitional(xL.boolean),legacyInterceptorReqResOrdering:xL.transitional(xL.boolean)},!1),r!=null&&(q.isFunction(r)?t.paramsSerializer={serialize:r}:bL.assertOptions(r,{encode:xL.function,serialize:xL.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),bL.assertOptions(t,{baseUrl:xL.spelling(`baseURL`),withXsrfToken:xL.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&q.merge(i.common,i[t.method]);i&&q.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=kI.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||tI;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[hL.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=hL.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=KI(this.defaults,e),$F(WI(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};q.forEach([`delete`,`get`,`head`,`options`],function(e){SL.prototype[e]=function(t,n){return this.request(KI(n||{},{method:e,url:t,data:(n||{}).data}))}}),q.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(KI(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}SL.prototype[e]=t(),SL.prototype[e+`Form`]=t(!0)});var CL=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new MI(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function wL(e){return function(t){return e.apply(null,t)}}function TL(e){return q.isObject(e)&&e.isAxiosError===!0}var EL={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(EL).forEach(([e,t])=>{EL[t]=e});function DL(e){let t=new SL(e),n=jP(SL.prototype.request,t);return q.extend(n,SL.prototype,t,{allOwnKeys:!0}),q.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return DL(KI(e,t))},n}var OL=DL(hI);OL.Axios=SL,OL.CanceledError=MI,OL.CancelToken=CL,OL.isCancel=jI,OL.VERSION=gL,OL.toFormData=JF,OL.AxiosError=HF,OL.Cancel=OL.CanceledError,OL.all=function(e){return Promise.all(e)},OL.spread=wL,OL.isAxiosError=TL,OL.mergeConfig=KI,OL.AxiosHeaders=kI,OL.formToJSON=e=>pI(q.isHTMLForm(e)?new FormData(e):e),OL.getAdapter=pL.getAdapter,OL.HttpStatusCode=EL,OL.default=OL;var kL=u(AP(),1),AL=``;async function jL(e){try{return(await OL({baseURL:AL,...e})).data}catch(e){if(OL.isAxiosError(e)&&e.response&&e.response.data){let t=e.response.data;throw new ML(e.response.status,t.message,t.issues)}throw e}}var ML=class extends Error{code;message;issues;isSonamuError;constructor(e,t,n){super(t),this.code=e,this.message=t,this.issues=n,this.isSonamuError=!0}};function NL(e){return e&&e.isSonamuError===!0}function PL(e){NL(e)?alert(e.message):alert(`에러 발생`)}var J;(function(e){function t(){return jL({method:`GET`,url:`/sonamu-ui/api/sonamu/config`})}e.getSonamuConfig=t;function n(){return N_({queryKey:[`entities`,`findMany`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/entity/findMany`})})}e.useEntities=n;function r(e){return N_({queryKey:[`entity`,`typeIds`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/entity/typeIds`,params:{filter:e,reload:`1`}})})}e.useTypeIds=r;function i(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/create`,data:{form:e}})}e.createEntity=i;function a(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/del`,data:{entityId:e}})}e.delEntity=a;function o(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyEntityBase`,data:{entityId:e,newValues:t}})}e.modifyEntityBase=o;function s(e,t,n,r){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifySubset`,data:{entityId:e,subsetKey:t,fields:n,fieldsInternal:r}})}e.modifySubset=s;function c(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/delSubset`,data:{entityId:e,subsetKey:t}})}e.delSubset=c;function l(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/createProp`,data:{entityId:e,at:n,newProp:t}})}e.createProp=l;function u(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyProp`,data:{entityId:e,at:n,newProp:t}})}e.modifyProp=u;function d(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/delProp`,data:{entityId:e,at:t}})}e.delProp=d;function f(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/moveProp`,data:{entityId:e,at:t,to:n}})}e.moveProp=f;function p(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyIndexes`,data:{entityId:e,indexes:t}})}e.modifyIndexes=p;function m(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyEnumLabels`,data:{entityId:e,enumLabels:t}})}e.modifyEnumLabels=m;function h(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/createEnumId`,data:e})}e.createEnumId=h;function g(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyEnumId`,data:{entityId:e,enumId:t}})}e.modifyEnumId=g;function _(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/deleteEnumId`,data:e})}e.deleteEnumId=_;function v(e){return jL({method:`GET`,url:`/sonamu-ui/api/entity/getTableColumns`,params:{entityId:e}})}e.getTableColumns=v;function y(){return N_({queryKey:[`migrations`,`status`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/migrations/status`})})}e.useMigrationStatus=y;function b(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/runAction`,data:{action:e,targets:t,...n}})}e.migrationsRunAction=b;function x(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/checkApproval`,data:{channel:e,ts:t}})}e.migrationsCheckApproval=x;function S(e,t,n,r){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/forceApproval`,data:{channel:e,ts:t,reason:n,requestor:r}})}e.migrationsForceApproval=S;function C(e){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/delCodes`,data:{codeNames:e}})}e.migrationsDelCodes=C;function w(){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/generatePreparedCodes`,data:{}})}e.migrationsGeneratePreparedCodes=w;function T(e){return jL({method:`GET`,url:`/sonamu-ui/api/tools/openVscode`,params:e})}e.openVscode=T;function E(e){return jL({method:`GET`,url:`/sonamu-ui/api/tools/getSuggestion`,params:e})}e.getSuggestion=E;function D(e){let t=e.entityIds.length>0&&e.templateKeys.length>0;return N_({queryKey:[`scaffolding`,`getStatus`,e],queryFn:()=>jL({method:`POST`,url:`/sonamu-ui/api/scaffolding/getStatus`,data:e}),enabled:t})}e.useScaffoldingStatus=D;function O(e){return jL({method:`POST`,url:`/sonamu-ui/api/scaffolding/generate`,data:{options:e}})}e.scaffoldingGenerate=O;function k(e){return jL({method:`POST`,url:`/sonamu-ui/api/scaffolding/preview`,data:{option:e}})}e.scaffoldingPreview=k;function A(e){return jL({method:`GET`,url:`/sonamu-ui/api/openai/messages`,params:{id:e}})}e.getMessages=A;function j(e){return jL({method:`POST`,url:`/sonamu-ui/api/openai/chat`,data:{message:e}})}e.chat=j;function M(){return jL({method:`POST`,url:`/sonamu-ui/api/openai/clearThread`})}e.clearThread=M;function N(e,t,n,r){return jL({method:`POST`,url:`/sonamu-ui/api/fixture`,data:{sourceDB:e,targetDB:t,search:n,duplicateCheck:r}})}e.getFixtures=N;function P(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/fixture/import`,data:{db:e,fixtures:t}})}e.importFixtures=P;function F(){return N_({queryKey:[`i18n`,`dictionary`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/i18n/dictionary`})})}e.useI18nDictionary=F;function ee(e){let t=new FormData;return t.append(`file`,e),jL({method:`POST`,url:`/sonamu-ui/api/i18n/import`,data:t,headers:{"Content-Type":`multipart/form-data`}})}e.importI18n=ee;function te(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/update`,data:e})}e.updateI18n=te;function ne(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/create`,data:e})}e.createI18n=ne;function I(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/delete`,data:{key:e}})}e.deleteI18n=I;function re(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/checkUsage`,data:{keys:e}})}e.checkI18nUsage=re;function ie(){return N_({queryKey:[`test`,`status`],queryFn:()=>jL({method:`GET`,url:`/__test__/status`})})}e.useTestStatus=ie;function ae(e){return N_({queryKey:[`tasks`,`workflowRuns`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowRuns`,params:{...e?.limit?{limit:String(e.limit)}:{},...e?.after?{after:e.after}:{},...e?.before?{before:e.before}:{},...e?.status?.length?{status:e.status.join(`,`)}:{},...e?.workflowName?{workflowName:e.workflowName}:{},...e?.createdAfter?{createdAfter:e.createdAfter}:{},...e?.createdBefore?{createdBefore:e.createdBefore}:{},order:`desc`}}),refetchInterval:5e3})}e.useWorkflowRuns=ae;function oe(e){return N_({queryKey:[`tasks`,`workflowRun`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}`}),refetchInterval:5e3})}e.useWorkflowRun=oe;function se(e){return N_({queryKey:[`tasks`,`stepAttempts`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/steps`}),refetchInterval:5e3})}e.useStepAttempts=se;function ce(){return N_({queryKey:[`tasks`,`workflowDefinitions`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowDefinitions`})})}e.useWorkflowDefinitions=ce;function le(e){return jL({method:`POST`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/cancel`})}e.cancelWorkflowRun=le;function ue(e){return jL({method:`POST`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/pause`})}e.pauseWorkflowRun=ue;function de(e){return jL({method:`POST`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/resume`})}e.resumeWorkflowRun=de;function fe(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`entity`,cone:t}})}e.updateEntityCone=fe;function pe(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`prop`,propName:t,cone:n}})}e.updatePropCone=pe;function me(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`enum`,enumId:t,cone:n}})}e.updateEnumCone=me;function he(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`subset`,subsetKey:t,cone:n}})}e.updateSubsetCone=he;function ge(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/generateCones`,data:{entityId:e,...t}})}e.generateCones=ge})(J||={});var FL=.3,IL=`bg-amber-200/60 text-amber-900 rounded-sm`;function LL(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(r.length===0||r.length>n.length)return null;let i=n.indexOf(r);if(i!==-1)return{score:1,indices:Array.from({length:r.length},(e,t)=>i+t)};let a=[],o=0;for(let e=0;e<n.length&&o<r.length;e++)n[e]===r[o]&&(a.push(e),o++);if(o<r.length)return null;let s=0;for(let t=0;t<a.length;t++){let n=a[t];t>0&&n===a[t-1]+1?s+=1:n===0||RL(e,n)?s+=.8:s+=.1}return{score:s/a.length,indices:a}}function RL(e,t){if(t===0)return!0;let n=e[t-1],r=e[t];return n===`_`||n===` `||n===`-`||n===`.`||n===n.toLowerCase()&&r===r.toUpperCase()&&r!==r.toLowerCase()}function zL({text:e,search:t,indices:n}){if(!t)return(0,z.jsx)(`span`,{children:e});let r=n??LL(e,t)?.indices;if(!r||r.length===0)return(0,z.jsx)(`span`,{children:e});if(r.every((e,t)=>t===0||e===r[t-1]+1)){let t=r[0],n=r[r.length-1]+1;return(0,z.jsxs)(`span`,{children:[e.slice(0,t),(0,z.jsx)(`span`,{className:IL,children:e.slice(t,n)}),e.slice(n)]})}let i=[],a=0;for(let t of r)t>a&&i.push(e.slice(a,t)),i.push((0,z.jsx)(`span`,{className:IL,children:e[t]},t)),a=t+1;return a<e.length&&i.push(e.slice(a)),(0,z.jsx)(`span`,{children:i})}function BL({open:e,onClose:t}){let[n,r]=(0,m.useState)(``),i=uP(),{data:a}=J.useEntities(),{entities:o}=a??{},s=(0,m.useMemo)(()=>!o||!n?[]:o.map(e=>{let t=LL(`${e.id} ${e.title}`,n),r=t!==null&&t.score>=FL,i=e.props.filter(e=>{let t=LL(`${e.name} ${e.desc??``}`,n);return t!==null&&t.score>=FL}),a=Object.entries(e.subsets).flatMap(([e,t])=>t.filter(t=>{let r=LL(`${e} ${t}`,n);return r!==null&&r.score>=FL}).map(t=>({subsetKey:e,field:t}))),o=Object.keys(e.enumLabels).filter(e=>{let t=LL(e,n);return t!==null&&t.score>=FL});return r||i.length>0||a.length>0||o.length>0?{entity:e,entityMatch:r,matchedProps:i,matchedSubsets:a,matchedEnums:o,bestScore:Math.max(t?.score??0,...i.map(e=>LL(`${e.name} ${e.desc??``}`,n)?.score??0),...a.map(({subsetKey:e,field:t})=>LL(`${e} ${t}`,n)?.score??0),...o.map(e=>LL(e,n)?.score??0))}:null}).filter(Boolean).toSorted((e,t)=>(t?.bestScore??0)-(e?.bestScore??0)),[o,n]),c=(e,n)=>{r(``),t(),i({to:e}),n&&l(n)},l=e=>{let t=0,n=setInterval(()=>{t++;let r=document.getElementById(e);r?(clearInterval(n),r.scrollIntoView({behavior:`instant`,block:`center`}),r.style.backgroundColor=`#fef3c7`,r.style.boxShadow=`0 0 0 2px #fbbf24`,setTimeout(()=>{r.style.backgroundColor=``,r.style.boxShadow=``,r.style.transition=`background-color 1s, box-shadow 1s`},1e3)):t>=50&&clearInterval(n)},100)};return(0,z.jsxs)(sf,{open:e,onOpenChange:e=>{e||(r(``),t())},commandProps:{shouldFilter:!1},children:[(0,z.jsx)(cf,{placeholder:`Search entities...`,value:n,onValueChange:r}),(0,z.jsxs)(lf,{className:`max-h-[60vh]`,children:[n&&s.length===0&&(0,z.jsx)(uf,{children:`검색 결과가 없습니다.`}),s.map(e=>{if(!e)return null;let{entity:t,entityMatch:r,matchedProps:i,matchedSubsets:a,matchedEnums:o}=e;return(0,z.jsxs)(df,{heading:(0,z.jsx)(zL,{text:`${t.id} ${t.title}`,search:n}),children:[r&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(pf,{value:`entity:${t.id} ${t.title}`,onSelect:()=>c(`/entities/${t.id}`),children:(0,z.jsx)(zL,{text:`${t.id} (${t.title})`,search:n})}),(0,z.jsxs)(pf,{value:`scaffolding:${t.id} ${t.title}`,onSelect:()=>c(`/scaffolding`,t.id),children:[`Scaffolding >`,` `,(0,z.jsx)(zL,{text:`${t.id}(${t.title})`,search:n})]})]}),i.map(e=>(0,z.jsxs)(pf,{value:`prop:${e.name} ${e.desc??``} ${t.id}`,onSelect:()=>c(`/entities/${t.id}`,`prop-${e.name}`),children:[`prop > `,(0,z.jsx)(zL,{text:e.name,search:n}),e.desc?(0,z.jsxs)(`span`,{children:[` (`,(0,z.jsx)(zL,{text:e.desc,search:n}),`)`]}):null]},`prop-${e.name}`)),a.map(({subsetKey:e,field:r})=>(0,z.jsxs)(pf,{value:`subset:${e} ${r} ${t.id}`,onSelect:()=>c(`/entities/${t.id}`,r),children:[`Subset`,e,` > `,(0,z.jsx)(zL,{text:r,search:n})]},`subset-${e}-${r}`)),o.map(e=>(0,z.jsxs)(pf,{value:`enum:${e} ${t.id}`,onSelect:()=>c(`/entities/${t.id}`,`enum-${e}`),children:[`enum > `,(0,z.jsx)(zL,{text:e,search:n})]},`enum-${e}`))]},t.id)})]})]})}function VL({children:e}){let{SD:t}=kP(),n=DP(),r=uie(),i=[{name:t(`nav.entities`),path:`/entities`},{name:t(`nav.migration`),path:`/migrations`},{name:t(`nav.scaffolding`),path:`/scaffolding`},{name:t(`nav.fixture`),path:`/fixture`},{name:t(`nav.i18n`),path:`/i18n`},{name:t(`nav.tasks`),path:`/tasks`},{name:t(`nav.testResults`),path:`/test-results`},{name:t(`nav.cdd`),path:`/cdd`}],a=rie(),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(null),u=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),s(!0))};return(0,m.useEffect)(()=>(document.addEventListener(`keydown`,u),()=>{document.removeEventListener(`keydown`,u)}),[]),(0,m.useEffect)(()=>{J.getSonamuConfig().then(e=>{e.projectName&&(l(e.projectName),document.title=`${e.projectName}: Sonamu UI`)})},[]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`app`,children:[(0,z.jsxs)(`div`,{className:`w-full h-gnb bg-sidebar-bg text-white sticky top-0 left-0 flex items-center z-100 border-b border-white/10 justify-between`,children:[(0,z.jsxs)(`div`,{className:`flex`,children:[(0,z.jsxs)(`div`,{className:`p-4 font-bold w-sidemenu tracking-[-0.5px]`,children:[(0,z.jsx)(`span`,{children:`🌲 \xA0 Sonamu UI`}),(0,z.jsxs)(`span`,{className:`font-normal text-text-muted text-[0.9em] ml-2`,children:[`\xA0 `,c]})]}),(0,z.jsx)(`div`,{className:`flex gap-[0.3em] text-[0.9em]`,children:i.map((e,t)=>(0,z.jsx)(mP,{className:(0,kL.default)(`self-center px-6 py-[0.8em] cursor-pointer text-center text-text-light! no-underline rounded-md transition-all duration-200`,`hover:bg-white/10 hover:text-white!`,{"bg-white/15! font-semibold text-white!":a.pathname.includes(e.path)}),to:e.path,children:(0,z.jsx)(`div`,{children:e.name})},t))})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`select`,{value:n,onChange:e=>r(e.target.value),className:`px-2 py-[0.4em] rounded-md border border-white/10 bg-black/20 cursor-pointer text-text-muted text-[0.85em] transition-all duration-200 hover:border-accent hover:text-white`,children:OP.map(e=>(0,z.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,z.jsxs)(`button`,{type:`button`,className:`mr-4 px-4 py-[0.4em] rounded-[20px] border border-white/10 bg-black/20 cursor-pointer text-text-muted text-[0.9em] transition-all duration-200 hover:border-accent hover:text-white *:mr-2`,onClick:()=>s(!0),children:[(0,z.jsx)(`span`,{children:`🔍`}),(0,z.jsx)(`span`,{children:t(`nav.search`)}),(0,z.jsx)(`kbd`,{className:`keycap`,children:`⌘`}),(0,z.jsx)(`kbd`,{className:`keycap`,children:`K`})]})]})]}),(0,z.jsx)(`div`,{className:`content`,children:e})]}),(0,z.jsx)(BL,{open:o,onClose:()=>s(!1)}),(0,z.jsx)(Kee,{})]})}var HL=Vre()({component:UL});function UL(){return(0,z.jsx)(VL,{children:(0,z.jsx)(CP,{})})}function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(null,arguments)}function WL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var GL={},KL=(0,m.createContext)(GL),qL=(e,t)=>Y({},e,t),JL=()=>(0,m.useContext)(KL),YL=(0,m.createContext)(()=>{});YL.displayName=`JVR.DispatchShowTools`;function XL(){return(0,m.useReducer)(qL,GL)}function ZL(){return(0,m.useContext)(YL)}var QL=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(KL.Provider,{value:t,children:(0,z.jsx)(YL.Provider,{value:n,children:r})})};QL.displayName=`JVR.ShowTools`;var $L={},eR=(0,m.createContext)($L),tR=(e,t)=>Y({},e,t),nR=()=>(0,m.useContext)(eR),rR=(0,m.createContext)(()=>{});rR.displayName=`JVR.DispatchExpands`;function iR(){return(0,m.useReducer)(tR,$L)}function aR(){return(0,m.useContext)(rR)}var oR=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(eR.Provider,{value:t,children:(0,z.jsx)(rR.Provider,{value:n,children:r})})};oR.displayName=`JVR.Expands`;var sR={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},cR=(0,m.createContext)(sR),lR=(e,t)=>Y({},e,t),uR=()=>(0,m.useContext)(cR),dR=(0,m.createContext)(()=>{});dR.displayName=`JVR.DispatchTypes`;function fR(){return(0,m.useReducer)(lR,sR)}function pR(){return(0,m.useContext)(dR)}function mR(e){var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(cR.Provider,{value:t,children:(0,z.jsx)(dR.Provider,{value:n,children:r})})}mR.displayName=`JVR.Types`;var hR=[`style`];function gR(e){var{style:t}=e,n=WL(e,hR);return(0,z.jsx)(`svg`,Y({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:Y({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t)},n,{children:(0,z.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}gR.displayName=`JVR.TriangleArrow`;var _R={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,z.jsx)(gR,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},vR=(0,m.createContext)(_R),yR=(e,t)=>Y({},e,t),bR=()=>(0,m.useContext)(vR),xR=(0,m.createContext)(()=>{});xR.displayName=`JVR.DispatchSymbols`;function SR(){return(0,m.useReducer)(yR,_R)}function CR(){return(0,m.useContext)(xR)}var wR=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(vR.Provider,{value:t,children:(0,z.jsx)(xR.Provider,{value:n,children:r})})};wR.displayName=`JVR.Symbols`;var TR={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},ER=(0,m.createContext)(TR),DR=(e,t)=>Y({},e,t),OR=()=>(0,m.useContext)(ER),kR=(0,m.createContext)(()=>{});kR.displayName=`JVR.DispatchSection`;function AR(){return(0,m.useReducer)(DR,TR)}function jR(){return(0,m.useContext)(kR)}var MR=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(ER.Provider,{value:t,children:(0,z.jsx)(kR.Provider,{value:n,children:r})})};MR.displayName=`JVR.Section`;var NR={objectSortKeys:!1,indentWidth:15},PR=(0,m.createContext)(NR);PR.displayName=`JVR.Context`;var FR=(0,m.createContext)(()=>{});FR.displayName=`JVR.DispatchContext`;function IR(e,t){return Y({},e,t)}var LR=()=>(0,m.useContext)(PR),RR=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,m.useReducer)(IR,Object.assign({},NR,n)),[o,s]=XL(),[c,l]=iR(),[u,d]=fR(),[f,p]=SR(),[h,g]=AR();return(0,m.useEffect)(()=>a(Y({},n)),[n]),(0,z.jsx)(PR.Provider,{value:i,children:(0,z.jsx)(FR.Provider,{value:a,children:(0,z.jsx)(QL,{initial:o,dispatch:s,children:(0,z.jsx)(oR,{initial:c,dispatch:l,children:(0,z.jsx)(mR,{initial:Y({},u,r),dispatch:d,children:(0,z.jsx)(wR,{initial:f,dispatch:p,children:(0,z.jsx)(MR,{initial:h,dispatch:g,children:t})})})})})})})};RR.displayName=`JVR.Provider`;function zR(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var BR=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],VR=[`as`,`render`],HR=[`as`,`render`],UR=[`as`,`render`],WR=[`as`,`style`,`render`],GR=[`as`,`render`],KR=[`as`,`render`],qR=[`as`,`render`],JR=[`as`,`render`],YR=e=>{var{Quote:t={}}=bR(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=WL(e,BR);if(n)return null;var{as:c,render:l}=t,u=WL(t,VR),d=c||`span`,f=Y({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,z.jsx)(d,Y({},f))};YR.displayName=`JVR.Quote`;var XR=e=>{var{ValueQuote:t={}}=bR(),n=Y({},(zR(e),e)),{as:r,render:i}=t,a=WL(t,HR),o=r||`span`,s=Y({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,z.jsx)(o,Y({},s))};XR.displayName=`JVR.ValueQuote`;var ZR=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=bR(),{as:o,render:s}=a,c=WL(a,UR),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,z.jsx)(l,Y({},c))};ZR.displayName=`JVR.Colon`;var QR=e=>{var{Arrow:t={}}=bR(),n=nR(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=WL(t,WR),m=u||`span`,h=f&&typeof f==`function`,g=Y({},p,{"data-expanded":l,style:Y({},d,i)});return h&&f(g,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,z.jsx)(m,Y({},p,{style:Y({},d,i)}))};QR.displayName=`JVR.Arrow`;var $R=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=bR(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=WL(o,GR),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,z.jsx)(f,Y({},d))}var{as:p,render:m}=s,h=WL(s,KR),g=p||`span`;return m&&typeof m==`function`&&m(h,c)||(0,z.jsx)(g,Y({},h))};$R.displayName=`JVR.BracketsOpen`;var ez=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=bR();if(t){var{as:u,render:d}=c,f=WL(c,qR),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,z.jsx)(p,Y({},f))}var{as:m,render:h}=l,g=WL(l,JR),_=m||`span`;return h&&typeof h==`function`&&h(g,s)||(0,z.jsx)(_,Y({},g))};ez.displayName=`JVR.BracketsClose`;var tz=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=nR(),{collapsed:c,shouldExpandNodeInitially:l}=LR(),u=typeof c==`boolean`?c:typeof c==`number`?a>c:!1,d=s[r]??(l?!1:u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},h={keyName:t,value:n,keys:o,parentValue:i},g=Array.isArray(n),_=n instanceof Set;return(0,z.jsx)(`div`,{style:m,children:(0,z.jsx)(ez,Y({isBrackets:g||_},h,{isVisiable:!0}))})};tz.displayName=`JVR.NestedClose`;var nz=[`as`,`render`],rz=[`as`,`render`],iz=[`as`,`render`],az=[`as`,`render`],oz=[`as`,`render`],sz=[`as`,`render`],cz=[`as`,`render`],lz=[`as`,`render`],uz=[`as`,`render`],dz=[`as`,`render`],fz=[`as`,`render`],pz=[`as`,`render`],mz=[`as`,`render`],hz=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},gz=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=uR();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=WL(r,nz);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,z.jsx)(a||`span`,Y({},s))};gz.displayName=`JVR.SetComp`;var _z=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=uR();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=WL(r,rz);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,z.jsx)(a||`span`,Y({},s))};_z.displayName=`JVR.MapComp`;var vz={opacity:.75,paddingRight:4},yz=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=uR(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=LR(),{as:c,render:l}=i,u=WL(i,iz),d=t,[f,p]=(0,m.useState)(o&&d.length>o);(0,m.useEffect)(()=>p(o&&d.length>o),[o]);var h=c||`span`,g=Y({},vz,i.style||{});o>0&&(u.style=Y({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var _=f?``+d.slice(0,o)+s:d,v=l&&typeof l==`function`,y=v&&l(Y({},u,{style:g}),{type:`type`,value:t,keyName:n,keys:r}),b=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,x=v&&l(Y({},u,{children:_,className:b}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(y||(0,z.jsx)(h,Y({},u,{style:g}))),x||(0,z.jsxs)(m.Fragment,{children:[(0,z.jsx)(XR,{}),(0,z.jsx)(h,Y({},u,{className:b,children:_})),(0,z.jsx)(XR,{})]})]})};yz.displayName=`JVR.TypeString`;var bz=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,az),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};bz.displayName=`JVR.TypeTrue`;var xz=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,oz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};xz.displayName=`JVR.TypeFalse`;var Sz=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,sz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Sz.displayName=`JVR.TypeFloat`;var Cz=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,cz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Cz.displayName=`JVR.TypeInt`;var wz=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,lz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:hz(t?.toString())}))]})};wz.displayName=`JVR.TypeFloat`;var Tz=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,uz),l=o||`span`,u=Y({},vz,i.style),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsxs)(`a`,Y({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,z.jsx)(XR,{}),t?.href,(0,z.jsx)(XR,{})]}))]})};Tz.displayName=`JVR.TypeUrl`;var Ez=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,dz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,h=d&&s(Y({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),h||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:p}))]})};Ez.displayName=`JVR.TypeDate`;var Dz=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,fz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p]})};Dz.displayName=`JVR.TypeUndefined`;var Oz=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,pz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p]})};Oz.displayName=`JVR.TypeNull`;var kz=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,mz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p]})};kz.displayName=`JVR.TypeNan`;var mie=e=>Number(e)===e&&e%1!=0||isNaN(e),Az=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,z.jsx)(Tz,Y({},i,{children:t})):typeof t==`string`?(0,z.jsx)(yz,Y({},i,{children:t})):t===!0?(0,z.jsx)(bz,Y({},i,{children:t})):t===!1?(0,z.jsx)(xz,Y({},i,{children:t})):t===null?(0,z.jsx)(Oz,Y({},i,{children:t})):t===void 0?(0,z.jsx)(Dz,Y({},i,{children:t})):t instanceof Date?(0,z.jsx)(Ez,Y({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,z.jsx)(kz,Y({},i,{children:t})):typeof t==`number`&&mie(t)?(0,z.jsx)(Sz,Y({},i,{children:t})):typeof t==`bigint`?(0,z.jsx)(wz,Y({},i,{children:t})):typeof t==`number`?(0,z.jsx)(Cz,Y({},i,{children:t})):null};Az.displayName=`JVR.Value`;function jz(e,t,n){var r=CR(),i=Y({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:Y({},e.style,t.style),children:t.children||e.children});(0,m.useEffect)(()=>r({[n]:i}),[t])}function Mz(e,t,n){var r=pR(),i=Y({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:Y({},e.style,t.style),children:t.children||e.children});(0,m.useEffect)(()=>r({[n]:i}),[t])}function Nz(e,t,n){var r=jR(),i=Y({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:Y({},e.style,t.style),children:t.children||e.children});(0,m.useEffect)(()=>r({[n]:i}),[t])}var hie=[`as`,`render`],Pz=e=>{var{KeyName:t={}}=OR();return Nz(t,e,`KeyName`),null};Pz.displayName=`JVR.KeyName`;var Fz=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=OR(),{as:c,render:l}=s,u=WL(s,hie);u.style=Y({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(Y({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,z.jsx)(d,Y({},u,{children:t}))};Fz.displayName=`JVR.KeyNameComp`;var gie=[`children`,`value`,`parentValue`,`keyName`,`keys`],_ie=[`as`,`render`,`children`],Iz=e=>{var{Row:t={}}=OR();return Nz(t,e,`Row`),null};Iz.displayName=`JVR.Row`;var Lz=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=WL(e,gie),{Row:s={}}=OR(),{as:c,render:l}=s,u=WL(s,_ie),d=c||`div`;return l&&typeof l==`function`&&l(Y({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,z.jsx)(d,Y({},o,u,{children:t}))};Lz.displayName=`JVR.RowComp`;function vie(e){var t=(0,m.useRef)();return(0,m.useEffect)(()=>{t.current=e}),t.current}function yie(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=vie(t),a=(0,m.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,m.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var bie=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],xie=[`as`,`render`],Rz=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=WL(e,bie),{onCopied:c,enableClipboard:l,beforeCopy:u}=LR(),d=JL()[i],[f,p]=(0,m.useState)(!1),{Copied:h={}}=OR(),g=h?.beforeCopy;if(l===!1||!d)return null;var _={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?hz(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?hz(t):t,2);var l=o||g||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:v}=h,y=WL(h,xie),b=Y({},y,s,_,{style:Y({},y.style,s.style,_.style)});return v&&typeof v==`function`&&v(Y({},b,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,z.jsx)(`svg`,Y({viewBox:`0 0 32 36`},b,{children:(0,z.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,z.jsx)(`svg`,Y({viewBox:`0 0 32 36`},b,{children:(0,z.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};Rz.displayName=`JVR.Copied`;function zz(){var e=(0,m.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var Bz=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=nR(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=LR(),f=typeof u==`boolean`?u:typeof u==`number`?i>u:!1,p=s[r]??(d?!1:f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,z.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,z.jsx)(Hz,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};Bz.displayName=`JVR.KeyValues`;var Vz=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=LR(),o=typeof t==`number`,s=(0,m.useRef)(null);yie({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,z.jsxs)(m.Fragment,{children:[(0,z.jsxs)(`span`,{ref:s,children:[(0,z.jsx)(YR,Y({isNumber:o,"data-placement":`left`},c)),(0,z.jsx)(Fz,Y({},c,{children:t})),(0,z.jsx)(YR,Y({isNumber:o,"data-placement":`right`},c))]}),(0,z.jsx)(ZR,Y({},c))]})};Vz.displayName=`JVR.KayName`;var Hz=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=ZL(),s=zz(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;return n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u?(0,z.jsx)(Xz,{keyName:t,value:l?Array.from(n):u?Object.fromEntries(n):n,parentValue:r,initialValue:n,keys:a,level:i+1}):(0,z.jsxs)(Lz,Y({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,z.jsx)(Vz,{keyName:t,value:n,keys:a,parentValue:r}),(0,z.jsx)(Az,{keyName:t,value:n,keys:a}),(0,z.jsx)(Rz,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};Hz.displayName=`JVR.KeyValuesItem`;var Sie=[`value`,`keyName`],Cie=[`as`,`render`],Uz=e=>{var{CountInfoExtra:t={}}=OR();return Nz(t,e,`CountInfoExtra`),null};Uz.displayName=`JVR.CountInfoExtra`;var Wz=e=>{var{value:t={},keyName:n}=e,r=WL(e,Sie),{CountInfoExtra:i={}}=OR(),{as:a,render:o}=i,s=WL(i,Cie);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=Y({},s,r);return l&&o(u,{value:t,keyName:n})||(0,z.jsx)(c,Y({},u))};Wz.displayName=`JVR.CountInfoExtraComps`;var wie=[`value`,`keyName`],Tie=[`as`,`render`],Gz=e=>{var{CountInfo:t={}}=OR();return Nz(t,e,`CountInfo`),null};Gz.displayName=`JVR.CountInfo`;var Kz=e=>{var{value:t={},keyName:n}=e,r=WL(e,wie),{displayObjectSize:i}=LR(),{CountInfo:a={}}=OR();if(!i)return null;var{as:o,render:s}=a,c=WL(a,Tie),l=o||`span`;c.style=Y({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=Y({},c,r);return s&&typeof s==`function`&&s(Y({},d,{"data-length":u}),{value:t,keyName:n})||(0,z.jsx)(l,Y({},d))};Kz.displayName=`JVR.CountInfoComp`;var Eie=[`as`,`render`],qz=e=>{var{Ellipsis:t={}}=OR();return Nz(t,e,`Ellipsis`),null};qz.displayName=`JVR.Ellipsis`;var Jz=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=OR(),{as:a,render:o}=i,s=WL(i,Eie),c=a||`span`;return o&&typeof o==`function`&&o(Y({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,z.jsx)(c,Y({},s)))};Jz.displayName=`JVR.EllipsisComp`;var Yz=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=nR(),l=aR(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=LR(),p=typeof d==`boolean`?d:typeof d==`number`?s>d:!1,m=c[n]??(f?!1:p),h=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!h);var g=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},_={display:`inline-flex`,alignItems:`center`},v={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},y=Object.keys(a).length,b=typeof a==`object`,x=Array.isArray(a),S=a instanceof Set,C=y!==0&&(x||S||b),w={style:_};C&&(w.onClick=g);var T={keyName:t,value:a,keys:r,parentValue:o};return(0,z.jsxs)(`span`,Y({},w,{children:[C&&(0,z.jsx)(QR,Y({style:v,expandKey:n},T)),(t||typeof t==`number`)&&(0,z.jsx)(Vz,Y({},T)),(0,z.jsx)(gz,{value:i,keyName:t}),(0,z.jsx)(_z,{value:i,keyName:t}),(0,z.jsx)($R,Y({isBrackets:x||S},T)),(0,z.jsx)(Jz,{keyName:t,value:a,isExpanded:m}),(0,z.jsx)(ez,Y({isVisiable:m||!C,isBrackets:x||S},T)),(0,z.jsx)(Kz,{value:a,keyName:t}),(0,z.jsx)(Wz,{value:a,keyName:t}),(0,z.jsx)(Rz,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};Yz.displayName=`JVR.NestedOpen`;var Die=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],Xz=(0,m.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=WL(e,Die),u=ZL(),d=zz();return(0,z.jsxs)(`div`,Y({className:[n,`w-rjv-inner`].filter(Boolean).join(` `),ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,z.jsx)(Yz,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,z.jsx)(Bz,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,z.jsx)(tz,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});Xz.displayName=`JVR.Container`;var Zz=e=>{var{BraceLeft:t={}}=bR();return jz(t,e,`BraceLeft`),null};Zz.displayName=`JVR.BraceLeft`;var Qz=e=>{var{BraceRight:t={}}=bR();return jz(t,e,`BraceRight`),null};Qz.displayName=`JVR.BraceRight`;var $z=e=>{var{BracketsLeft:t={}}=bR();return jz(t,e,`BracketsLeft`),null};$z.displayName=`JVR.BracketsLeft`;var eB=e=>{var{BracketsRight:t={}}=bR();return jz(t,e,`BracketsRight`),null};eB.displayName=`JVR.BracketsRight`;var tB=e=>{var{Arrow:t={}}=bR();return jz(t,e,`Arrow`),null};tB.displayName=`JVR.Arrow`;var nB=e=>{var{Colon:t={}}=bR();return jz(t,e,`Colon`),null};nB.displayName=`JVR.Colon`;var rB=e=>{var{Quote:t={}}=bR();return jz(t,e,`Quote`),null};rB.displayName=`JVR.Quote`;var iB=e=>{var{ValueQuote:t={}}=bR();return jz(t,e,`ValueQuote`),null};iB.displayName=`JVR.ValueQuote`;var aB=e=>{var{Bigint:t={}}=uR();return Mz(t,e,`Bigint`),null};aB.displayName=`JVR.Bigint`;var oB=e=>{var{Date:t={}}=uR();return Mz(t,e,`Date`),null};oB.displayName=`JVR.Date`;var sB=e=>{var{False:t={}}=uR();return Mz(t,e,`False`),null};sB.displayName=`JVR.False`;var cB=e=>{var{Float:t={}}=uR();return Mz(t,e,`Float`),null};cB.displayName=`JVR.Float`;var lB=e=>{var{Int:t={}}=uR();return Mz(t,e,`Int`),null};lB.displayName=`JVR.Int`;var uB=e=>{var{Map:t={}}=uR();return Mz(t,e,`Map`),null};uB.displayName=`JVR.Map`;var dB=e=>{var{Nan:t={}}=uR();return Mz(t,e,`Nan`),null};dB.displayName=`JVR.Nan`;var fB=e=>{var{Null:t={}}=uR();return Mz(t,e,`Null`),null};fB.displayName=`JVR.Null`;var pB=e=>{var{Set:t={}}=uR();return Mz(t,e,`Set`),null};pB.displayName=`JVR.Set`;var mB=e=>{var{Str:t={}}=uR();return Mz(t,e,`Str`),null};mB.displayName=`JVR.StringText`;var hB=e=>{var{True:t={}}=uR();return Mz(t,e,`True`),null};hB.displayName=`JVR.True`;var gB=e=>{var{Undefined:t={}}=uR();return Mz(t,e,`Undefined`),null};gB.displayName=`JVR.Undefined`;var _B=e=>{var{Url:t={}}=uR();return Mz(t,e,`Url`),null};_B.displayName=`JVR.Url`;var vB=e=>{var{Copied:t={}}=OR();return Nz(t,e,`Copied`),null};vB.displayName=`JVR.Copied`;var Oie=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],yB=(0,m.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:h=!1,onExpand:g,onCopied:_,beforeCopy:v}=e,y=WL(e,Oie),b=Y({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),x=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,z.jsxs)(RR,{initialState:{value:i,objectSortKeys:h,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:_,onExpand:g,beforeCopy:v},initialTypes:{displayDataTypes:m},children:[(0,z.jsx)(Xz,Y({value:i},y,{ref:t,className:x,style:b})),a]})});yB.Bigint=aB,yB.Date=oB,yB.False=sB,yB.Float=cB,yB.Int=lB,yB.Map=uB,yB.Nan=dB,yB.Null=fB,yB.Set=pB,yB.String=mB,yB.True=hB,yB.Undefined=gB,yB.Url=_B,yB.ValueQuote=iB,yB.Arrow=tB,yB.Colon=nB,yB.Quote=rB,yB.Ellipsis=qz,yB.BraceLeft=Zz,yB.BraceRight=Qz,yB.BracketsLeft=$z,yB.BracketsRight=eB,yB.Copied=vB,yB.CountInfo=Gz,yB.CountInfoExtra=Uz,yB.KeyName=Pz,yB.Row=Iz,yB.displayName=`JVR.JsonView`;var kie=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:12,cy:12,r:10}),(0,z.jsx)(`path`,{d:`m9 12l2 2l4-4`})]})}),bB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m6 9l6 6l6-6`})}),xB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m9 18l6-6l-6-6`})}),SB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`circle`,{cx:12,cy:12,r:10,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2})}),CB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}),(0,z.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5M10 9H8m8 4H8m8 4H8`})]})}),wB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`})}),Aie=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:12,cy:12,r:10}),(0,z.jsx)(`path`,{d:`M8 12h8`})]})}),TB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})}),EB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:12,cy:12,r:10}),(0,z.jsx)(`path`,{d:`m15 9l-6 6m0-6l6 6`})]})}),DB=`sonamu.ui.test-result-viewer.v1`,jie=100,OB=5*1024*1024;function Mie(){try{let e=sessionStorage.getItem(DB);if(e===null)return{runs:[]};let t=JSON.parse(e);return Pie(t)?t:{runs:[]}}catch{return{runs:[]}}}function Nie(e){return new TextEncoder().encode(e).length}function kB(e){let t=JSON.stringify(e),n=Nie(t);try{return sessionStorage.setItem(DB,t),{ok:!0}}catch(t){if(AB(t)&&e.runs.length>1){let t={runs:e.runs.slice(0,Math.ceil(e.runs.length/2))};try{return sessionStorage.setItem(DB,JSON.stringify(t)),{ok:!0}}catch{return{ok:!1,reason:`quota-exceeded`,payloadBytes:n,quotaHintBytes:OB}}}return AB(t)?{ok:!1,reason:`quota-exceeded`,payloadBytes:n,quotaHintBytes:OB}:(console.warn(`[sonamu] sessionStorage write failed:`,t),{ok:!0})}}function AB(e){return e instanceof DOMException?e.name===`QuotaExceededError`||e.code===22:!1}function Pie(e){if(typeof e!=`object`||!e)return!1;let t=e;return Array.isArray(t.runs)}function Fie(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function Iie(){let[e,t]=(0,m.useState)(Mie),[n,r]=(0,m.useState)(null),i=(0,m.useRef)(new Set);return{history:e,storageWarning:n,addRun:(0,m.useCallback)(e=>{t(t=>{let n={...e,dateKey:Fie(e.finishedAt)},a=[n,...t.runs];a.sort((e,t)=>new Date(t.finishedAt).getTime()-new Date(e.finishedAt).getTime());let o=a.slice(0,jie),s={runs:o},c=o.filter(e=>!i.current.has(e.runId)),l=kB({runs:c});return!l.ok&&l.reason===`quota-exceeded`?(i.current.add(n.runId),kB({runs:c.filter(e=>e.runId!==n.runId)}),r({runId:n.runId,reason:`quota-exceeded`,payloadBytes:l.payloadBytes,quotaHintBytes:l.quotaHintBytes})):r(null),s})},[]),clearHistory:(0,m.useCallback)(()=>{t({runs:[]}),r(null),i.current.clear();try{sessionStorage.removeItem(DB)}catch{}},[])}}function jB(e){return typeof e==`object`&&!!e}function MB(e){return e.schemaVersion===1}function Lie(e){return jB(e)?typeof e.ready==`boolean`&&typeof e.running==`boolean`&&(e.lastRunAt===null||typeof e.lastRunAt==`string`):!1}function Rie(e){return!jB(e)||!MB(e)?!1:typeof e.serverTime==`string`&&Lie(e.status)}function zie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.queuedAt==`string`&&jB(e.request)}function Bie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.startedAt==`string`}function Vie(e){if(!jB(e)||!MB(e)||typeof e.runId!=`string`||typeof e.startedAt!=`string`||typeof e.finishedAt!=`string`||!jB(e.result))return!1;let t=e.result;return typeof t.ok==`boolean`&&jB(t.summary)&&Array.isArray(t.results)}function Hie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.finishedAt==`string`&&jB(e.error)&&typeof e.error.message==`string`}function Uie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.startedAt==`string`&&typeof e.at==`string`&&(e.kind===`file`||e.kind===`suite`||e.kind===`test`)&&(e.phase===`ready`||e.phase===`result`)&&typeof e.fileId==`string`&&typeof e.nodeId==`string`&&(e.parentId===null||typeof e.parentId==`string`)&&jB(e.node)}function Wie(e){return!jB(e)||!MB(e)?!1:typeof e.at==`string`}var Gie={snapshot:Rie,runQueued:zie,runStarted:Bie,runCompleted:Vie,runErrored:Hie,runNodeProgress:Uie,heartbeat:Wie},Kie=`/__test__/events`,qie=3e4;function Jie(e){let t=e?.enabled??!0,[n,r]=(0,m.useState)(!1),i=(0,m.useRef)(null),a=(0,m.useRef)(new Map),o=(0,m.useRef)(0),s=(0,m.useRef)(null),c=(0,m.useRef)(!1),l=(0,m.useCallback)(()=>{if(c.current)return;let e=new EventSource(Kie);i.current=e,e.onopen=()=>{c.current||(o.current=0,r(!0))},e.onerror=()=>{c.current||(e.close(),i.current=null,r(!1),u())};for(let t of[`snapshot`,`runQueued`,`runStarted`,`runCompleted`,`runErrored`,`runNodeProgress`,`heartbeat`])e.addEventListener(t,e=>{if(!c.current)try{let n=JSON.parse(e.data),r=Gie[t];if(r(n)){let e=a.current.get(t);if(e)for(let t of e)t(n)}}catch{}})},[]),u=(0,m.useCallback)(()=>{if(c.current)return;let e=Math.min(1e3*2**o.current,qie);o.current+=1,s.current=setTimeout(()=>{s.current=null,l()},e)},[l]);return(0,m.useEffect)(()=>{if(c.current=!1,t)return l(),()=>{c.current=!0,s.current!==null&&(clearTimeout(s.current),s.current=null),i.current&&=(i.current.close(),null)}},[l,t]),{connected:n,on:(0,m.useCallback)((e,t)=>{let n=a.current.get(e);n||(n=new Set,a.current.set(e,n));let r=t;return n.add(r),()=>{n.delete(r)}},[])}}var Yie=hP(`/test-results`)({component:Zie});function NB(e){let t=0,n=0,r=0,i=0;for(let a of e)t+=a.counts.total,n+=a.counts.passed,r+=a.counts.failed,i+=a.counts.skipped;return{total:t,passed:n,failed:r,skipped:i}}function PB(e,t){return t.some(e=>e.state===`running`)?`running`:t.some(e=>e.state===`failed`)?`failed`:t.every(e=>e.state===`passed`||e.state===`skipped`||e.state===`todo`)?t.some(e=>e.state===`passed`)?`passed`:`skipped`:e.state}function FB(e,t,n,r){if(e.id===t){let t=e.children.findIndex(e=>e.id===n.id),i;if(t>=0){if(r===`ready`&&e.children[t].state!==`running`)return e;i=[...e.children],i[t]=n}else i=[...e.children,n];let a=NB(i),o=PB(e,i);return{...e,children:i,counts:a,state:o}}let i=!1,a=e.children.map(e=>{if(i)return e;let a=FB(e,t,n,r);return a!==e&&(i=!0),a});if(!i)return e;let o=NB(a),s=PB(e,a);return{...e,children:a,counts:o,state:s}}function Xie(e,t){if(!e||t.runId!==e.runId)return e;let n=new Map(e.fileResults);if(t.kind===`file`||t.parentId===null)t.phase===`ready`&&n.has(t.fileId)||n.set(t.fileId,t.node);else{let r=n.get(t.fileId);if(!r)return e;let i=FB(r,t.parentId,t.node,t.phase);n.set(t.fileId,i)}return{...e,fileResults:n}}function Zie(){let{SD:e}=kP(),t=J.useTestStatus(),n=t.data?.sseAvailable??!1,{connected:r,on:i}=Jie({enabled:n}),{history:a,storageWarning:o,addRun:s,clearHistory:c}=Iie(),[l,u]=(0,m.useState)(null),[d,f]=(0,m.useState)(!0),[p,h]=(0,m.useState)(null),[g,_]=(0,m.useState)(null),[v,y]=(0,m.useState)(null),b=(0,m.useRef)([]),x=(0,m.useRef)(null),S=(0,m.useCallback)(()=>(x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),b.current.splice(0)),[]),C=(0,m.useCallback)(()=>{x.current===null&&(x.current=requestAnimationFrame(()=>{x.current=null;let e=b.current.splice(0);e.length!==0&&y(t=>{let n=t;for(let t of e)n=Xie(n,t);return n})}))},[]);(0,m.useEffect)(()=>{f(!r)},[r]),(0,m.useEffect)(()=>{let e=[];return e.push(i(`snapshot`,e=>{u(e.status)})),e.push(i(`runStarted`,e=>{b.current.length=0,x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),u(e=>e&&{...e,running:!0}),y({runId:e.runId,startedAt:e.startedAt,fileResults:new Map}),h(null)})),e.push(i(`runNodeProgress`,e=>{b.current.push(e),C()})),e.push(i(`runCompleted`,e=>{S(),u(t=>t&&{...t,running:!1,lastRunAt:e.finishedAt}),s({runId:e.runId,startedAt:e.startedAt,finishedAt:e.finishedAt,result:e.result}),y(null),h(e.runId)})),e.push(i(`runErrored`,e=>{S(),u(t=>t&&{...t,running:!1,lastRunAt:e.finishedAt}),y(null)})),()=>{for(let t of e)t();x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),b.current.length=0}},[i,s,S,C]);let w=(0,m.useMemo)(()=>p?a.runs.find(e=>e.runId===p)??null:null,[p,a.runs]),T=(0,m.useMemo)(()=>!w||!o||o.runId!==w.runId?null:o,[w,o]),E=(0,m.useMemo)(()=>v?Array.from(v.fileResults.values()):null,[v]),D=(0,m.useMemo)(()=>{if(!E)return null;let e=0,t=0,n=0,r=0,i=0;for(let a of E)e+=a.counts.total,t+=a.counts.passed,n+=a.counts.failed,r+=a.counts.skipped,a.durationMs&&(i+=a.durationMs);return{total:e,passed:t,failed:n,skipped:r,durationMs:i}},[E]),O=!p&&v!==null,k=(0,m.useMemo)(()=>O&&E?E:w?w.result.results:null,[O,E,w]),A=(0,m.useMemo)(()=>{if(!k)return new Map;let e=new Map,t=n=>{for(let r of n)e.set(r.id,r),r.children.length>0&&t(r.children)};return t(k),e},[k]),j=(0,m.useMemo)(()=>g?A.get(g)??null:null,[A,g]),M=(0,m.useCallback)(e=>{h(e),_(null)},[]),N=(0,m.useCallback)(()=>{h(null),_(null)},[]);return t.isSuccess&&!n?(0,z.jsx)(`div`,{className:`flex items-center justify-center h-[calc(100vh-var(--gnb-height,48px))]`,children:(0,z.jsx)(`div`,{className:`text-center`,children:(0,z.jsx)(`p`,{className:`text-gray-600 text-sm`,children:e(`testResults.sseNotAvailable`)})})}):(0,z.jsxs)(`div`,{className:`flex flex-col h-[calc(100vh-var(--gnb-height,48px))]`,children:[(0,z.jsx)(Qie,{connected:r,connecting:d,managerStatus:l}),(0,z.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,z.jsx)($ie,{runs:a.runs,selectedRunId:p,onSelectRun:M,onClearHistory:c,liveRun:v,showLiveRun:O,onSelectLiveRun:N}),(0,z.jsx)(`div`,{className:`flex-1 overflow-auto`,children:O&&E&&D?(0,z.jsx)(rae,{results:E,summary:D,selectedNodeId:g,selectedNode:j,onSelectNode:_}):w?(0,z.jsx)(nae,{run:w,storageWarning:T,selectedNodeId:g,selectedNode:j,onSelectNode:_}):(0,z.jsx)(`div`,{className:`flex items-center justify-center h-full text-gray-400`,children:e(`testResults.noHistory`)})})]})]})}function Qie({connected:e,connecting:t,managerStatus:n}){let{SD:r}=kP();return(0,z.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2 bg-gray-50 border-b border-gray-200 text-sm shrink-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block w-2.5 h-2.5 rounded-full`,{"bg-green-500":e,"bg-yellow-400 animate-pulse":t&&!e,"bg-gray-400":!e&&!t})}),(0,z.jsx)(`span`,{className:`text-gray-600`,children:r(e?`testResults.connected`:t?`testResults.connecting`:`testResults.disconnected`)})]}),n?.running&&(0,z.jsx)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 bg-blue-100 text-blue-700 text-xs font-medium rounded-full animate-pulse`,children:`Running`})]})}function $ie({runs:e,selectedRunId:t,onSelectRun:n,onClearHistory:r,liveRun:i,showLiveRun:a,onSelectLiveRun:o}){let{SD:s}=kP(),c=(0,m.useMemo)(()=>{let t=new Map;for(let n of e){let e=t.get(n.dateKey);e?e.push(n):t.set(n.dateKey,[n])}let n=Array.from(t.entries());return n.sort((e,t)=>t[0].localeCompare(e[0])),n},[e]);return(0,z.jsxs)(`div`,{className:`w-60 shrink-0 flex flex-col border-r border-gray-200 bg-gray-50 overflow-hidden`,children:[(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2`,children:[i&&(0,z.jsx)(`button`,{type:`button`,"aria-label":s(`testResults.liveRunning`),className:(0,kL.default)(`w-full text-left px-2 py-1.5 rounded text-sm cursor-pointer transition-colors mb-2`,{"bg-blue-100 text-blue-900":a,"hover:bg-gray-200":!a}),onClick:o,children:(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full bg-blue-500 animate-pulse`}),(0,z.jsx)(`span`,{className:`text-xs font-semibold text-blue-700`,children:s(`testResults.liveRunning`)})]})}),e.length===0&&!i?(0,z.jsx)(`div`,{className:`text-center text-gray-400 text-sm py-8`,children:s(`testResults.noHistory`)}):c.map(([e,r])=>(0,z.jsxs)(`div`,{className:`mb-3`,children:[(0,z.jsx)(`div`,{className:`text-xs font-semibold text-gray-500 px-2 py-1`,children:e}),r.map(e=>(0,z.jsx)(`button`,{type:`button`,className:(0,kL.default)(`w-full text-left px-2 py-1.5 rounded text-sm cursor-pointer transition-colors`,{"bg-blue-100 text-blue-900":t===e.runId,"hover:bg-gray-200":t!==e.runId}),onClick:()=>n(e.runId),children:(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,z.jsx)(eae,{summary:e.result.summary}),(0,z.jsx)(`span`,{className:`text-xs text-gray-400 ml-auto`,children:tae(e.finishedAt)})]})},e.runId))]},e))]}),e.length>0&&(0,z.jsx)(`div`,{className:`p-2 border-t border-gray-200`,children:(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(TB,{}),onClick:r,className:`w-full`,children:s(`testResults.clearHistory`)})})]})}function eae({summary:e}){return(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.passed>0&&(0,z.jsx)(`span`,{className:`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded bg-green-100 text-green-700`,children:e.passed}),e.failed>0&&(0,z.jsx)(`span`,{className:`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded bg-red-100 text-red-700`,children:e.failed}),e.skipped>0&&(0,z.jsx)(`span`,{className:`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded bg-gray-100 text-gray-500`,children:e.skipped})]})}function tae(e){let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`}function nae({run:e,storageWarning:t,selectedNodeId:n,selectedNode:r,onSelectNode:i}){return(0,z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,z.jsx)(IB,{summary:e.result.summary,storageWarning:t}),(0,z.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,z.jsx)(zB,{results:e.result.results,selectedNodeId:n,onSelectNode:i}),(0,z.jsx)(VB,{node:r})]})]})}function rae({results:e,summary:t,selectedNodeId:n,selectedNode:r,onSelectNode:i}){return(0,z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,z.jsx)(IB,{summary:t}),(0,z.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,z.jsx)(zB,{results:e,selectedNodeId:n,onSelectNode:i}),(0,z.jsx)(VB,{node:r})]})]})}function IB({summary:e,storageWarning:t=null}){let{SD:n}=kP();return(0,z.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-3 bg-white border-b border-gray-200 text-sm shrink-0`,children:[(0,z.jsxs)(`span`,{className:`text-gray-600`,children:[n(`testResults.summary.total`),`: `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.total})]}),(0,z.jsxs)(`span`,{className:`text-green-600`,children:[n(`testResults.summary.passed`),`: `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.passed})]}),(0,z.jsxs)(`span`,{className:`text-red-600`,children:[n(`testResults.summary.failed`),`: `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.failed})]}),(0,z.jsxs)(`span`,{className:`text-gray-500`,children:[n(`testResults.summary.skipped`),`:`,` `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.skipped})]}),(0,z.jsxs)(`span`,{className:`text-gray-500`,children:[n(`testResults.summary.duration`),`:`,` `,(0,z.jsx)(`span`,{className:`font-mono`,children:LB(e.durationMs)})]}),t?.reason===`quota-exceeded`&&(0,z.jsxs)(`span`,{className:`text-amber-700 text-xs`,children:[n(`testResults.storageWarning.quotaExceeded`),` (`,n(`testResults.storageWarning.limit`),`: `,RB(t.quotaHintBytes),`,`,n(`testResults.storageWarning.resultSize`),`:`,` `,RB(t.payloadBytes),`)`]})]})}function LB(e){return e>=6e4?`${(e/6e4).toFixed(1)}m`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(2)}ms`}function RB(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(2)}MB`:e>=1024?`${(e/1024).toFixed(1)}KB`:`${e}B`}function iae(e){let t=new Set,n=e=>{if(e.children.length===0)return e.state===`failed`;let r=!1;for(let t of e.children)n(t)&&(r=!0);return r&&t.add(e.id),r};for(let r of e)t.add(r.id),n(r);return t}function aae(e,t){let n=e=>{if(e.name.toLowerCase().includes(t))return e;let r=e.children.flatMap(e=>{let t=n(e);return t?[t]:[]});return r.length>0?{...e,children:r}:null};return e.flatMap(e=>{let t=n(e);return t?[t]:[]})}function oae(e){let t=new Set,n=e=>{t.add(e.id);for(let t of e.children)n(t)};for(let t of e)n(t);return t}function sae(e,t){let n=[],r=(e,i)=>{let a=e.children.length>0;if(n.push({node:e,depth:i,hasChildren:a}),a&&t.has(e.id))for(let t of e.children)r(t,i+1)};for(let t of e)r(t,0);return n}function zB({results:e,selectedNodeId:t,onSelectNode:n}){let{SD:r}=kP(),[i,a]=(0,m.useState)(()=>iae(e)),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(``),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{let e=setTimeout(()=>l(o),300);return()=>clearTimeout(e)},[o]);let d=(0,m.useMemo)(()=>{let t=c.toLowerCase();return t?aae(e,t):e},[e,c]);(0,m.useEffect)(()=>{c?(u.current===null&&(u.current=new Set(i)),a(oae(d))):u.current!==null&&(a(u.current),u.current=null)},[c,d]);let f=(0,m.useRef)(e);(0,m.useEffect)(()=>{if(f.current!==e){if(f.current=e,u.current!==null)return;a(t=>{let n=new Set(t),r=e=>{if(e.children.length===0)return e.state===`failed`;let t=!1;for(let n of e.children)r(n)&&(t=!0);return t&&n.add(e.id),t};for(let t of e)n.has(t.id)||n.add(t.id),r(t);return n})}},[e]);let p=(0,m.useMemo)(()=>sae(d,i),[d,i]),h=(0,m.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return(0,z.jsxs)(`div`,{className:`w-120 shrink-0 border-r border-gray-200 overflow-y-auto p-2`,children:[(0,z.jsxs)(`div`,{className:`relative mb-2`,children:[(0,z.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:r(`testResults.tree.searchPlaceholder`),className:`w-full text-xs px-2 py-1 pr-6 border border-gray-200 rounded outline-none focus:border-blue-400`}),o&&(0,z.jsx)(`button`,{type:`button`,"aria-label":r(`testResults.tree.clearSearch`),className:`absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600`,onClick:()=>{s(``),l(``)},children:(0,z.jsx)(EB,{className:`w-3.5 h-3.5`})})]}),p.map(e=>(0,z.jsx)(cae,{row:e,isSelected:t===e.node.id,expanded:i.has(e.node.id),onSelectNode:n,onToggleExpand:h},e.node.id)),c&&p.length===0&&(0,z.jsx)(`div`,{className:`text-xs text-gray-400 px-2 py-1`,children:r(`testResults.tree.noMatches`)})]})}var cae=(0,m.memo)(function({row:e,isSelected:t,expanded:n,onSelectNode:r,onToggleExpand:i}){return(0,z.jsxs)(`button`,{type:`button`,className:(0,kL.default)(`w-full flex items-center gap-1.5 px-2 py-1 rounded text-sm cursor-pointer transition-colors text-left`,{"bg-blue-100":t,"hover:bg-gray-100":!t}),style:{paddingLeft:`${e.depth*16+8}px`},onClick:()=>{r(e.node.id),e.hasChildren&&i(e.node.id)},children:[e.hasChildren?n?(0,z.jsx)(bB,{className:`w-3.5 h-3.5 text-gray-400 shrink-0`}):(0,z.jsx)(xB,{className:`w-3.5 h-3.5 text-gray-400 shrink-0`}):(0,z.jsx)(`span`,{className:`w-3.5 shrink-0`}),(0,z.jsx)(BB,{state:e.node.state,kind:e.node.kind}),(0,z.jsx)(`span`,{className:(0,kL.default)(`truncate`,{"text-red-600":e.node.state===`failed`,"text-green-700":e.node.state===`passed`,"text-gray-400":e.node.state===`skipped`||e.node.state===`todo`}),children:e.node.name}),e.node.durationMs!==null&&(0,z.jsx)(`span`,{className:`ml-auto text-xs text-gray-400 font-mono shrink-0`,children:LB(e.node.durationMs)})]})});function BB({state:e,kind:t}){return t===`file`?(0,z.jsx)(CB,{className:(0,kL.default)(`w-4 h-4 shrink-0`,{"text-green-600":e===`passed`,"text-red-500":e===`failed`,"text-gray-400":e===`skipped`||e===`todo`||e===`unknown`,"text-blue-500":e===`running`})}):t===`suite`?(0,z.jsx)(wB,{className:(0,kL.default)(`w-4 h-4 shrink-0`,{"text-green-600":e===`passed`,"text-red-500":e===`failed`,"text-gray-400":e===`skipped`||e===`todo`||e===`unknown`,"text-blue-500":e===`running`})}):e===`passed`?(0,z.jsx)(kie,{className:`w-4 h-4 text-green-600 shrink-0`}):e===`failed`?(0,z.jsx)(EB,{className:`w-4 h-4 text-red-500 shrink-0`}):e===`skipped`||e===`todo`?(0,z.jsx)(Aie,{className:`w-4 h-4 text-gray-400 shrink-0`}):(0,z.jsx)(SB,{className:`w-4 h-4 text-gray-400 shrink-0`})}var VB=(0,m.memo)(function({node:e}){return e?(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4 space-y-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,z.jsx)(BB,{state:e.state,kind:e.kind}),(0,z.jsx)(`span`,{className:`font-semibold`,children:e.fullName}),e.durationMs!==null&&(0,z.jsx)(`span`,{className:`text-gray-400 font-mono text-xs`,children:LB(e.durationMs)})]}),e.error&&(0,z.jsx)(lae,{error:e.error}),(0,z.jsx)(dae,{traces:e.traces})]}):(0,z.jsx)(`div`,{className:`flex-1`})});function lae({error:e}){let{SD:t}=kP();return(0,z.jsxs)(`div`,{className:`border border-red-200 rounded-md overflow-hidden`,children:[(0,z.jsx)(`div`,{className:`px-3 py-1.5 bg-red-50 text-red-700 text-xs font-semibold border-b border-red-200`,children:t(`testResults.detail.error`)}),(0,z.jsxs)(`pre`,{className:`p-3 text-xs text-red-800 bg-red-50/50 overflow-x-auto whitespace-pre-wrap`,children:[e.message,e.stack&&`\n\n${e.stack}`]})]})}function uae(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}function HB(e,t){if(!t)return e;let n=e.toLowerCase(),r=t.toLowerCase(),i=[],a=0,o=n.indexOf(r,a);for(;o!==-1;)o>a&&i.push(e.slice(a,o)),i.push((0,z.jsx)(`mark`,{className:`bg-yellow-200 text-yellow-900`,children:e.slice(o,o+r.length)},o)),a=o+r.length,o=n.indexOf(r,a);return a<e.length&&i.push(e.slice(a)),i.length>0?i:e}function dae({traces:e}){let{SD:t}=kP(),[n,r]=(0,m.useState)(()=>new Set),[i,a]=(0,m.useState)(``),[o,s]=(0,m.useState)(``),c=(0,m.useRef)(new Map),l=(0,m.useRef)(e);l.current!==e&&(l.current=e,c.current.clear()),(0,m.useEffect)(()=>{let e=setTimeout(()=>s(i),300);return()=>clearTimeout(e)},[i]);let u=(0,m.useMemo)(()=>{let t=o.toLowerCase();return e.reduce((e,n,r)=>{let i=`${n.key}-${n.at}-${r}`,a=c.current.get(i);return a===void 0&&(a=`${n.key} ${JSON.stringify(n.value)}`.toLowerCase(),c.current.set(i,a)),(!o||a.includes(t))&&e.push({trace:n,originalIndex:r}),e},[])},[e,o]),d=(0,m.useCallback)(e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),f=(0,m.useCallback)(()=>{r(new Set(e.map((e,t)=>`${e.key}-${e.at}-${t}`)))},[e]),p=(0,m.useCallback)(()=>{r(new Set)},[]);return(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-gray-600 mb-1`,children:[t(`testResults.detail.traces`),(0,z.jsxs)(`span`,{className:`flex gap-1 font-normal`,children:[(0,z.jsx)(`button`,{type:`button`,className:`text-blue-500 hover:text-blue-700`,onClick:f,children:t(`testResults.detail.expandAll`)}),(0,z.jsx)(`span`,{className:`text-gray-300`,children:`/`}),(0,z.jsx)(`button`,{type:`button`,className:`text-blue-500 hover:text-blue-700`,onClick:p,children:t(`testResults.detail.collapseAll`)})]})]}),(0,z.jsxs)(`div`,{className:`relative mb-1.5`,children:[(0,z.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:t(`testResults.detail.searchPlaceholder`),className:`w-full text-xs px-2 py-1 pr-6 border border-gray-200 rounded outline-none focus:border-blue-400`}),i&&(0,z.jsx)(`button`,{type:`button`,"aria-label":t(`testResults.detail.clearSearch`),className:`absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600`,onClick:()=>{a(``),s(``)},children:(0,z.jsx)(EB,{className:`w-3.5 h-3.5`})})]}),u.length===0&&e.length===0?(0,z.jsx)(`div`,{className:`text-xs text-gray-400`,children:t(`testResults.detail.noTraces`)}):u.length===0?(0,z.jsx)(`div`,{className:`text-xs text-gray-400`,children:t(`testResults.detail.noTraceMatches`)}):(0,z.jsx)(`div`,{className:`space-y-1.5`,children:u.map(({trace:e,originalIndex:t})=>{let r=`${e.key}-${e.at}-${t}`,i=n.has(r),a=uae(e.value),s=typeof a==`object`&&a?a:{value:a};return(0,z.jsxs)(`div`,{className:`text-xs border border-gray-100 rounded overflow-hidden`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`flex items-center w-full px-2 py-1 bg-gray-50 cursor-pointer text-left`,onClick:()=>d(r),children:[i?(0,z.jsx)(bB,{className:`w-3 h-3 text-gray-400 mr-1 shrink-0`}):(0,z.jsx)(xB,{className:`w-3 h-3 text-gray-400 mr-1 shrink-0`}),(0,z.jsx)(`span`,{className:`font-mono font-semibold text-blue-700`,children:e.key}),(0,z.jsxs)(`span`,{className:`ml-3 text-gray-400 text-[11px]`,children:[e.filePath,`:`,e.lineNumber]})]}),i&&(0,z.jsx)(`div`,{className:`px-2 py-1.5 overflow-x-auto`,children:(0,z.jsx)(yB,{value:s,collapsed:!1,displayDataTypes:!1,indentWidth:12,enableClipboard:!1,style:{fontSize:`12px`},children:o&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(yB.KeyName,{render:(e,{keyName:t})=>{let n=String(t);return(0,z.jsx)(`span`,{...e,children:HB(n,o)})}}),(0,z.jsx)(yB.String,{render:(e,{value:t})=>{let n=String(t);return(0,z.jsx)(`span`,{...e,children:HB(n,o)})}})]})})})]},r)})})]})}var fae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m15 18l-6-6l6-6`})}),UB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:12,cy:12,r:10}),(0,z.jsx)(`path`,{d:`M10 15V9m4 6V9`})]})}),WB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`}),(0,z.jsx)(`circle`,{cx:12,cy:12,r:10})]})}),GB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9a9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,z.jsx)(`path`,{d:`M21 3v5h-5m5 4a9 9 0 0 1-9 9a9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,z.jsx)(`path`,{d:`M8 16H3v5`})]})}),pae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,z.jsx)(`path`,{d:`M3 3v5h5`})]})}),KB={pending:`bg-yellow-100 text-yellow-800 border-yellow-200`,running:`bg-blue-100 text-blue-800 border-blue-200`,sleeping:`bg-purple-100 text-purple-800 border-purple-200`,succeeded:`bg-green-100 text-green-800 border-green-200`,completed:`bg-green-100 text-green-800 border-green-200`,failed:`bg-red-100 text-red-800 border-red-200`,paused:`bg-orange-100 text-orange-800 border-orange-200`,canceled:`bg-gray-100 text-gray-800 border-gray-200`};function qB(e,t){return e?new Date(e).toLocaleString(t??`ko`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):`-`}function JB(e,t){if(!e)return`-`;let n=new Date(e).getTime(),r=(t?new Date(t).getTime():Date.now())-n;return r<1e3?`${r}ms`:r<6e4?`${(r/1e3).toFixed(1)}s`:r<36e5?`${Math.floor(r/6e4)}m ${Math.floor(r%6e4/1e3)}s`:`${Math.floor(r/36e5)}h ${Math.floor(r%36e5/6e4)}m`}var mae={options:[`pending`,`running`,`sleeping`,`paused`,`completed`,`failed`,`canceled`]},hae={pending:`PENDING`,running:`RUNNING`,sleeping:`SLEEPING`,paused:`PAUSED`,completed:`COMPLETED`,failed:`FAILED`,canceled:`CANCELED`};function YB(e){return e>=6e4?`${e/6e4}m`:e>=1e3?`${e/1e3}s`:`${e}ms`}function gae(e){if(!e)return`-`;let t=[];return e.maxAttempts&&t.push(`최대 ${e.maxAttempts}회`),e.initialIntervalMs&&t.push(`초기 ${YB(e.initialIntervalMs)}`),e.backoffCoefficient&&t.push(`배수 ${e.backoffCoefficient}x`),e.maximumIntervalMs&&t.push(`최대간격 ${YB(e.maximumIntervalMs)}`),e.hasDynamicPolicy&&t.push(`(+ dynamic)`),t.length>0?t.join(` · `):`-`}function _ae({startedAt:e}){let[,t]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(n)},[e]),(0,z.jsx)(`span`,{className:`font-mono text-sm`,children:JB(e,null)})}var vae={succeeded:`bg-green-100 text-green-700 border-green-200`,completed:`bg-green-100 text-green-700 border-green-200`,running:`bg-blue-100 text-blue-700 border-blue-200 animate-pulse`,failed:`bg-red-100 text-red-700 border-red-200`};function yae({steps:e}){return e.length===0?null:(0,z.jsxs)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:[e.map((e,t)=>(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t>0&&(0,z.jsx)(`span`,{className:`text-gray-300 text-xs`,children:`→`}),(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block px-1.5 py-0.5 text-[11px] font-mono rounded border`,vae[e.status]??`bg-gray-100 text-gray-600 border-gray-200`),children:e.stepName})]},e.id)),(0,z.jsx)(`span`,{className:`text-gray-300 text-xs ml-0.5`,children:`→ ···`})]})}function bae({run:e}){let{SD:t}=kP(),[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(!1),{data:c}=J.useStepAttempts(e.id),l=c?.data??[],u=[`pending`,`running`,`sleeping`].includes(e.status),d=e.status===`paused`;return(0,z.jsxs)(`div`,{className:`flex items-center gap-4 p-3 bg-white border border-blue-200 rounded-md`,children:[(0,z.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,z.jsx)(mP,{to:`/tasks/$workflowRunId`,params:{workflowRunId:e.id},className:`text-blue-600 hover:underline no-underline font-medium text-sm truncate`,children:e.workflowName}),(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded border shrink-0`,KB[e.status]??`bg-gray-100 text-gray-800`),children:e.status.toUpperCase()})]}),l.length>0?(0,z.jsx)(yae,{steps:l}):(0,z.jsx)(`span`,{className:`text-xs text-gray-400`,children:t(`tasks.active.noStepsYet`)})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,z.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[(0,z.jsxs)(`span`,{className:`mr-1`,children:[t(`tasks.active.elapsed`),`:`]}),(0,z.jsx)(_ae,{startedAt:e.startedAt})]}),u&&(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(UB,{}),disabled:i,onClick:()=>{confirm(t(`tasks.pauseConfirm`))&&(a(!0),J.pauseWorkflowRun(e.id).catch(PL).finally(()=>a(!1)))},children:t(`tasks.pause`)}),d&&(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(WB,{}),disabled:o,onClick:()=>{s(!0),J.resumeWorkflowRun(e.id).catch(PL).finally(()=>s(!1))},children:t(`tasks.resume`)}),(0,z.jsx)(B,{size:`xs`,variant:`destructive`,icon:(0,z.jsx)(EB,{}),disabled:n,onClick:()=>{confirm(t(`tasks.cancelConfirm`))&&(r(!0),J.cancelWorkflowRun(e.id).catch(PL).finally(()=>r(!1)))},children:t(`tasks.cancel`)})]})]})}function xae(){let{SD:e}=kP(),{data:t}=J.useWorkflowRuns({status:[`pending`,`running`,`sleeping`,`paused`]}),n=t?.data??[];return n.length===0?null:(0,z.jsxs)(`div`,{className:`block p-4 bg-blue-50 border-2 border-blue-300 rounded-md shadow-sm mb-4`,children:[(0,z.jsx)(`h3`,{className:`text-lg font-semibold mb-3 text-blue-900`,children:e(`tasks.active.title`)}),(0,z.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map(e=>(0,z.jsx)(bae,{run:e},e.id))})]})}var Sae=hP(`/tasks`)({component:Cae});function Cae(){let{SD:e}=kP(),t=DP(),[n,r]=(0,m.useState)({}),[i,a]=(0,m.useState)([]),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(),[u,d]=(0,m.useState)(),{data:f}=J.useWorkflowDefinitions(),p=f?.definitions??[],h=(0,m.useMemo)(()=>({options:p.map(e=>e.name)}),[p]),g=(0,m.useMemo)(()=>Object.fromEntries(p.map(e=>[e.name,e.name])),[p]),_=i.length>0||o!==``||c||u,{data:v,error:y,refetch:b,isLoading:x}=J.useWorkflowRuns({limit:50,...n,...i.length>0?{status:i}:{},...o?{workflowName:o}:{},...c?{createdAfter:c.toISOString()}:{},...u?{createdBefore:u.toISOString()}:{}}),S=v?.data??[],C=v?.pagination;return y?(0,z.jsx)(`div`,{className:`p-8`,children:(0,z.jsx)(`div`,{className:`max-w-2xl mx-auto my-[30vh] p-8 bg-white border-2 border-red-500 rounded-md whitespace-pre-line leading-8`,children:y.message})}):(0,z.jsxs)(`div`,{className:`p-8`,children:[(0,z.jsx)(xae,{}),(0,z.jsxs)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm mb-4`,children:[(0,z.jsx)(`h3`,{className:`text-xl font-semibold mb-4`,children:e(`tasks.definitions`)}),p.length===0?(0,z.jsx)(`div`,{className:`text-center py-8 text-gray-400`,children:e(`tasks.noDefinitions`)}):(0,z.jsxs)(wj,{className:`text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsx)(Oj,{children:e(`tasks.workflowName`)}),(0,z.jsx)(Oj,{children:e(`tasks.version`)}),(0,z.jsx)(Oj,{children:e(`tasks.schedule`)}),(0,z.jsx)(Oj,{children:e(`tasks.retryPolicy`)})]})}),(0,z.jsx)(Ej,{children:p.map(e=>(0,z.jsxs)(Dj,{className:`hover:bg-gray-50`,children:[(0,z.jsx)(kj,{className:`font-medium`,children:e.name}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:e.version??(0,z.jsx)(`span`,{className:`italic text-gray-400`,children:`(unversioned)`})}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:e.schedules.length>0?e.schedules.map(e=>(0,z.jsxs)(`div`,{className:`mb-1 last:mb-0`,children:[(0,z.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,z.jsx)(`span`,{className:`ml-1 font-mono text-gray-400`,children:e.expression})]},e.name)):`-`}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:gae(e.retryPolicy)})]},e.id))})]})]}),(0,z.jsxs)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,z.jsx)(`h3`,{className:`text-xl font-semibold`,children:e(`tasks.title`)}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[e(`tasks.autoRefresh`),`: 5s`]}),(0,z.jsx)(B,{size:`xs`,icon:(0,z.jsx)(GB,{}),onClick:()=>b(),children:e(`common.refresh`)})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 mb-4 flex-wrap`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.status`)}),(0,z.jsx)(yg,{enum:mae,labels:hae,value:i,onValueChange:e=>{a(e??[]),r({})},multiple:!0,placeholder:e(`common.all`),className:`w-[200px]`})]}),h.options.length>0&&(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.workflowName`)}),(0,z.jsx)(yg,{enum:h,labels:g,value:o,onValueChange:e=>{s(e??``),r({})},clearable:!0,placeholder:e(`common.all`),className:`w-[200px]`})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.createdAfter`)}),(0,z.jsx)(ag,{value:c,onValueChange:e=>{l(e),r({})},className:`w-[180px]`})]}),(0,z.jsx)(`span`,{className:`text-gray-400`,children:`~`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.createdBefore`)}),(0,z.jsx)(ag,{value:u,onValueChange:e=>{d(e),r({})},className:`w-[180px]`})]}),_&&(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(pae,{}),onClick:()=>{a([]),s(``),l(void 0),d(void 0),r({})},children:e(`tasks.filter.reset`)})]}),x&&(0,z.jsx)(`div`,{className:`text-center py-8`,children:e(`common.loading`)}),!x&&(0,z.jsxs)(wj,{className:`text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsx)(Oj,{children:e(`tasks.workflowName`)}),(0,z.jsx)(Oj,{children:e(`tasks.version`)}),(0,z.jsx)(Oj,{children:e(`tasks.status`)}),(0,z.jsx)(Oj,{children:e(`tasks.attempts`)}),(0,z.jsx)(Oj,{children:e(`tasks.createdAt`)}),(0,z.jsx)(Oj,{children:e(`tasks.startedAt`)}),(0,z.jsx)(Oj,{children:e(`tasks.finishedAt`)}),(0,z.jsx)(Oj,{children:e(`tasks.duration`)})]})}),(0,z.jsxs)(Ej,{children:[S.length===0&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:8,className:`text-center py-8 text-gray-400`,children:e(`tasks.noData`)})}),S.map(e=>(0,z.jsxs)(Dj,{className:`hover:bg-gray-50`,children:[(0,z.jsx)(kj,{children:(0,z.jsx)(mP,{to:`/tasks/$workflowRunId`,params:{workflowRunId:e.id},className:`text-blue-600 hover:underline no-underline`,children:e.workflowName})}),(0,z.jsx)(kj,{className:`text-gray-500`,children:e.version??`-`}),(0,z.jsx)(kj,{children:(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block px-2 py-0.5 text-xs font-bold rounded border`,KB[e.status]??`bg-gray-100 text-gray-800`),children:e.status.toUpperCase()})}),(0,z.jsx)(kj,{className:`text-center`,children:e.attempts}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:qB(e.createdAt,t)}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:qB(e.startedAt,t)}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:qB(e.finishedAt,t)}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs font-mono`,children:JB(e.startedAt,e.finishedAt)})]},e.id))]})]}),C&&(C.prev||C.next)&&(0,z.jsxs)(`div`,{className:`flex justify-center gap-2 mt-4`,children:[(0,z.jsx)(B,{size:`sm`,variant:`outline`,icon:(0,z.jsx)(fae,{}),disabled:!C.prev,onClick:()=>{C.prev&&r({before:C.prev})},children:e(`tasks.prev`)}),(0,z.jsxs)(B,{size:`sm`,variant:`outline`,disabled:!C.next,onClick:()=>{C.next&&r({after:C.next})},children:[e(`tasks.next`),(0,z.jsx)(`span`,{children:(0,z.jsx)(xB,{className:`w-4 h-4`})})]})]})]})]})}var XB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M20 6L9 17l-5-5`})}),ZB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m16 18l6-6l-6-6M8 6l-6 6l6 6`})}),QB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`})}),$B=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M18 6L6 18M6 6l12 12`})}),wae=hP(`/scaffolding`)({component:Tae});function Tae({}){let{SD:e}=kP(),{data:t}=J.useEntities(),{entities:n}=t??{},[r,i]=(0,m.useState)({entityIds:[],templateKeys:[]}),[a,o]=(0,m.useState)({open:!1,pathAndCodes:null}),[s,c]=(0,m.useState)({}),l=(n??[]).filter(e=>!e.parentId),u=[`model`,`model_test`,`view_list`,`view_search_input`,`view_form`],d=e=>{i({...r,entityIds:e})},f=e=>{i({...r,templateKeys:u.filter(t=>e.includes(t))})},{data:p,isLoading:h,refetch:g}=J.useScaffoldingStatus(r),{statuses:_}=p??{},v=e=>[e.entityId,e.templateKey].join(`///`),y=[{label:`Entity`,tc:e=>(0,z.jsx)(z.Fragment,{children:e.entityId}),fit:!0},{label:`TemplateKey`,tc:e=>(0,z.jsx)(z.Fragment,{children:e.templateKey}),fit:!0},{label:e(`common.path`),tc:e=>(0,z.jsx)(z.Fragment,{children:e.subPath})},{label:e(`scaffolding.isExists`),tc:e=>(0,z.jsx)(z.Fragment,{children:e.isExists?(0,z.jsx)(B,{icon:(0,z.jsx)(ZB,{}),size:`xs`,variant:`yellow`,onClick:t=>{t.stopPropagation(),J.openVscode({absPath:e.fullPath})}}):(0,z.jsx)($B,{})}),fit:!0},{label:(0,z.jsx)(B,{size:`xs`,variant:`destructive`,icon:(0,z.jsx)(XB,{}),onClick:e=>{e.stopPropagation(),b()},children:e(`common.overwrite`)}),tc:e=>(0,z.jsx)(z.Fragment,{children:e.isExists&&(0,z.jsx)(el,{checked:s[v(e)]?.overwrite??!1,onCheckedChange:t=>{c({...s,[v(e)]:{overwrite:t??!1}})}})}),fit:!0},{label:e(`common.preview`),tc:t=>(0,z.jsx)(B,{size:`xs`,variant:`green`,onClick:e=>{e.stopPropagation(),S(t)},children:e(`common.preview`)}),fit:!0}],b=()=>{if(!_)return;let e=_.filter(e=>e.isExists);e.every(e=>s[v(e)]?.overwrite??!1)?c({}):c(e.reduce((e,t)=>(e[v(t)]={overwrite:!0},e),{}))},x=()=>{if(!_)return;let e=_.map(e=>({entityId:e.entityId,templateKey:e.templateKey,overwrite:s[v(e)]?.overwrite??!1}));J.scaffoldingGenerate(e).then(()=>{g()}).catch(PL)},S=e=>{J.scaffoldingPreview(e).then(({pathAndCodes:e})=>{o({open:!0,pathAndCodes:e})}).catch(PL)};return(0,z.jsxs)(`div`,{className:`flex justify-start min-h-[calc(100vh-50px)]`,children:[(0,z.jsxs)(`div`,{className:`bg-sidebar-bg text-white pl-4 pr-0 h-[calc(100vh-var(--spacing-gnb))] sticky left-0 top-gnb w-[250px] overflow-y-auto`,children:[(0,z.jsx)(`h3`,{children:e(`scaffolding.entities`)}),(0,z.jsx)(`div`,{className:`py-3 text-center`,children:r.entityIds.length===l.length?(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>d([]),children:e(`scaffolding.uncheckAllEntities`)}):(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>d(l.map(e=>e.id)),children:e(`scaffolding.checkAllEntities`)})}),l.map(e=>(0,z.jsx)(`div`,{className:`flex items-center pb-2`,id:e.id,children:(0,z.jsx)(el,{checked:r.entityIds.includes(e.id),label:e.id,onCheckedChange:t=>{d(t?[...r.entityIds,e.id]:r.entityIds.filter(t=>t!==e.id))}})},e.id))]}),(0,z.jsx)(`div`,{className:`bg-sidebar-bg pl-8 border-l border-[#85aa8a] h-[calc(100vh-var(--spacing-gnb))] sticky left-0 top-gnb text-white w-[250px] overflow-y-auto`,children:(0,z.jsxs)(`div`,{className:`pb-4`,children:[(0,z.jsx)(`h4`,{className:`mb-1`,children:e(`scaffolding.template`).replace(`{name}`,`Entity`)}),(0,z.jsx)(`div`,{className:`py-3 text-center`,children:r.templateKeys.length===u.length?(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>f([]),children:e(`scaffolding.uncheckAll`)}):(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>f(u),children:e(`scaffolding.checkAll`)})}),u.map(e=>(0,z.jsx)(`div`,{className:`flex items-center pb-2`,children:(0,z.jsx)(el,{checked:r.templateKeys.includes(e),label:e,onCheckedChange:t=>{f(t?[...r.templateKeys,e]:r.templateKeys.filter(t=>t!==e))}})},e))]})}),(0,z.jsx)(`div`,{className:`flex-1 p-4`,children:(0,z.jsxs)(`div`,{children:[!_&&!h&&(0,z.jsx)(`div`,{className:`w-[50em] my-[30vh] mx-auto whitespace-pre-line p-[3em] bg-white leading-[2em] border-2 border-orange-500`,children:e(`scaffolding.selectPrompt`)}),_&&(0,z.jsxs)(`div`,{children:[_.length>0&&(0,z.jsx)(B,{size:`sm`,variant:`default`,icon:(0,z.jsx)(QB,{}),onClick:()=>x(),children:e(`scaffolding.generateTemplates`).replace(`{count}`,String(_.length)).replace(`{overwriteCount}`,String(Object.keys(s).length))}),(0,z.jsxs)(wj,{className:`mt-4 text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsx)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:y.map((e,t)=>(0,z.jsx)(Oj,{fit:e.fit,className:`py-2 px-3`,children:e.label},t))})}),(0,z.jsx)(Ej,{children:_.map((e,t)=>(0,z.jsx)(m.Fragment,{children:(0,z.jsx)(Dj,{className:e.isExists?`bg-red-50`:`bg-green-50`,children:y.map((t,n)=>(0,z.jsx)(kj,{fit:t.fit,className:`py-2 px-3`,children:t.tc(e)},n))})},t))})]})]})]})}),(0,z.jsx)(td,{open:a.open,onOpenChange:e=>{e||o({open:!1,pathAndCodes:null})},children:(0,z.jsxs)(id,{className:`max-w-4xl max-h-[80vh] overflow-y-auto`,children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{children:e(`scaffolding.previewTitle`)}),(0,z.jsx)(cd,{children:e(`scaffolding.previewDesc`)})]}),(0,z.jsx)(`div`,{className:`space-y-4`,children:a.pathAndCodes?.map(e=>(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`mb-2 text-lg font-bold text-gray-700`,children:e.path}),(0,z.jsx)(`pre`,{className:`bg-green-50 text-gray-900 p-4 rounded-lg overflow-x-auto text-sm font-mono leading-relaxed`,children:(0,z.jsx)(`code`,{children:e.code})})]},e.path))??(0,z.jsx)(`p`,{children:e(`scaffolding.noPreviewData`)})})]})})]})}var Eae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:9,cy:12,r:3}),(0,z.jsx)(`rect`,{width:20,height:14,x:2,y:5,rx:7})]})}),Dae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:15,cy:12,r:3}),(0,z.jsx)(`rect`,{width:20,height:14,x:2,y:5,rx:7})]})}),eV=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})}),tV=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21 12a9 9 0 1 1-6.219-8.56`})});function Oae({action:e,targets:t,conns:n,open:r,onOpenChange:i,onCompleted:a}){let[o,s]=(0,m.useState)(!1),{form:c,register:l}=eM(Uk({doShadowDbTesting:_k()}),{doShadowDbTesting:e===`apply`}),[u,d]=(0,m.useState)({status:`idle`}),[f,p]=(0,m.useState)(!1),[h,g]=(0,m.useState)(``),_=(0,m.useRef)(null),v=(n,r)=>{_.current=setInterval(async()=>{try{let{approved:o,rejected:s}=await J.migrationsCheckApproval(n,r);o?(y(),`type`in await J.migrationsRunAction(e,t)||(i(!1),a?.())):s&&(y(),d({status:`rejected`}))}catch(e){console.error(`Polling error:`,e)}},2e3)},y=()=>{_.current&&=(clearInterval(_.current),null)};(0,m.useEffect)(()=>{r||(y(),d({status:`idle`}),g(``))},[r]),(0,m.useEffect)(()=>()=>y(),[]);let b=async()=>{s(!0);try{c.doShadowDbTesting&&await J.migrationsRunAction(`shadow`,t);let n=await J.migrationsRunAction(e,t);`type`in n&&n.type===`pending`?(d({status:`pending`,channel:n.channel,ts:n.ts}),v(n.channel,n.ts)):(i(!1),a?.())}catch(e){PL(e)}finally{s(!1)}},x=async()=>{if(!(!u.channel||!u.ts)){s(!0);try{await J.migrationsForceApproval(u.channel,u.ts,h),`type`in await J.migrationsRunAction(e,t,{force:!0,forceReason:h})||(i(!1),a?.())}catch(e){PL(e)}finally{s(!1),p(!1)}}};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(td,{open:r,onOpenChange:i,children:(0,z.jsxs)(id,{className:`max-w-4xl max-h-[90vh] flex flex-col`,children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{children:`Migrations Action Form`}),(0,z.jsxs)(cd,{children:[`Execute migration action: `,e.toUpperCase()]})]}),(0,z.jsx)(`div`,{className:`overflow-y-auto flex-1 p-4`,children:(0,z.jsx)(`div`,{className:`form ${o?`loading`:``}`,children:(0,z.jsxs)(`div`,{className:`ui basic segment`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`h4`,{children:[`Action: `,e.toUpperCase()]}),(0,z.jsx)(`p`,{children:`\xA0`})]}),(0,z.jsxs)(`div`,{className:`targets`,children:[(0,z.jsx)(`h4`,{children:`Targets`}),(0,z.jsx)(`div`,{className:`flex w-full gap-2 my-4`,children:n.map(e=>(0,z.jsxs)(`div`,{className:(0,kL.default)(`flex-1 text-center p-4 bg-[#f1fff5] border border-[#b1f3c4] rounded-[0.3em] opacity-30`,{"bg-[#b1f3c4] text-green-600 font-bold opacity-100":t.includes(e.connKey)}),children:[t.includes(e.connKey)&&(0,z.jsx)(XB,{className:`h-4 w-4 inline-block mr-1`}),e.name]},e.name))})]}),e===`apply`&&(0,z.jsxs)(`div`,{className:`shadow-db-testing`,children:[(0,z.jsx)(`h4`,{children:`Shadow DB Testing`}),(0,z.jsx)(Cj,{...l(`doShadowDbTesting`)})]}),u.status===`pending`&&(0,z.jsxs)(`div`,{className:`p-4 bg-yellow-50 border border-yellow-200 rounded mt-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,z.jsx)(tV,{className:`h-4 w-4 animate-spin`}),(0,z.jsx)(`span`,{className:`font-medium`,children:`승인 대기중...`})]}),(0,z.jsx)(`p`,{className:`text-sm text-gray-600 mb-4`,children:`슬랙에서 ✅ 이모지를 눌러 승인해주세요.`}),(0,z.jsx)(B,{variant:`outline`,onClick:()=>p(!0),children:`Force 진행`})]}),u.status===`rejected`&&(0,z.jsx)(`div`,{className:`p-4 bg-red-50 border border-red-200 rounded mt-4`,children:(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)($B,{className:`h-4 w-4 text-red-600`}),(0,z.jsx)(`span`,{className:`font-medium text-red-600`,children:`마이그레이션이 거절되었습니다.`})]})})]})})}),(0,z.jsx)(od,{children:(0,z.jsx)(B,{onClick:b,icon:(0,z.jsx)(QB,{}),disabled:o||u.status===`pending`,children:`Commit`})})]})}),(0,z.jsx)(td,{open:f,onOpenChange:p,children:(0,z.jsxs)(id,{children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{children:`Force 진행`}),(0,z.jsx)(cd,{children:`승인 없이 진행합니다. 사유를 입력해주세요.`})]}),(0,z.jsx)(Qj,{placeholder:`사유 입력...`,value:h,onChange:e=>g(e.target.value)}),(0,z.jsxs)(od,{children:[(0,z.jsx)(B,{variant:`outline`,onClick:()=>p(!1),children:`취소`}),(0,z.jsx)(B,{onClick:x,disabled:!h.trim()||o,children:`진행`})]})]})})]})}var kae=hP(`/migrations`)({component:Aae});function Aae(e){let{SD:t}=kP(),{data:n,error:r,refetch:i}=J.useMigrationStatus(),{status:a}=n??{},{preparedCodes:o,conns:s,codes:c}=a??{},l=a?.error,u=!r&&!n,[d,f]=(0,m.useState)(!1),[p,h]=(0,m.useState)([]),[g,_]=(0,m.useState)([]),[v,y]=(0,m.useState)(!1),[b,x]=(0,m.useState)(null),[S,C]=(0,m.useState)(!1),w=e=>{let t=new Set((s??[]).map(e=>e.connKey)),n=(()=>{switch(e){case`ALL`:return[`test`,`fixture`,`development`,`staging`,`production`];case`LOCAL`:return[`test`];case`REMOTE`:return[`development`,`staging`,`production`];case`TESTING`:return[`test`,`fixture`];case`FIXTURE`:return[`fixture`]}})().filter(e=>t.has(e));n.length!==0&&(n.filter(e=>p.includes(e)).length===n.length?h(p.filter(e=>!n.includes(e))):jne(n,p).length>0?h(n):h(pj([...p,...n])))},T=()=>{g.length!==0&&confirm(t(`migration.confirm.deleteCodes`).replace(`{count}`,String(g.length)))&&(f(!0),J.migrationsDelCodes(g).then(()=>{i()}).catch(PL).finally(()=>{f(!1)}))},E=()=>{f(!0),J.migrationsGeneratePreparedCodes().then(()=>{setTimeout(()=>{i()},500)}).catch(PL).finally(()=>{f(!1)})},D=(e,t)=>{s&&(x({action:e,targets:t??p}),y(!0))},O=()=>{i()},k=()=>{c&&(g.length===0?_(c.map(e=>e.name)):_([]))};return r?(0,z.jsx)(`div`,{className:`p-8`,children:(0,z.jsx)(`div`,{className:`w-[50em] my-[30vh] mx-auto whitespace-pre-line p-[3em] bg-white leading-[2em] border-2 border-red-500`,children:r.message})}):(0,z.jsxs)(`div`,{className:`p-8`,children:[(0,z.jsxs)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm ${d||u?`opacity-50 pointer-events-none`:``}`,children:[o&&(0,z.jsxs)(`div`,{className:`p-4`,children:[(0,z.jsxs)(`h3`,{className:`relative `,children:[t(`migration.preparedCodes`),` `,(0,z.jsxs)(`div`,{className:`absolute right-0 top-0 flex gap-2`,children:[(0,z.jsx)(B,{icon:S?(0,z.jsx)(Dae,{}):(0,z.jsx)(Eae,{}),size:`xs`,onClick:()=>C(!S),children:t(`migration.toggleCodes`)}),(0,z.jsx)(B,{size:`xs`,icon:(0,z.jsx)(QB,{}),onClick:()=>E(),children:t(`migration.generate`)})]})]}),(0,z.jsxs)(wj,{children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsx)(Oj,{children:t(`common.type`)}),(0,z.jsx)(Oj,{children:t(`common.table`)}),(0,z.jsx)(Oj,{children:t(`common.name`)}),(0,z.jsx)(Oj,{children:t(`common.code`)})]})}),(0,z.jsxs)(Ej,{children:[l&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,children:l})}),!l&&o.length===0&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,className:`text-center`,children:t(`migration.noPreparedCodes`)})}),o.map((e,n)=>(0,z.jsxs)(Dj,{children:[(0,z.jsx)(kj,{children:e.type}),(0,z.jsx)(kj,{children:e.table}),(0,z.jsx)(kj,{children:e.title}),(0,z.jsx)(kj,{style:{padding:0,width:700,textAlign:`center`},children:(0,z.jsx)(jae,{code:e.formatted??``,open:S,collapsedText:t(`migration.codeCollapsed`)})})]},n))]})]}),(0,z.jsx)(`div`,{className:`border-b border-gray-200`})]}),(0,z.jsxs)(`div`,{className:`p-4`,children:[(0,z.jsx)(`h3`,{children:t(`migration.codeFiles`)}),(0,z.jsxs)(`div`,{className:`flex gap-8`,children:[(0,z.jsx)(`div`,{className:`flex-1`,children:(0,z.jsx)(B,{variant:`destructive`,icon:(0,z.jsx)(eV,{}),disabled:g.length===0,onClick:()=>T(),children:t(`migration.deleteCodes`)})}),(0,z.jsx)(`div`,{className:`flex gap-2 justify-end`,children:[`ALL`,`LOCAL`,`REMOTE`,`TESTING`,`FIXTURE`].map(e=>(0,z.jsx)(B,{variant:`yellow`,onClick:()=>w(e),children:e},e))}),(0,z.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,z.jsx)(B,{variant:`default`,icon:(0,z.jsx)(QB,{}),disabled:p.length===0||!!l,onClick:()=>D(`apply`),children:t(`migration.applyToLatest`)}),(0,z.jsx)(B,{variant:`destructive`,icon:(0,z.jsx)(GB,{}),disabled:p.length===0||!!l,onClick:()=>D(`rollback`),children:t(`migration.rollback`)})]})]}),s&&c&&(0,z.jsxs)(wj,{className:`mt-4 text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsxs)(Oj,{className:`flex items-center gap-1`,children:[`Name`,` `,(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),size:`xs`,variant:`blue`,onClick:()=>k()})]}),s.map((e,t)=>(0,z.jsx)(Oj,{style:{width:`150px`},className:(0,kL.default)(`py-2 px-3`,{"bg-[#dafde6]":p.includes(e.connKey)}),children:(0,z.jsx)(el,{disabled:e.status===`error`||!!l,checked:p.includes(e.connKey),label:(0,z.jsxs)(vv,{children:[(0,z.jsx)(yv,{children:`${e.name} / ${e.status}`}),(0,z.jsx)(bv,{children:(0,z.jsx)(`p`,{children:e.connString})})]}),onCheckedChange:t=>{h(t?pj([...p,e.connKey]):p.filter(t=>t!==e.connKey))}})},t))]})}),(0,z.jsxs)(Ej,{children:[(s.some(e=>e.status===`error`)||!!l)&&(0,z.jsx)(Dj,{children:(0,z.jsxs)(kj,{colSpan:6,children:[(0,z.jsx)(`b`,{className:`text-destructive`,children:t(`migration.error.connections`)}),l&&(0,z.jsx)(`pre`,{className:`mt-1 text-xs text-destructive whitespace-pre-wrap break-all`,children:l})]})}),c.length===0&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,children:t(`migration.noCodeFiles`)})}),c.map((e,t)=>(0,z.jsx)(m.Fragment,{children:(0,z.jsxs)(Dj,{children:[(0,z.jsxs)(kj,{className:`flex items-center gap-1`,children:[(0,z.jsx)(el,{checked:g.includes(e.name),label:e.name,onCheckedChange:t=>{_(t?pj([...g,e.name]):g.filter(t=>t!==e.name))}}),`\xA0`,` `,(0,z.jsx)(B,{size:`xs`,variant:`secondary`,icon:(0,z.jsx)(ZB,{}),onClick:()=>{J.openVscode({absPath:e.path})}})]}),s.map((t,n)=>(0,z.jsx)(kj,{className:(0,kL.default)(`text-center py-2 px-3`,{"bg-[#dafde6]":p.includes(t.connKey)}),children:t.pending.includes(e.name)?(0,z.jsx)(`span`,{className:`inline-block px-2 py-1 text-xs font-bold rounded bg-yellow-500 text-white`,children:`PENDING`}):t.status===`error`||l?(0,z.jsx)(`span`,{className:`inline-block px-2 py-1 text-xs font-bold rounded bg-red-500 text-white`,children:`ERROR`}):(0,z.jsx)(`span`,{className:`inline-block px-2 py-1 text-xs font-bold rounded bg-green-500 text-white`,children:`APPLIED`})},n))]})},t))]})]})]})]}),s&&b&&(0,z.jsx)(Oae,{action:b.action,targets:b.targets,conns:s,open:v,onOpenChange:y,onCompleted:O})]})}function jae({code:e,open:t,collapsedText:n}){return(0,z.jsx)(`div`,{className:`flex items-start`,children:t?(0,z.jsx)(`pre`,{className:`bg-green-50 text-gray-900 p-4 rounded-lg overflow-x-auto text-sm font-mono leading-relaxed text-left`,children:(0,z.jsx)(`code`,{children:e})}):(0,z.jsx)(`div`,{className:`m-auto`,children:n})})}var Mae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,z.jsx)(`path`,{d:`m7 10l5 5l5-5`})]})}),nV=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 12h14m-7-7v14`})}),Nae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 3v12m5-7l-5-5l-5 5m14 7v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`})}),Pae=hP(`/i18n`)({component:Fae});function Fae(){let{SD:e}=kP(),{data:t,error:n,refetch:r}=J.useI18nDictionary(),{rows:i,locales:a,defaultLocale:o,stats:s}=t??{},c=!n&&!t,[l,u]=(0,m.useState)(!1),d=(0,m.useRef)(null),[f,p]=(0,m.useState)(null),[h,g]=(0,m.useState)(``),_=(0,m.useRef)(null),[v,y]=(0,m.useState)(new Set),[b,x]=(0,m.useState)(null),[S,C]=(0,m.useState)(!1),[w,T]=(0,m.useState)(``),[E,D]=(0,m.useState)({});(0,m.useEffect)(()=>{f&&_.current&&(_.current.focus(),_.current.select())},[f]),(0,m.useEffect)(()=>{!i||i.length===0||(async()=>{let e=i.filter(e=>e.source===`project`).map(e=>e.key);if(e.length!==0)try{let t=await J.checkI18nUsage(e);if(t.error){x(t.error);return}y(new Set(t.unusedKeys)),x(null)}catch{}})()},[i]);let O=()=>{window.location.href=`/sonamu-ui/api/i18n/export`},k=()=>{d.current?.click()},A=async e=>{let t=e.target.files?.[0];if(t){u(!0);try{await J.importI18n(t),await r(),alert(`Import completed successfully!`)}catch(e){PL(e)}finally{u(!1),d.current&&(d.current.value=``)}}},j=(e,t)=>{if(e.source===`sonamu`)return;let n=t===`key`?e.key:e[t]??``;p({key:e.key,field:t}),g(n)},M=async e=>{if(!f||!a)return;let{field:t}=f,n=e.key;if(h===(t===`key`?e.key:e[t]??``)){p(null);return}u(!0);try{if(t===`key`){let t={};for(let n of a)e[n]&&(t[n]=e[n]);await J.updateI18n({oldKey:n,newKey:h,source:e.source,values:t})}else await J.updateI18n({oldKey:n,newKey:n,source:e.source,values:{[t]:h}});await r()}catch(e){PL(e)}finally{u(!1),p(null)}},N=()=>{p(null),g(``)},P=()=>{T(``),D({}),C(!0)},F=async()=>{if(!w.trim()){alert(`키를 입력해주세요`);return}u(!0);try{await J.createI18n({key:w.trim(),values:E}),C(!1),await r()}catch(e){PL(e)}finally{u(!1)}},ee=async t=>{if(confirm(e(`i18n.confirm.delete`).replace(`{key}`,t))){u(!0);try{await J.deleteI18n(t),await r()}catch(e){PL(e)}finally{u(!1)}}},te=(e,t)=>{e.key===`Enter`?(e.preventDefault(),M(t)):e.key===`Escape`&&(e.preventDefault(),N())},ne=(e,t,n,r)=>{let i=f?.key===e.key&&f?.field===t,a=e.source!==`sonamu`;return i?(0,z.jsx)(kj,{className:r,children:(0,z.jsx)(`input`,{ref:_,type:`text`,value:h,onChange:e=>g(e.target.value),onBlur:()=>M(e),onKeyDown:t=>te(t,e),className:`w-full px-2 py-1 text-sm border border-blue-400 rounded outline-none focus:ring-2 focus:ring-blue-200`})}):(0,z.jsx)(kj,{className:`${r} ${a?`cursor-pointer hover:bg-blue-50`:``}`,onDoubleClick:()=>a&&j(e,t),children:n})};return(0,z.jsxs)(`div`,{className:`p-8`,children:[(0,z.jsx)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm ${l||c?`opacity-50 pointer-events-none`:``}`,children:(0,z.jsxs)(`div`,{className:`p-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,style:{display:`flex`,alignItems:`baseline`},children:[(0,z.jsx)(`h3`,{children:e(`i18n.title`)}),(0,z.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>r(),disabled:l,icon:(0,z.jsx)(GB,{className:`w-4 h-4`})})]}),(0,z.jsxs)(`div`,{className:`flex gap-2 mb-4`,children:[(0,z.jsx)(B,{onClick:P,disabled:l,icon:(0,z.jsx)(nV,{className:`w-4 h-4`}),children:e(`i18n.addKey`)}),(0,z.jsx)(B,{onClick:O,disabled:l,icon:(0,z.jsx)(Nae,{className:`w-4 h-4`}),children:e(`i18n.exportExcel`)}),(0,z.jsx)(B,{onClick:k,disabled:l,icon:(0,z.jsx)(Mae,{className:`w-4 h-4`}),children:e(`i18n.importExcel`)}),(0,z.jsx)(`input`,{type:`file`,ref:d,onChange:A,accept:`.xlsx,.xls`,className:`hidden`})]}),(0,z.jsx)(`p`,{className:`text-sm text-gray-500 mb-4`,children:e(`i18n.editHint`)}),b&&(0,z.jsxs)(`p`,{className:`text-sm text-yellow-600 mb-4 p-2 bg-yellow-50 rounded`,children:[`⚠ `,b]}),c&&(0,z.jsx)(`div`,{className:`text-gray-500`,children:e(`common.loading`)}),n&&(0,z.jsxs)(`div`,{className:`text-red-500`,children:[e(`common.error`),`: `,String(n)]}),i&&a&&(0,z.jsxs)(wj,{containerClassName:`border rounded-lg overflow-auto max-h-[calc(100vh-250px)]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{children:[(0,z.jsx)(Oj,{className:`sticky top-0 z-10 min-w-[300px] bg-gray-100`,children:e(`i18n.key`)}),(0,z.jsx)(Oj,{className:`sticky top-0 z-10 min-w-[100px] bg-gray-100`,children:e(`i18n.source`)}),a.map(e=>(0,z.jsxs)(Oj,{className:`sticky top-0 z-10 min-w-[200px] bg-gray-100`,children:[e,e===o&&` (default)`,s?.[e]&&(0,z.jsxs)(`span`,{className:`ml-2 text-xs ${s[e].percent===100?`text-green-600`:s[e].percent>=80?`text-yellow-600`:`text-red-600`}`,children:[s[e].percent,`%`]})]},e)),(0,z.jsx)(Oj,{className:`sticky top-0 z-10 w-[60px] bg-gray-100`})]})}),(0,z.jsx)(Ej,{children:i.map(e=>(0,z.jsxs)(Dj,{className:e.source===`sonamu`?`bg-gray-50 text-gray-500`:void 0,children:[ne(e,`key`,(0,z.jsxs)(z.Fragment,{children:[!b&&v.has(e.key)&&(0,z.jsx)(`span`,{className:`text-red-500 mr-1`,title:`미사용 키`,children:`❗`}),e.key]}),`font-mono text-sm`),(0,z.jsx)(kj,{children:(0,z.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded ${e.source===`entity`?`bg-blue-100 text-blue-700`:e.source===`sonamu`?`bg-gray-200 text-gray-600`:`bg-green-100 text-green-700`}`,children:e.source})}),a.map(t=>{let n=!e[t];return ne(e,t,n?(0,z.jsx)(`span`,{className:`text-yellow-600`,children:`⚠ -`}):e[t],`text-sm ${n?`bg-yellow-50`:``}`)}),(0,z.jsx)(kj,{children:e.source===`project`&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>ee(e.key),className:`p-1 text-gray-400 hover:text-red-500 transition-colors`,title:`Delete key`,children:(0,z.jsx)(TB,{className:`w-4 h-4`})})})]},e.key))})]}),(0,z.jsx)(`div`,{className:`mt-4 text-sm text-gray-500`,children:i&&(0,z.jsx)(`span`,{children:e(`i18n.totalKeys`).replace(`{count}`,String(i.length))})})]})}),S&&a&&(0,z.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,children:(0,z.jsxs)(`div`,{className:`bg-white rounded-lg shadow-xl w-full max-w-md p-6`,children:[(0,z.jsx)(`h3`,{className:`text-lg font-semibold mb-4`,children:e(`i18n.modal.addNewKey`)}),(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:e(`i18n.key`)}),(0,z.jsx)(`input`,{type:`text`,value:w,onChange:e=>T(e.target.value),placeholder:`e.g. common.myNewKey`,className:`w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),a.map(t=>(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:[t,t===o&&` (default)`]}),(0,z.jsx)(`input`,{type:`text`,value:E[t]??``,onChange:e=>D(n=>({...n,[t]:e.target.value})),placeholder:e(`i18n.modal.valueFor`).replace(`{locale}`,t),className:`w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500`})]},t))]}),(0,z.jsxs)(`div`,{className:`flex justify-end gap-2 mt-6`,children:[(0,z.jsx)(B,{variant:`outline`,onClick:()=>C(!1),disabled:l,children:e(`common.cancel`)}),(0,z.jsx)(B,{onClick:F,disabled:l,children:e(l?`i18n.creating`:`common.create`)})]})]})})]})}var Iae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`ellipse`,{cx:12,cy:5,rx:9,ry:3}),(0,z.jsx)(`path`,{d:`M3 5v14a9 3 0 0 0 18 0V5`}),(0,z.jsx)(`path`,{d:`M3 12a9 3 0 0 0 18 0`})]})}),Lae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`rect`,{width:18,height:18,x:3,y:3,rx:2}),(0,z.jsx)(`path`,{d:`M3 9h18M3 15h18M9 3v18m6-18v18`})]})}),rV=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`m21 21l-4.34-4.34`}),(0,z.jsx)(`circle`,{cx:11,cy:11,r:8})]})}),Rae=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M12 3v18`}),(0,z.jsx)(`rect`,{width:18,height:18,x:3,y:3,rx:2}),(0,z.jsx)(`path`,{d:`M3 9h18M3 15h18`})]})}),iV=`vercel.ai.error`,zae=Symbol.for(iV),aV,Bae=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[aV]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,iV)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}};aV=zae;var oV=Bae;function sV(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.message:JSON.stringify(e)}var cV=`AI_InvalidArgumentError`,lV=`vercel.ai.error.${cV}`,Vae=Symbol.for(lV),uV,Hae=class extends oV{constructor({message:e,cause:t,argument:n}){super({name:cV,message:e,cause:t}),this[uV]=!0,this.argument=n}static isInstance(e){return oV.hasMarker(e,lV)}};uV=Vae;var dV=`AI_JSONParseError`,fV=`vercel.ai.error.${dV}`,Uae=Symbol.for(fV),pV,mV=class extends oV{constructor({text:e,cause:t}){super({name:dV,message:`JSON parsing failed: Text: ${e}.
|
|
103
103
|
Error message: ${sV(t)}`,cause:t}),this[pV]=!0,this.text=e}static isInstance(e){return oV.hasMarker(e,fV)}};pV=Uae;var hV=`AI_TypeValidationError`,gV=`vercel.ai.error.${hV}`,Wae=Symbol.for(gV),_V,Gae=class e extends oV{constructor({value:e,cause:t}){super({name:hV,message:`Type validation failed: Value: ${JSON.stringify(e)}.
|
|
104
104
|
Error message: ${sV(t)}`,cause:t}),this[_V]=!0,this.value=e}static isInstance(e){return oV.hasMarker(e,gV)}static wrap({value:t,cause:n}){return e.isInstance(n)&&n.value===t?n:new e({value:t,cause:n})}};_V=Wae;var vV=Gae,yV=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}};function bV(e){}function Kae(e){if(typeof e==`function`)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=bV,onError:n=bV,onRetry:r=bV,onComment:i}=e,a=``,o=!0,s,c=``,l=``;function u(e){let t=o?e.replace(/^\xEF\xBB\xBF/,``):e,[n,r]=qae(`${a}${t}`);for(let e of n)d(e);a=r,o=!1}function d(e){if(e===``){p();return}if(e.startsWith(`:`)){i&&i(e.slice(e.startsWith(`: `)?2:1));return}let t=e.indexOf(`:`);if(t!==-1){let n=e.slice(0,t),r=e[t+1]===` `?2:1;f(n,e.slice(t+r),e);return}f(e,``,e)}function f(e,t,i){switch(e){case`event`:l=t;break;case`data`:c=`${c}${t}
|
|
105
105
|
`;break;case`id`:s=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new yV(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new yV(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}));break}}function p(){c.length>0&&t({id:s,event:l||void 0,data:c.endsWith(`
|