From 7f25ce6cd222c64ee157f9da523b159e1b4ceaf5 Mon Sep 17 00:00:00 2001 From: yolain Date: Wed, 14 Aug 2024 21:59:46 +0800 Subject: [PATCH 1/4] Add web_version v2 --- web_version/v2/easyuse.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 web_version/v2/easyuse.js diff --git a/web_version/v2/easyuse.js b/web_version/v2/easyuse.js new file mode 100644 index 0000000..ddb9647 --- /dev/null +++ b/web_version/v2/easyuse.js @@ -0,0 +1,30 @@ +!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('@charset "UTF-8";.easyuse-model-info{color:#fff;max-width:90vw;font-family:var(--font-family)}.easyuse-model-content{display:flex;flex-direction:column;overflow:hidden}.easyuse-model-header{margin:0 0 15px}.easyuse-model-header-remark{display:flex;align-items:center;margin-top:5px}.easyuse-model-info h2{text-align:left;margin:0}.easyuse-model-info h5{text-align:left;margin:0 15px 0 0;font-weight:400;color:var(--descrip-text)}.easyuse-model-info p{margin:5px 0}.easyuse-model-info a{color:var(--theme-color-light)}.easyuse-model-info a:hover{text-decoration:underline}.easyuse-model-tags-list{display:flex;flex-wrap:wrap;list-style:none;gap:10px;max-height:200px;overflow:auto;margin:10px 0;padding:0}.easyuse-model-tag{background-color:var(--comfy-input-bg);border:2px solid var(--border-color);color:var(--input-text);display:flex;align-items:center;gap:5px;border-radius:5px;padding:2px 5px;cursor:pointer}.easyuse-model-tag--selected span:before{content:"✅";position:absolute;background-color:var(--theme-color-light);left:0;top:0;right:0;bottom:0;text-align:center}.easyuse-model-tag:hover{border:2px solid var(--theme-color-light)}.easyuse-model-tag p{margin:0}.easyuse-model-tag span{text-align:center;border-radius:5px;background-color:var(--theme-color-light);padding:2px;position:relative;min-width:20px;overflow:hidden;color:#fff}.easyuse-model-metadata .comfy-modal-content{max-width:100%}.easyuse-model-metadata label{margin-right:1ch;color:#ccc}.easyuse-model-metadata span{color:var(--theme-color-light)}.easyuse-preview{max-width:660px;margin-right:15px;position:relative}.easyuse-preview-group{position:relative;overflow:hidden;border-radius:.5rem;width:660px}.easyuse-preview-list{display:flex;flex-wrap:nowrap;width:100%;transition:all .5s ease-in-out}.easyuse-preview-list.no-transition{transition:none}.easyuse-preview-slide{display:flex;flex-basis:calc(50% - 5px);flex-grow:0;flex-shrink:0;position:relative;justify-content:center;align-items:center;padding-right:5px;padding-left:0}.easyuse-preview-slide:nth-child(2n){padding-left:5px;padding-right:0}.easyuse-preview-slide-content{position:relative;min-height:150px;width:100%}.easyuse-preview-slide-content .save{position:absolute;right:6px;z-index:12;bottom:6px;display:flex;align-items:center;height:26px;padding:0 9px;color:var(--input-text);font-size:12px;line-height:26px;background:#00000080;border-radius:13px;cursor:pointer;min-width:80px;text-align:center}.easyuse-preview-slide-content .save:hover{filter:brightness(120%);will-change:auto}.easyuse-preview-slide-content img{border-radius:14px;object-position:center center;max-width:100%;max-height:700px;border-style:none;vertical-align:middle}.easyuse-preview button{position:absolute;z-index:10;top:50%;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:15px;border:1px solid rgba(66,63,78,.15);background-color:#423f4e80;color:#fffc;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transform:translateY(-50%)}.easyuse-preview button.left{left:10px}.easyuse-preview button.right{right:10px}.easyuse-model-detail{margin-top:16px;overflow:hidden;border:1px solid var(--border-color);border-radius:8px;width:300px}.easyuse-model-detail-head{height:40px;padding:0 10px;font-weight:500;font-size:14px;font-style:normal;line-height:40px}.easyuse-model-detail-body{box-sizing:border-box;font-size:12px}.easyuse-model-detail-item{display:flex;justify-content:flex-start;border-top:1px solid var(--border-color)}.easyuse-model-detail-item-label{flex-shrink:0;width:88px;padding-top:5px;padding-bottom:5px;padding-left:10px;border-right:1px solid var(--border-color);color:var(--input-text);font-weight:400}.easyuse-model-detail-item-value{display:flex;flex-wrap:wrap;padding:5px 10px;color:var(--input-text)}.easyuse-model-detail-textarea{border-top:1px solid var(--border-color);padding:10px;height:100px;overflow-y:auto;font-size:12px}.easyuse-model-detail-textarea textarea{width:100%;height:100%;border:0;background-color:transparent;color:var(--input-text)}.easyuse-model-detail-textarea textarea::placeholder{color:var(--descrip-text)}.easyuse-model-detail-textarea.empty{display:flex;justify-content:center;align-items:center;color:var(--descrip-text)}.easyuse-model-notes{background-color:#00000040;padding:5px;margin-top:5px}.easyuse-model-notes:empty{display:none}.easyuse-account-user{font-size:10px;color:var(--descrip-text);text-align:center}.easyuse-account-user-info{display:flex;justify-content:space-between;align-items:center;padding-bottom:10px;cursor:pointer}.easyuse-account-user-info .user{display:flex;align-items:center}.easyuse-account-user-info .edit{padding:5px 10px;background:var(--comfy-menu-bg);border-radius:4px}.easyuse-account-user-info:hover{filter:brightness(110%)}.easyuse-account-user-info h5{margin:0;font-size:10px;text-align:left}.easyuse-account-user-info h6{margin:0;font-size:8px;text-align:left;font-weight:300}.easyuse-account-user-info .remark{margin-top:4px}.easyuse-account-user-info .avatar{width:36px;height:36px;background:var(--comfy-input-bg);border-radius:50%;margin-right:5px;display:flex;justify-content:center;align-items:center;font-size:16px;overflow:hidden}.easyuse-account-user-info .avatar img{width:100%;height:100%}.easyuse-account-dialog{width:600px}.easyuse-account-dialog-main a,.easyuse-account-dialog-main a:visited{font-weight:400;color:var(--theme-color-light)}.easyuse-account-dialog-item{display:flex;justify-content:flex-start;align-items:center;padding:10px 0;border-bottom:1px solid var(--border-color)}.easyuse-account-dialog-item input{padding:5px;margin-right:5px}.easyuse-account-dialog-item input.key{flex:1}.easyuse-account-dialog-item button{cursor:pointer;margin-left:5px!important;padding:5px!important;font-size:16px!important}.easyuse-account-dialog-item button:hover{filter:brightness(120%)}.easyuse-account-dialog-item button.choose{background:var(--theme-color)}.easyuse-account-dialog-item button.delete{background:var(--error-color)}.easy-dropdown,.easy-nested-dropdown{position:relative;box-sizing:border-box;background-color:#171717;box-shadow:0 4px 4px #ffffff40;padding:0;margin:0;list-style:none;z-index:1000;overflow:visible;max-height:fit-content;max-width:fit-content}.easy-dropdown{position:absolute;border-radius:0}.easy-dropdown li.item,.easy-nested-dropdown li.item{font-weight:400;min-width:max-content}.easy-dropdown li.folder,.easy-nested-dropdown li.folder{cursor:default;position:relative;border-right:3px solid cyan}.easy-dropdown li.folder:after,.easy-nested-dropdown li.folder:after{content:">";position:absolute;right:2px;font-weight:400}.easy-dropdown li,.easy-nested-dropdown li{padding:4px 10px;cursor:pointer;font-family:system-ui;font-size:.7rem;position:relative}.easy-nested-dropdown{position:absolute;top:0;left:100%;margin:0;border:none;display:none}.easy-dropdown li.selected>.easy-nested-dropdown,.easy-nested-dropdown li.selected>.easy-nested-dropdown{display:block;border:none}.easy-dropdown li.selected,.easy-nested-dropdown li.selected{background-color:#e5e5e5;border:none}:root{--theme-color:var(--primary-bg);--theme-color-light: var(--primary-hover-bg);--success-color: #52c41a;--error-color: #ff4d4f;--warning-color: #faad14;--font-family: Inter, -apple-system, BlinkMacSystemFont, Helvetica Neue, sans-serif;--p-inputtext-background: var(--p-form-field-background);--p-inputtext-disabled-background: var(--p-form-field-disabled-background);--p-inputtext-filled-background: var(--p-form-field-filled-background);--p-inputtext-filled-focus-background: var(--p-form-field-filled-focus-background);--p-inputtext-border-color: var(--p-form-field-border-color);--p-inputtext-hover-border-color: var(--p-form-field-hover-border-color);--p-inputtext-focus-border-color: var(--p-form-field-focus-border-color);--p-inputtext-invalid-border-color: var(--p-form-field-invalid-border-color);--p-inputtext-color: var(--p-form-field-color);--p-inputtext-disabled-color: var(--p-form-field-disabled-color);--p-inputtext-placeholder-color: var(--p-form-field-placeholder-color);--p-inputtext-shadow: var(--p-form-field-shadow);--p-inputtext-padding-x: var(--p-form-field-padding-x);--p-inputtext-padding-y: var(--p-form-field-padding-y);--p-inputtext-border-radius: var(--p-form-field-border-radius);--p-inputtext-focus-ring-width: var(--p-form-field-focus-ring-width);--p-inputtext-focus-ring-style: var(--p-form-field-focus-ring-style);--p-inputtext-focus-ring-color: var(--p-form-field-focus-ring-color);--p-inputtext-focus-ring-offset: var(--p-form-field-focus-ring-offset);--p-inputtext-focus-ring-shadow: var(--p-form-field-focus-ring-shadow);--p-inputtext-transition-duration: var(--p-form-field-transition-duration);--p-inputtext-sm-font-size: .875rem;--p-inputtext-sm-padding-x: .625rem;--p-inputtext-sm-padding-y: .375rem;--p-inputtext-lg-font-size: 1.125rem;--p-inputtext-lg-padding-x: .875rem;--p-inputtext-lg-padding-y: .625rem;--p-tag-font-size: .875rem;--p-tag-font-weight: 700;--p-tag-padding: .25rem .5rem;--p-tag-gap: .25rem;--p-tag-border-radius: var(--p-content-border-radius);--p-tag-rounded-border-radius: var(--p-border-radius-xl);--p-tag-icon-size: .75rem;--p-tag-primary-background: var(--p-primary-100);--p-tag-primary-color: var(--p-primary-700);--p-tag-secondary-background: var(--p-surface-100);--p-tag-secondary-color: var(--p-surface-600);--p-tag-success-background: var(--p-green-100);--p-tag-success-color: var(--p-green-700);--p-tag-info-background: var(--p-sky-100);--p-tag-info-color: var(--p-sky-700);--p-tag-warn-background: var(--p-orange-100);--p-tag-warn-color: var(--p-orange-700);--p-tag-danger-background: var(--p-red-100);--p-tag-danger-color: var(--p-red-700);--p-tag-contrast-background: var(--p-surface-950);--p-tag-contrast-color: var(--p-surface-0)}:root .dark-theme{--p-tag-font-size: .875rem;--p-tag-font-weight: 700;--p-tag-padding: .25rem .5rem;--p-tag-gap: .25rem;--p-tag-border-radius: var(--p-content-border-radius);--p-tag-rounded-border-radius: var(--p-border-radius-xl);--p-tag-icon-size: .75rem;--p-tag-primary-background: color-mix(in srgb, var(--p-primary-500), transparent 84%);--p-tag-primary-color: var(--p-primary-300);--p-tag-secondary-background: var(--p-surface-800);--p-tag-secondary-color: var(--p-surface-300);--p-tag-success-background: color-mix(in srgb, var(--p-green-500), transparent 84%);--p-tag-success-color: var(--p-green-300);--p-tag-info-background: color-mix(in srgb, var(--p-sky-500), transparent 84%);--p-tag-info-color: var(--p-sky-300);--p-tag-warn-background: color-mix(in srgb, var(--p-orange-500), transparent 84%);--p-tag-warn-color: var(--p-orange-300);--p-tag-danger-background: color-mix(in srgb, var(--p-red-500), transparent 84%);--p-tag-danger-color: var(--p-red-300);--p-tag-contrast-background: var(--p-surface-0);--p-tag-contrast-color: var(--p-surface-950)}.comfyui-easyuse-theme,.comfyui-easyuse-primary{color:var(--theme-color-light)}.comfyui-easyuse-theme.point:hover,.comfyui-easyuse-primary.point:hover{opacity:.8}.comfyui-easyuse-success{color:var(--success-color)}.comfyui-easyuse-success.point:hover{opacity:.8}.comfyui-easyuse-error{color:var(--error-color)}.comfyui-easyuse-error.point:hover{opacity:.8}.comfyui-easyuse-warning,.comfyui-easyuse--warn{color:var(--warning-color)}.comfyui-easyuse-warning.point:hover,.comfyui-easyuse--warn.point:hover{opacity:.8}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.grid{display:grid}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-10{gap:2.5rem}.gap-12{gap:3rem}.gap-2{gap:.5rem}.gap-2\\.5{gap:.625rem}.gap-20{gap:5rem}.gap-3{gap:.75rem}.gap-3\\.5{gap:.875rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-7{gap:1.75rem}.gap-8{gap:2rem}.gap-\\[0\\.28rem\\]{gap:.28rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.gap-y-6{row-gap:1.5rem}@media (min-width: 576px){.sm\\:col-span-4{grid-column:span 4/span 4}.sm\\:col-span-6{grid-column:span 6/span 6}.sm\\:ml-8{margin-left:2rem}.sm\\:mt-0{margin-top:0}.sm\\:flex{display:flex}.sm\\:h-60{height:15rem}.sm\\:\\!w-64{width:16rem!important}.sm\\:w-40{width:10rem}.sm\\:w-44{width:11rem}.sm\\:w-56{width:14rem}.sm\\:w-60{width:15rem}.sm\\:w-64{width:16rem}.sm\\:w-80{width:20rem}.sm\\:w-96{width:24rem}.sm\\:w-\\[30rem\\]{width:30rem}.sm\\:w-auto{width:auto}.sm\\:min-w-\\[30rem\\]{min-width:30rem}.sm\\:flex-row{flex-direction:row}.sm\\:flex-col{flex-direction:column}.sm\\:flex-nowrap{flex-wrap:nowrap}.sm\\:items-start{align-items:flex-start}.sm\\:items-end{align-items:flex-end}.sm\\:items-center{align-items:center}.sm\\:justify-center{justify-content:center}.sm\\:justify-between{justify-content:space-between}.sm\\:gap-2{gap:.5rem}.sm\\:p-20{padding:5rem}.sm\\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\\:py-10{padding-bottom:2.5rem;padding-top:2.5rem}.sm\\:py-5{padding-bottom:1.25rem;padding-top:1.25rem}.sm\\:pt-32{padding-top:8rem}.sm\\:text-left{text-align:left}.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\\:-bottom-12{bottom:-3rem}.md\\:-bottom-28{bottom:-7rem}.md\\:-bottom-8{bottom:-2rem}.md\\:-bottom-\\[26rem\\]{bottom:-26rem}.md\\:-left-12{left:-3rem}.md\\:-left-28{left:-7rem}.md\\:-left-32{left:-8rem}.md\\:-left-4{left:-1rem}.md\\:-left-48{left:-12rem}.md\\:-left-\\[22rem\\]{left:-22rem}.md\\:bottom-0{bottom:0}.md\\:left-10{left:2.5rem}.md\\:left-\\[32rem\\]{left:32rem}.md\\:left-\\[42rem\\]{left:42rem}.md\\:top-1\\/2{top:50%}.md\\:top-32{top:8rem}.md\\:top-8{top:2rem}.md\\:col-span-2{grid-column:span 2/span 2}.md\\:col-span-4{grid-column:span 4/span 4}.md\\:col-span-6{grid-column:span 6/span 6}.md\\:ml-auto{margin-left:auto}.md\\:block{display:block}.md\\:flex{display:flex}.md\\:hidden{display:none}.md\\:h-\\[20rem\\]{height:20rem}.md\\:h-\\[32rem\\]{height:32rem}.md\\:\\!w-80{width:20rem!important}.md\\:w-2\\/12{width:16.666667%}.md\\:w-40{width:10rem}.md\\:w-5\\/12{width:41.666667%}.md\\:w-56{width:14rem}.md\\:w-6\\/12{width:50%}.md\\:w-60{width:15rem}.md\\:w-8\\/12{width:66.666667%}.md\\:w-80{width:20rem}.md\\:w-\\[100rem\\]{width:100rem}.md\\:w-\\[26rem\\]{width:26rem}.md\\:w-\\[30rem\\]{width:30rem}.md\\:w-\\[50rem\\]{width:50rem}.md\\:w-\\[52rem\\]{width:52rem}.md\\:w-\\[60rem\\]{width:60rem}.md\\:w-\\[95rem\\]{width:95rem}.md\\:w-screen{width:100vw}.md\\:flex-initial{flex:0 1 auto}.md\\:-translate-y-1\\/2{--tw-translate-y: -50% }.md\\:-translate-y-1\\/2,.md\\:translate-x-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-x-0{--tw-translate-x: 0px }.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:flex-row{flex-direction:row}.md\\:flex-col{flex-direction:column}.md\\:items-end{align-items:flex-end}.md\\:items-center{align-items:center}.md\\:justify-start{justify-content:flex-start}.md\\:justify-center{justify-content:center}.md\\:gap-20{gap:5rem}.md\\:gap-4{gap:1rem}.md\\:p-5{padding:1.25rem}.md\\:p-8{padding:2rem}}@media (min-width: 992px){.lg\\:left-20{left:5rem}.lg\\:left-\\[36rem\\]{left:36rem}.lg\\:left-\\[50rem\\]{left:50rem}.lg\\:col-span-1{grid-column:span 1/span 1}.lg\\:col-span-2{grid-column:span 2/span 2}.lg\\:col-span-4{grid-column:span 4/span 4}.lg\\:col-span-6{grid-column:span 6/span 6}.lg\\:mb-0{margin-bottom:0}.lg\\:mt-0{margin-top:0}.lg\\:mt-20{margin-top:5rem}.lg\\:flex{display:flex}.lg\\:hidden{display:none}.lg\\:h-10{height:2.5rem}.lg\\:h-32{height:8rem}.lg\\:h-\\[28rem\\]{height:28rem}.lg\\:\\!w-\\[30rem\\]{width:30rem!important}.lg\\:w-3\\/12{width:25%}.lg\\:w-32{width:8rem}.lg\\:w-\\[28rem\\]{width:28rem}.lg\\:w-\\[64rem\\]{width:64rem}.lg\\:w-fit{width:-moz-fit-content;width:fit-content}.lg\\:max-w-6xl{max-width:72rem}.lg\\:flex-row{flex-direction:row}.lg\\:gap-0{gap:0}.lg\\:rounded-2xl{border-radius:1rem}.lg\\:rounded-3xl{border-radius:1.5rem}.lg\\:rounded-xl{border-radius:.75rem}.lg\\:p-7{padding:1.75rem}.lg\\:px-2{padding-left:.5rem;padding-right:.5rem}.lg\\:px-20{padding-left:5rem;padding-right:5rem}.lg\\:px-56{padding-left:14rem;padding-right:14rem}.lg\\:px-8{padding-left:2rem;padding-right:2rem}.lg\\:px-9{padding-left:2.25rem;padding-right:2.25rem}.lg\\:py-20{padding-bottom:5rem;padding-top:5rem}.lg\\:py-7{padding-bottom:1.75rem;padding-top:1.75rem}.lg\\:pt-0{padding-top:0}.lg\\:text-2xl{font-size:1.5rem;line-height:2rem}.lg\\:text-5xl{font-size:3rem;line-height:1}.lg\\:text-base{font-size:1rem;line-height:1.5rem}.lg\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1200px){.xl\\:-left-12{left:-3rem}.xl\\:-left-28{left:-7rem}.xl\\:bottom-0{bottom:0}.xl\\:left-36{left:9rem}.xl\\:left-\\[42rem\\]{left:42rem}.xl\\:left-\\[60rem\\]{left:60rem}.xl\\:col-span-3{grid-column:span 3/span 3}.xl\\:col-span-4{grid-column:span 4/span 4}.xl\\:col-span-6{grid-column:span 6/span 6}.xl\\:block{display:block}.xl\\:flex{display:flex}.xl\\:hidden{display:none}.xl\\:h-\\[36\\.25rem\\]{height:36.25rem}.xl\\:\\!w-40{width:10rem!important}.xl\\:w-3\\/12{width:25%}.xl\\:w-6\\/12{width:50%}.xl\\:w-96{width:24rem}.xl\\:w-\\[29rem\\]{width:29rem}.xl\\:max-w-36{max-width:9rem}.xl\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\\:flex-row{flex-direction:row}.xl\\:items-start{align-items:flex-start}.xl\\:items-center{align-items:center}.xl\\:gap-1{gap:.25rem}.xl\\:gap-6{gap:1.5rem}.xl\\:text-left{text-align:left}}.comfyui-easyuse-toast{position:fixed;z-index:99999;top:0;left:0;height:0;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:start}.comfyui-easyuse-toast-container{position:relative;height:fit-content;padding:4px;margin-top:-100px;opacity:0;z-index:3;-webkit-transition:all .3s ease-in-out;-khtml-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-ms-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.comfyui-easyuse-toast-container:last-child{z-index:1}.comfyui-easyuse-toast-container.show{opacity:1;margin-top:0!important;transform:translateY(0)}.comfyui-easyuse-toast-container:not(.show){z-index:1}.comfyui-easyuse-toast-container>div{position:relative;background:var(--comfy-menu-bg);color:var(--input-text);height:fit-content;box-shadow:0 0 10px #000000e0;padding:9px 12px;border-radius:var(--border-radius);font-size:14px;pointer-events:all;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-toast-container>div>span{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-toast-container>div>span i{font-size:16px;margin-right:8px}.comfyui-easyuse-toast-container>div>span i.loading{animation:loading-rotate 1s linear infinite}.comfyui-easyuse-toast-container a{cursor:pointer;text-decoration:underline;color:var(--theme-color-light);margin-left:4px;display:inline-block;line-height:1}.comfyui-easyuse-toast-container a:hover{color:var(--theme-color-light);text-decoration:none}@keyframes loading-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.comfyui-easyuse-selector{position:relative}.comfyui-easyuse-selector.hide{display:none}.comfyui-easyuse-selector__header{--height:26px;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;height:var(--height);padding-bottom:10px;border-bottom:1px solid var(--border-color-solid)}.comfyui-easyuse-selector__header_button{height:var(--height);width:var(--height);border-radius:var(--border-radius);border:1px solid var(--border-color);font-size:11px;background:var(--bg-color);box-shadow:none;cursor:pointer;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-selector__header_button:hover{filter:brightness(1.2)}.comfyui-easyuse-selector__header_button:hover i{color:var(--error-color)}.comfyui-easyuse-selector__header_button i{font-size:16px;color:var(--input-text);-webkit-transition:all .3s ease-in-out;-khtml-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-ms-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.comfyui-easyuse-selector__header_search{flex:1;margin-left:10px;border-radius:var(--border-radius);border:1px solid var(--border-color);font-size:11px;background:var(--bg-color);padding:0 8px;height:var(--height);display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-selector__header_search i{font-size:16px}.comfyui-easyuse-selector__header_search .search{vertical-align:middle;margin-left:5px;outline:none;resize:none;border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;overflow-y:scroll;background:transparent;width:100%;line-height:var(--height);font-size:12px;color:var(--input-text);-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1}.comfyui-easyuse-selector__content{list-style:none;padding:0;margin:0;min-height:150px;height:calc(100% - 28px);overflow-y:auto;overflow-x:hidden}.comfyui-easyuse-selector-item{display:inline-block;position:relative}.comfyui-easyuse-selector-item__tag{display:inline-block;vertical-align:middle;margin-top:8px;margin-right:8px;padding:4px;color:var(--input-text);background-color:var(--bg-color);border-radius:var(--border-radius);border:1px solid var(--border-color);font-size:11px;cursor:pointer;overflow:hidden;position:relative}.comfyui-easyuse-selector-item__tag:hover{filter:brightness(1.2)}.comfyui-easyuse-selector-item__tag.hide{display:none}.comfyui-easyuse-selector-item__tag input{--ring-color: transparent;position:relative;box-shadow:none;border:1px solid var(--border-color);border-radius:2px;background:linear-gradient(135deg,var(--comfy-menu-bg) 0%,var(--comfy-input-bg) 60%)}.comfyui-easyuse-selector-item__tag input[type=checkbox]{display:inline-block;flex-shrink:0;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid var(--border-color);background-origin:border-box;padding:0;width:1rem;height:1rem;border-radius:4px;color:var(--theme-color-light);-webkit-user-select:none;user-select:none}.comfyui-easyuse-selector-item__tag input[type=checkbox]:checked{border:1px solid var(--theme-color-light);background-color:var(--theme-color-light);background-image:url("data:image/svg+xml,%3csvg viewBox=\'0 0 16 16\' fill=\'white\' xmlns=\'http://www.w3.org/2000/svg\'%3e%3cpath d=\'M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z\'/%3e%3c/svg%3e")}.comfyui-easyuse-selector-item__tag input span{margin:0 4px;vertical-align:middle}.comfyui-easyuse-selector-preview{position:absolute;left:-180px;top:-110px;z-index:2;border:1px solid var(--border-color);border-radius:var(--border-radius);background:var(--comfy-menu-bg);-webkit-backdrop-filter:saturate(180%) blur(40px);-khtml-backdrop-filter:saturate(180%) blur(40px);-moz-backdrop-filter:saturate(180%) blur(40px);-ms-backdrop-filter:saturate(180%) blur(40px);-o-backdrop-filter:saturate(180%) blur(40px);backdrop-filter:saturate(180%) blur(40px);overflow:hidden}.comfyui-easyuse-selector-preview img{width:150px;height:150px}.comfyui-easyuse-selector-preview__text{font-size:12px;padding:5px 10px;max-width:130px;color:var(--input-text)}.comfyui-easyuse-selector-preview__text h6{line-height:1.15;font-size:10px;margin:10px 0}.comfyui-easyuse-dialog{max-width:600px}.comfyui-easyuse-dialog-title{font-size:18px;font-weight:700;text-align:center;color:var(--input-text);margin:0}.comfyui-easyuse-dialog-images{margin-top:10px;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box}.comfyui-easyuse-dialog-images img{width:50%;height:auto;cursor:pointer;box-sizing:border-box;filter:brightness(80%)}.comfyui-easyuse-dialog-images img:hover{filter:brightness(100%)}.comfyui-easyuse-dialog-images.selected{border:4px solid var(--success-color)}.comfyui-easyuse-dialog-hidden{display:none;height:0}.comfyui-easyuse-contextmenu{--height: 26px;--padding: 8px;font-family:var(--font-family);position:fixed;top:0;left:0;width:100%;max-width:200px;min-width:100px;min-height:100px;padding:var(--padding) 0;box-shadow:0 0 10px #00000040;background-color:var(--tr-odd-bg-color);border-radius:var(--border-radius);z-index:10;will-change:transform}.comfyui-easyuse-contextmenu-item-divider{height:1px;width:100%;background-color:var(--border-color);margin:var(--padding) 0}.comfyui-easyuse-contextmenu-item-content{height:var(--height);padding:0 12px;cursor:pointer;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-contextmenu-item-content span{font-size:11px;color:var(--input-text);display:-webkit-box;-webkit-line-clamp:1;overflow:hidden;word-break:break-all;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1}.comfyui-easyuse-contextmenu-item-content i{color:var(--input-text);margin-left:4px;display:block;width:0;height:0;border-width:4px 4px 0;border-style:solid;border-color:var(--descrip-text) transparent transparent;-webkit-transform:scaleY(.8) rotate(-90deg);-khtml-transform:scaleY(.8) rotate(-90deg);-moz-transform:scaleY(.8) rotate(-90deg);-ms-transform:scaleY(.8) rotate(-90deg);-o-transform:scaleY(.8) rotate(-90deg);transform:scaleY(.8) rotate(-90deg)}.comfyui-easyuse-contextmenu-item-content:hover{background:var(--theme-color)}.comfyui-easyuse-contextmenu-item.disabled .comfyui-easyuse-contextmenu-item-content span{color:var(--border-color);cursor:default}.comfyui-easyuse-contextmenu-item.disabled .comfyui-easyuse-contextmenu-item-content:hover{background:transparent}.comfyui-easyuse-contextmenu-submenu{font-family:var(--font-family);position:absolute;top:0;left:200px;max-width:200px;width:200px;min-width:100px;min-height:--height;padding:var(--padding) 0;box-shadow:0 0 10px #00000040;background-color:var(--tr-odd-bg-color);border-radius:var(--border-radius);z-index:10;will-change:transform}.comfyui-easyuse-contextmenu-model{position:relative}.comfyui-easyuse-contextmenu-model:hover img{display:block;opacity:1}.comfyui-easyuse-contextmenu-model img{position:absolute;z-index:1;right:-175px;top:-75px;width:150px;height:auto;display:none;filter:brightness(70%);-webkit-filter:brightness(70%);opacity:0;-webkit-transition:all .5s cubic-bezier(.55,0,.1,1);-khtml-transition:all .5s cubic-bezier(.55,0,.1,1);-moz-transition:all .5s cubic-bezier(.55,0,.1,1);-ms-transition:all .5s cubic-bezier(.55,0,.1,1);-o-transition:all .5s cubic-bezier(.55,0,.1,1);transition:all .5s cubic-bezier(.55,0,.1,1)}.comfyui-easyuse-slider{width:100%;height:100%;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-slider-item{height:inherit;min-width:25px;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-webkit-flex-direction:column;-khtml-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;-o-flex-direction:column;flex-direction:column}.comfyui-easyuse-slider-item-input{height:15px;font-size:10px;color:var(--input-text)}.comfyui-easyuse-slider-item-label{height:15px;border:none;color:var(--descrip-text);font-size:8px}.comfyui-easyuse-slider-item-scroll{width:5px;height:calc(100% - 30px);background:var(--comfy-input-bg);border-radius:10px;position:relative}.comfyui-easyuse-slider-item-bar{width:10px;height:10px;background:linear-gradient(to bottom,var(--input-text),var(--descrip-text));border-radius:100%;box-shadow:0 2px 10px var(--bg-color);position:absolute;top:0;left:-2.5px;cursor:pointer;z-index:1}.comfyui-easyuse-slider-item-area{width:100%;border-radius:20px;position:absolute;bottom:0;background:var(--input-text);z-index:0}.comfyui-easyuse-slider-item.positive .comfyui-easyuse-slider-item-label{color:var(--success-color)}.comfyui-easyuse-slider-item.positive .comfyui-easyuse-slider-item-area{background:var(--success-color)}.comfyui-easyuse-slider-item.negative .comfyui-easyuse-slider-item-label{color:var(--error-color)}.comfyui-easyuse-slider-item.negative .comfyui-easyuse-slider-item-area{background:var(--error-color)}.comfyui-easyuse-map{height:100%;background:var(--comfy-menu-bg)}.comfyui-easyuse-map .p-splitter-gutter-handle{height:1px!important}.comfyui-easyuse-map-nodes{height:100%;position:relative}.comfyui-easyuse-map-nodes__header{position:absolute;z-index:2;top:0;left:0;width:100%;padding:.25rem 0 .25rem 1rem;height:2.7rem;background:var(--comfy-menu-bg);border-bottom:1px solid var(--border-color);display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-webkit-backdrop-filter:saturate(180%) blur(40px);-khtml-backdrop-filter:saturate(180%) blur(40px);-moz-backdrop-filter:saturate(180%) blur(40px);-ms-backdrop-filter:saturate(180%) blur(40px);-o-backdrop-filter:saturate(180%) blur(40px);backdrop-filter:saturate(180%) blur(40px)}.comfyui-easyuse-map-nodes__header .title{font-size:13px;color:var(--input-text);font-weight:400;line-height:1.5}.comfyui-easyuse-map-nodes__header .toolbar{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-map-nodes__header .toolbar .icon{font-size:.85rem;margin-left:.25rem;cursor:pointer}.comfyui-easyuse-map-nodes__content{position:relative;padding:2.7rem 0 0;height:100%;overflow:auto}.comfyui-easyuse-map-nodes__content dl .label{padding-left:1rem}.comfyui-easyuse-map-nodes__content ol,.comfyui-easyuse-map-nodes__content dl{list-style-type:none;padding:0;margin:0}.comfyui-easyuse-map-nodes__content ol .toolbar span,.comfyui-easyuse-map-nodes__content dl .toolbar span{font-size:13px}.comfyui-easyuse-map-nodes__content ol .toolbar span.pi-eye,.comfyui-easyuse-map-nodes__content dl .toolbar span.pi-eye{color:var(--input-text)}.comfyui-easyuse-map-nodes__content ol .toolbar span.pi-eye-slash,.comfyui-easyuse-map-nodes__content dl .toolbar span.pi-eye-slash{color:var(--descrip-text)}.comfyui-easyuse-map-nodes__content ol .toolbar span.pi-eye-slash.never,.comfyui-easyuse-map-nodes__content dl .toolbar span.pi-eye-slash.never{opacity:.5}.comfyui-easyuse-map-nodes__content .no_result{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;text-align:center}.comfyui-easyuse-map-nodes-group{position:relative;overflow:hidden;width:100%;height:2rem;cursor:default;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-map-nodes-group .left,.comfyui-easyuse-map-nodes-group .right{height:100%;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-map-nodes-group .left{padding-left:.5rem;margin-right:.25rem;-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1}.comfyui-easyuse-map-nodes-group .icon{font-size:.85rem;margin-right:.25rem}.comfyui-easyuse-map-nodes-group .label{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;height:100%;width:100%;min-width:80px}.comfyui-easyuse-map-nodes-group .label span{font-size:14px;color:var(--input-text);font-weight:400;line-height:1.5;display:-webkit-box;-webkit-line-clamp:1;overflow:hidden;word-break:break-all;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.comfyui-easyuse-map-nodes-group:hover{background:var(--content-hover-bg)!important}.comfyui-easyuse-map-nodes-group.active{background:var(--theme-color)!important}.comfyui-easyuse-map-nodes-group.active .label{color:#fff;cursor:default}.comfyui-easyuse-map-nodes-group.never .label{color:var(--descrip-text);opacity:.4}.comfyui-easyuse-map-nodes-group.bypass .label{color:var(--descrip-text)}.comfyui-easyuse-map-nodes-node{height:2rem;cursor:default;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;position:relative;overflow:hidden}.comfyui-easyuse-map-nodes-node .label{text-indent:.5rem;font-size:13px;color:var(--input-text);font-weight:400;line-height:1.5;-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;margin-right:.25rem;height:2rem;line-height:2rem;width:100%;display:-webkit-box;-webkit-line-clamp:1;overflow:hidden;word-break:break-all;text-overflow:ellipsis;-webkit-box-orient:vertical}.comfyui-easyuse-map-nodes-node .label.error{color:var(--error-color)}.comfyui-easyuse-map-nodes-node:hover{background:var(--content-hover-bg)!important}.comfyui-easyuse-map-nodes-node.never .label{color:var(--descrip-text);opacity:.5}.comfyui-easyuse-map-nodes-node.bypass .label{color:#f0f;opacity:.5}.comfyui-easyuse-map-nodes .nodes .label{text-indent:1rem}.no-result-placeholder{display:flex;justify-content:center;align-items:center;height:100%}.no-result-placeholder-content{text-align:center;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-khtml-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;-o-flex-direction:column;flex-direction:column;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between}.no-result-placeholder .p-card{background-color:transparent!important;box-shadow:none;text-align:center}.no-result-placeholder h3{color:var(--input-text);margin-bottom:.5rem}.no-result-placeholder p{color:var(--descrip-text);margin-bottom:1rem;margin-top:0}#comfyui-easyuse-components{position:absolute;top:0;left:0;z-index:2}.comfyui-easyuse{--p-datatable-header-cell-padding: .15rem 1rem;--p-datatable-body-cell-padding: .15rem 1rem;--p-primary-color: var(--theme-color-light)!important;--border-color-solid: var(--border-color);--border-radius: 8px}.comfyui-easyuse.dark-theme{--fg-color: #fff;--bg-color: #242427;--content-bg:#18181b;--content-fg:#fff;--content-hover-bg: #27272a;--comfy-menu-bg: rgba(24,24,27,.9);--comfy-input-bg: #242427;--input-text: #ffffff;--descrip-text: #71717a;--drag-text: #ccc;--error-text: #ff4444;--border-color: #3f3f46;--border-color-solid: #2a2a2e;--tr-even-bg-color: rgba(28,28,28,.9);--tr-odd-bg-color: rgba(19,19,19,.9)}.comfyui-easyuse ::-webkit-scrollbar{width:0em}.comfyui-easyuse ::-webkit-scrollbar-track{background-color:transparent}.comfyui-easyuse ::-webkit-scrollbar-thumb{background-color:transparent;border-radius:2px}.comfyui-easyuse ::-webkit-scrollbar-thumb:hover{background-color:transparent}.comfyui-easyuse body{font-family:var(--font-family)!important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.comfyui-easyuse textarea{font-family:var(--font-family)!important}.comfyui-easyuse hr{border:1px solid var(--border-color)}.comfyui-easyuse .comfy-multiline-input{background-color:transparent;border:1px solid var(--border-color-solid);border-radius:var(--border-radius);padding:8px;font-size:12px}.comfyui-easyuse #comfy-settings-dialog{border:1px solid var(--border-color);background:transparent;-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%);box-shadow:none}.comfyui-easyuse .comfy-modal{border:1px solid var(--border-color);box-shadow:none;-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .cm-title{background-color:transparent!important}.comfyui-easyuse .cm-notice-board{border-radius:10px!important;border:1px solid var(--border-color)!important}.comfyui-easyuse .cm-menu-container{margin-bottom:50px!important}.comfyui-easyuse .cn-manager-custom_milk_white .tg-column-name,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-column-name{color:var(--input-text)}.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-message,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-message{text-align:center;color:var(--descrip-text)!important}.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-frame .tg-cell,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-frame .tg-cell{color:var(--input-text)}.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-frame .cn-node-name a,.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-frame .cmm-node-name a,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-frame .cn-node-name a,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-frame .cmm-node-name a{color:var(--theme-color)!important}.comfyui-easyuse .comfy-menu{border-radius:16px;box-shadow:0 0 1px var(--descrip-text);-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .comfy-menu button.comfy-settings-btn{font-size:12px}.comfyui-easyuse .comfy-menu-btns{margin-bottom:4px}.comfyui-easyuse .comfy-menu button,.comfyui-easyuse .comfy-modal button{font-size:14px;padding:4px 0;margin-bottom:4px}.comfyui-easyuse .comfy-menu-btns button,.comfyui-easyuse .comfy-list-actions button{font-size:10px}.comfyui-easyuse .comfy-menu>button,.comfyui-easyuse .comfy-menu-btns button,.comfyui-easyuse .comfy-menu .comfy-list button,.comfyui-easyuse .comfy-modal button{border-width:1px}.comfyui-easyuse #comfy-dev-save-api-button{justify-content:center}.comfyui-easyuse #queue-button{position:relative;overflow:hidden;min-height:30px;z-index:1}.comfyui-easyuse #queue-button:after{clear:both;content:attr(data-attr);background:green;color:#fff;width:var(--process-bar-width);height:100%;position:absolute;top:0;left:0;z-index:0;text-align:center;display:flex;justify-content:center;align-items:center}.comfyui-easyuse #shareButton{background:linear-gradient(to left,var(--theme-color),var(--theme-color-light))!important;color:#fff!important}.comfyui-easyuse .litegraph.litecontextmenu{--height: 24px;--padding: 6px;font-family:var(--font-family);padding:var(--padding) 0;border-radius:var(--border-radius);-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .litegraph.litecontextmenu .litemenu-title{padding:var(--padding)}.comfyui-easyuse .litegraph.litecontextmenu>div:first-child.litemenu-title{margin-top:-6px}.comfyui-easyuse .litegraph.litecontextmenu .submenu{height:var(--height);line-height:var(--height);padding:0 18px 0 12px;margin:0;background:transparent!important}.comfyui-easyuse .litegraph.litecontextmenu .submenu.has_submenu{border-right:none;position:relative}.comfyui-easyuse .litegraph.litecontextmenu .submenu.has_submenu:after{content:"";display:block;width:0;height:0;border-width:4px 4px 0;border-style:solid;border-color:var(--input-text) transparent transparent;transform:translateY(-50%) rotate(-90deg);top:50%;position:absolute}.comfyui-easyuse .litegraph.litecontextmenu .submenu.separator{height:1px;width:100%;background-color:var(--border-color)!important;margin:var(--padding) 0;border:none}.comfyui-easyuse .litegraph.litecontextmenu .submenu:last-child.separator{display:none}.comfyui-easyuse .litegraph.litecontextmenu .submenu:hover:not(.separator){background:var(--theme-color)!important}.comfyui-easyuse .litegraph.lite-search-item{background-color:var(--comfy-input-bg)!important;filter:brightness(100%)}.comfyui-easyuse .litegraph.lite-search-item:hover{filter:brightness(120%);color:var(--input-text)}.comfyui-easyuse .graphdialog{-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .graphdialog button{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse .comfyui-menu{border-bottom:1px solid var(--bg-color)}.comfyui-easyuse .side-tool-bar-container{border-right:1px solid var(--bg-color)}.comfyui-easyuse .comfy-modal-content{width:100%}#comfyui-menu-monitor{width:120px}#comfyui-menu-monitor #crystools-monitor-container{margin:0 auto!important}#comfyui-menu-monitor #crystools-monitor-container>div{margin:2px 0!important}#comfyui-menu-monitor #crystools-monitor-container>div>div>div{padding:0 4px!important}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}(); +var e,t,n,o,i,r,s,a,l,c,u,d,p,f,h,m,g=Object.defineProperty,v=(e,t,n)=>((e,t,n)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let y=(null==(t=null==(e=window.comfyAPI)?void 0:e.app)?void 0:t.app)||null,b=(null==(o=null==(n=window.comfyAPI)?void 0:n.api)?void 0:o.api)||null,_=(null==(r=null==(i=window.comfyAPI)?void 0:i.ui)?void 0:r.$el)||null,w=(null==(a=null==(s=window.comfyAPI)?void 0:s.dialog)?void 0:a.ComfyDialog)||null,S=(null==(c=null==(l=window.comfyAPI)?void 0:l.widgets)?void 0:c.ComfyWidgets)||null,x=(null==(d=null==(u=window.comfyAPI)?void 0:u.utils)?void 0:d.applyTextReplacements)||null,k=(null==(f=null==(p=window.comfyAPI)?void 0:p.groupNode)?void 0:f.GroupNodeConfig)||null;const C=(e,t=void 0)=>{var n,o;return e?null==(o=null==(n=null==y?void 0:y.ui)?void 0:n.settings)?void 0:o.getSettingValue(e,t):null};function A(e,t=null,n=void 0){try{let o=e?C(e,n):null;return void 0===o&&t&&(o=localStorage[e]),o}catch(o){return null}}async function E(e,t,n=null){var o,i;try{(null==(i=null==(o=null==y?void 0:y.ui)?void 0:o.settings)?void 0:i.setSettingValue)?y.ui.settings.setSettingValue(e,t):await b.storeSetting(e,t),n&&(localStorage[n]="object"==typeof t?JSON.stringify(t):t)}catch(r){}}function O(e,t){if(e="number"==typeof e?e:e instanceof Date?e.getTime():parseInt(e),isNaN(e))return null;let n=new Date(e);(e=n.toString().split(/[\s\:]/g).slice(0,-2))[1]=["01","02","03","04","05","06","07","08","09","10","11","12"][n.getMonth()];let o={MM:1,dd:2,yyyy:3,hh:4,mm:5,ss:6};return t.replace(/([Mmdhs]|y{2})\1/g,(t=>e[o[t]]))}const L="comfyui-easyuse-",T="dark-theme",I="#236692",N={PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},P=0x4000000000000,D=["loaders","latent","image","mask","sampling","_for_testing","advanced","utils","api"],j={ALWAYS:0,NEVER:2,BYPASS:4},M="easyuse_nodes_map",R=LGraphCanvas.node_colors.bgcolor,$={ColorPalette:{version:104,id:"obsidian",name:"Obsidian",colors:{node_slot:{CLIP:"#FFD500",CLIP_VISION:"#A8DADC",CLIP_VISION_OUTPUT:"#ad7452",CONDITIONING:"#FFA931",CONTROL_NET:"#6EE7B7",IMAGE:"#64B5F6",LATENT:"#FF9CF9",MASK:"#81C784",MODEL:"#B39DDB",STYLE_MODEL:"#C2FFAE",VAE:"#FF6E6E",TAESD:"#DCC274",PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},litegraph_base:{BACKGROUND_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQBJREFUeNrs1rEKwjAUhlETUkj3vP9rdmr1Ysammk2w5wdxuLgcMHyptfawuZX4pJSWZTnfnu/lnIe/jNNxHHGNn//HNbbv+4dr6V+11uF527arU7+u63qfa/bnmh8sWLBgwYJlqRf8MEptXPBXJXa37BSl3ixYsGDBMliwFLyCV/DeLIMFCxYsWLBMwSt4Be/NggXLYMGCBUvBK3iNruC9WbBgwYJlsGApeAWv4L1ZBgsWLFiwYJmCV/AK3psFC5bBggULloJX8BpdwXuzYMGCBctgwVLwCl7Be7MMFixYsGDBsu8FH1FaSmExVfAxBa/gvVmwYMGCZbBg/W4vAQYA5tRF9QYlv/QAAAAASUVORK5CYII=",CLEAR_BACKGROUND_COLOR:"#09090b",NODE_TITLE_COLOR:"#d4d4d8",NODE_SELECTED_TITLE_COLOR:"#ffffff",NODE_TEXT_SIZE:14,NODE_TEXT_COLOR:"#ffffff",NODE_SUBTEXT_SIZE:12,NODE_DEFAULT_COLOR:"#09090b",NODE_DEFAULT_BGCOLOR:"rgba(24,24,27,.9)",NODE_DEFAULT_BOXCOLOR:"rgba(255,255,255,.75)",NODE_DEFAULT_SHAPE:"box",NODE_BOX_OUTLINE_COLOR:I,DEFAULT_SHADOW_COLOR:"rgba(0,0,0,0)",DEFAULT_GROUP_FONT:24,WIDGET_BGCOLOR:"#242427",WIDGET_OUTLINE_COLOR:"#3f3f46",WIDGET_TEXT_COLOR:"#d4d4d8",WIDGET_SECONDARY_TEXT_COLOR:"#d4d4d8",LINK_COLOR:"#9A9",EVENT_LINK_COLOR:"#A86",CONNECTING_LINK_COLOR:"#AFA"},comfy_base:{"fg-color":"#fff","bg-color":"#09090b","comfy-menu-bg":"rgba(24,24,24,.9)","comfy-input-bg":"#262626","input-text":"#ddd","descrip-text":"#999","drag-text":"#ccc","error-text":"#ff4444","border-color":"#29292c","tr-even-bg-color":"rgba(28,28,28,.9)","tr-odd-bg-color":"rgba(19,19,19,.9)"}}},NODE_COLORS:{red:{color:"#af3535",bgcolor:R,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:R,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:R,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:R,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:R,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:R,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:R,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:R,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:R,groupcolor:"#444"}}};let G=JSON.parse(JSON.stringify($));delete G.NODE_COLORS,G.ColorPalette.id="obsidian_dark",G.ColorPalette.name="Obsidian Dark",G.ColorPalette.colors.litegraph_base.BACKGROUND_IMAGE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGlmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDEgNzkuMTQ2Mjg5OSwgMjAyMy8wNi8yNS0yMDowMTo1NSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAyMy0xMS0xM1QwMDoxODowMiswMTowMCIgeG1wOk1vZGlmeURhdGU9IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIHhtcDpNZXRhZGF0YURhdGU9IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmIyYzRhNjA5LWJmYTctYTg0MC1iOGFlLTk3MzE2ZjM1ZGIyNyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjk0ZmNlZGU4LTE1MTctZmQ0MC04ZGU3LWYzOTgxM2E3ODk5ZiIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjIzMWIxMGIwLWI0ZmItMDI0ZS1iMTJlLTMwNTMwM2NkMDdjOCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6MjMxYjEwYjAtYjRmYi0wMjRlLWIxMmUtMzA1MzAzY2QwN2M4IiBzdEV2dDp3aGVuPSIyMDIzLTExLTEzVDAwOjE4OjAyKzAxOjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjUuMSAoV2luZG93cykiLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjQ4OWY1NzlmLTJkNjUtZWQ0Zi04OTg0LTA4NGE2MGE1ZTMzNSIgc3RFdnQ6d2hlbj0iMjAyMy0xMS0xNVQwMjowNDo1OSswMTowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIiBzdEV2dDpjaGFuZ2VkPSIvIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpiMmM0YTYwOS1iZmE3LWE4NDAtYjhhZS05NzMxNmYzNWRiMjciIHN0RXZ0OndoZW49IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCAyNS4xIChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4OTe6GAAAAx0lEQVR42u3WMQoAIQxFwRzJys77X8vSLiRgITif7bYbgrwYc/mKXyBoY4VVBgsWLFiwYFmOlTv+9jfDOjHmr8u6eVkGCxYsWLBgmc5S8ApewXvgYRksWLBgKXidpeBdloL3wMOCBctgwVLwCl7BuyyDBQsWLFiwTGcpeAWv4D3wsAwWLFiwFLzOUvAuS8F74GHBgmWwYCl4Ba/gXZbBggULFixYprMUvIJX8B54WAYLFixYCl5nKXiXpeA98LBgwTJYsGC9tg1o8f4TTtqzNQAAAABJRU5ErkJggg==",G.ColorPalette.colors.litegraph_base.CLEAR_BACKGROUND_COLOR="#000";const B=LGraphCanvas.node_colors.bgcolor,F={ColorPalette:{id:"milk_white",name:"Milk White",colors:{node_slot:{CLIP:"#FFA726",CLIP_VISION:"#5C6BC0",CLIP_VISION_OUTPUT:"#8D6E63",CONDITIONING:"#EF5350",CONTROL_NET:"#66BB6A",IMAGE:"#42A5F5",LATENT:"#AB47BC",MASK:"#9CCC65",MODEL:"#7E57C2",STYLE_MODEL:"#D4E157",VAE:"#FF7043",PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},litegraph_base:{BACKGROUND_IMAGE:"data:image/gif;base64,R0lGODlhZABkALMAAAAAAP///+vr6+rq6ujo6Ofn5+bm5uXl5d3d3f///wAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAkALAAAAABkAGQAAAT/UMhJq7046827HkcoHkYxjgZhnGG6si5LqnIM0/fL4qwwIMAg0CAsEovBIxKhRDaNy2GUOX0KfVFrssrNdpdaqTeKBX+dZ+jYvEaTf+y4W66mC8PUdrE879f9d2mBeoNLfH+IhYBbhIx2jkiHiomQlGKPl4uZe3CaeZifnnijgkESBqipqqusra6vsLGys62SlZO4t7qbuby7CLa+wqGWxL3Gv3jByMOkjc2lw8vOoNSi0czAncXW3Njdx9Pf48/Z4Kbbx+fQ5evZ4u3k1fKR6cn03vHlp7T9/v8A/8Gbp4+gwXoFryXMB2qgwoMMHyKEqA5fxX322FG8tzBcRnMW/zlulPbRncmQGidKjMjyYsOSKEF2FBlJQMCbOHP6c9iSZs+UnGYCdbnSo1CZI5F64kn0p1KnTH02nSoV3dGTV7FFHVqVq1dtWcMmVQZTbNGu72zqXMuW7danVL+6e4t1bEy6MeueBYLXrNO5Ze36jQtWsOG97wIj1vt3St/DjTEORss4nNq2mDP3e7w4r1bFkSET5hy6s2TRlD2/mSxXtSHQhCunXo26NevCpmvD/UU6tuullzULH76q92zdZG/Ltv1a+W+osI/nRmyc+fRi1Xdbh+68+0vv10dH3+77KD/i6IdnX669/frn5Zsjh4/2PXju8+8bzc9/6fj27LFnX11/+IUnXWl7BJfegm79FyB9JOl3oHgSklefgxAC+FmFGpqHIYcCfkhgfCohSKKJVo044YUMttggiBkmp6KFXw1oII24oYhjiDByaKOOHcp3Y5BD/njikSkO+eBREQAAOw==",CLEAR_BACKGROUND_COLOR:"lightgray",NODE_TITLE_COLOR:"#222",NODE_SELECTED_TITLE_COLOR:"#000",NODE_TEXT_SIZE:14,NODE_TEXT_COLOR:"#444",NODE_SUBTEXT_SIZE:12,NODE_DEFAULT_COLOR:"#F7F7F7",NODE_DEFAULT_BGCOLOR:"#F5F5F5",NODE_DEFAULT_BOXCOLOR:"#555",NODE_DEFAULT_SHAPE:"box",NODE_BOX_OUTLINE_COLOR:"#000",DEFAULT_SHADOW_COLOR:"rgba(0,0,0,0.1)",DEFAULT_GROUP_FONT:24,WIDGET_BGCOLOR:"#D4D4D4",WIDGET_OUTLINE_COLOR:"#999",WIDGET_TEXT_COLOR:"#222",WIDGET_SECONDARY_TEXT_COLOR:"#555",LINK_COLOR:"#9A9",EVENT_LINK_COLOR:"#FF9800",CONNECTING_LINK_COLOR:"#222"},comfy_base:{"fg-color":"#222","bg-color":"#DDD","comfy-menu-bg":"#F5F5F5","comfy-input-bg":"#C9C9C9","input-text":"#222","descrip-text":"#444","drag-text":"#555","error-text":"#F44336","border-color":"#bbb","tr-even-bg-color":"#f9f9f9","tr-odd-bg-color":"#fff","content-bg":"#e0e0e0","content-fg":"#222","content-hover-bg":"#adadad","content-hover-fg":"#222"}}},NODE_COLORS:{red:{color:"#af3535",bgcolor:B,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:B,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:B,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:B,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:B,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:B,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:B,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:B,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:B,groupcolor:"#444"}}},U={"Workflow created by":"工作流创建者","Watch more video content":"观看更多视频内容","Workflow Guide":"工作流指南","💎 View Checkpoint Info...":"💎 查看 Checkpoint 信息...","💎 View Lora Info...":"💎 查看 Lora 信息...","🔃 Reload Node":"🔃 刷新节点","Updated At:":"最近更新:","Created At:":"首次发布:","✏️ Edit":"✏️ 编辑","💾 Save":"💾 保存","No notes":"当前还没有备注内容","Saving Notes...":"正在保存备注...","Type your notes here":"在这里输入备注内容",ModelName:"模型名称","Models Required":"所需模型","Download Model":"下载模型","Source Url":"模型源地址",Notes:"备注",Type:"类型","Trained Words":"训练词",BaseModel:"基础算法",Details:"详情",Description:"描述",Download:"下载量",Source:"来源","Saving Preview...":"正在保存预览图...","Saving Succeed":"保存成功","Clean SuccessFully":"清理成功","Clean Failed":"清理失败","Saving Failed":"保存失败","No COMBO link":"沒有找到COMBO连接","Reboot ComfyUI":"重启ComfyUI","Are you sure you'd like to reboot the server?":"是否要重启ComfyUI?","Nodes Map":"管理节点组","No Nodes":"未找到节点","No nodes found in the map":"在工作流程中没有找到节点","Expand All":"展开所有组","Collapse All":"折叠所有组",Queue:"队列","Cleanup Of GPU Usage":"清理GPU占用","Please stop all running tasks before cleaning GPU":"请在清理GPU之前停止所有运行中的任务",Always:"启用中",Bypass:"已忽略",Never:"已停用","Auto Sorting":"自动排序","Toggle `Show/Hide` can set mode of group, LongPress can set group nodes to never":"点击`启用中/已忽略`可设置组模式, 长按可停用该组节点","Enable Shift+Up/Down/Left/Right key to align selected nodes":"启用 `Shift+上/下/左/右` 键对齐选中的节点","Enable Shift+g to add selected nodes to a group":"启用 `Shift+g` 键将选中的节点添加一个组","Enable Up/Down/Left/Right key to jump nearest nodes":"启用 `上/下/左/右` 键跳转到最近的前后节点","Enable ALT+1~9 to paste nodes from nodes template":"启用 `ALT+1~9` 从节点模板粘贴到工作流中","Enable contextMenu auto nest subdirectories":"启用上下文菜单自动嵌套子目录","Enable right-click menu to add node A~Z sorting":"启用右键菜单中新建节点A~Z排序","Enable model thumbnails display":"启动模型预览图显示","Enable nodes runtime display":"启动节点运行时间显示","Enable chain get node and set node with parent nodes":"启用将获取点和设置点与父节点链在一起","Too many thumbnails, have closed the display":"模型缩略图太多啦,为您关闭了显示","Get styles list Failed":"获取样式列表失败","Get style image Failed":"获取样式图片失败","Empty All":"清空所有","Type here to search styles ...":"在此处输入以搜索样式 ...","Loading UserInfo...":"正在获取用户信息...","Please set the APIKEY first":"请先设置APIKEY","Setting APIKEY":"设置APIKEY","Save Account Info":"保存账号信息",Choose:"选择",Delete:"删除",Edit:"编辑","At least one account is required":"删除失败: 至少需要一个账户","APIKEY is not Empty":"APIKEY 不能为空","Add Account":"添加账号","Getting Your APIKEY":"获取您的APIKEY","Choose Selected Images":"选择选中的图片","Choose images to continue":"选择图片以继续",Background:"背景",Hat:"帽子",Hair:"头发",Body:"身体",Face:"脸部",Clothes:"衣服",Others:"其他",Glove:"手套",Sunglasses:"太阳镜","Upper-clothes":"上衣",Dress:"连衣裙",Coat:"外套",Socks:"袜子",Pants:"裤子",Jumpsuits:"连体衣",Scarf:"围巾",Skirt:"裙子","Left-arm":"左臂","Right-arm":"右臂","Left-leg":"左腿","Right-leg":"右腿","Left-shoe":"左鞋","Right-shoe":"右鞋",s:"秒","No Node Templates Found":"未找到节点模板预设","Get Node Templates File Failed":"获取节点模板文件失败","Node template with {key} not set":"未设置快捷键为{key}的节点预设","ComfyUI Basic":"ComfyUI 基础节点","Recommend Nodes":"推荐节点","Others A~Z":"其他节点 A~Z"},z=A("AGL.Locale"),V=(e,t=!1)=>"zh-CN"===(t?navigator.language:z)&&U[e]||e,H={addGroup:{id:"EasyUse.Hotkeys.AddGroup",name:V("Enable Shift+g to add selected nodes to a group"),tooltip:V(""),type:"boolean",defaultValue:!0},alignSelectedNodes:{id:"EasyUse.Hotkeys.AlignSelectedNodes",name:V("Enable Shift+Up/Down/Left/Right key to align selected nodes"),tooltip:V(""),type:"boolean",defaultValue:!0},nodesTemplate:{id:"EasyUse.Hotkeys.NodesTemplate",name:V("Enable ALT+1~9 to paste nodes from nodes template"),tooltip:V(""),type:"boolean",defaultValue:!0},jumpNearestNodes:{id:"EasyUse.Hotkeys.JumpNearestNodes",name:V("Enable Up/Down/Left/Right key to jump nearest nodes"),tooltip:V(""),type:"boolean",defaultValue:!0},subDirectories:{id:"EasyUse.ContextMenu.SubDirectories",name:V("Enable contextMenu auto nest subdirectories"),tooltip:V(""),type:"boolean",defaultValue:!0},modelsThumbnails:{id:"EasyUse.ContextMenu.ModelsThumbnails",name:V("Enable model thumbnails display"),tooltip:V(""),type:"boolean",defaultValue:!0},rightMenuNodesSort:{id:"EasyUse.ContextMenu.NodesSort",name:V("Enable right-click menu to add node A~Z sorting"),tooltip:V(""),type:"boolean",defaultValue:!0},nodesRuntime:{id:"EasyUse.Nodes.Runtime",name:V("Enable nodes runtime display"),tooltip:V(""),type:"boolean",defaultValue:!0},chainGetSet:{id:"EasyUse.Nodes.ChainGetSet",name:V("Enable chain get node and set node with parent nodes"),tooltip:V(""),type:"boolean",defaultValue:!0}};function W(e=100,t){return new Promise((n=>{setTimeout((()=>{n(t)}),e)}))} +/** +* @vue/shared v3.4.36 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +/*! #__NO_SIDE_EFFECTS__ */function Y(e,t){const n=new Set(e.split(","));return e=>n.has(e)}const Z={},K=[],X=()=>{},Q=()=>!1,J=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),q=e=>e.startsWith("onUpdate:"),ee=Object.assign,te=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ne=Object.prototype.hasOwnProperty,oe=(e,t)=>ne.call(e,t),ie=Array.isArray,re=e=>"[object Map]"===fe(e),se=e=>"[object Set]"===fe(e),ae=e=>"function"==typeof e,le=e=>"string"==typeof e,ce=e=>"symbol"==typeof e,ue=e=>null!==e&&"object"==typeof e,de=e=>(ue(e)||ae(e))&&ae(e.then)&&ae(e.catch),pe=Object.prototype.toString,fe=e=>pe.call(e),he=e=>fe(e).slice(8,-1),me=e=>"[object Object]"===fe(e),ge=e=>le(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,ve=Y(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ye=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},be=/-(\w)/g,_e=ye((e=>e.replace(be,((e,t)=>t?t.toUpperCase():"")))),we=/\B([A-Z])/g,Se=ye((e=>e.replace(we,"-$1").toLowerCase())),xe=ye((e=>e.charAt(0).toUpperCase()+e.slice(1))),ke=ye((e=>e?`on${xe(e)}`:"")),Ce=(e,t)=>!Object.is(e,t),Ae=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},Oe=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Le;const Te=()=>Le||(Le="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function Ie(e){if(ie(e)){const t={};for(let n=0;n{if(e){const n=e.split(Pe);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function Me(e){let t="";if(le(e))t=e;else if(ie(e))for(let n=0;n!(!e||!0!==e.__v_isRef),Be=e=>le(e)?e:null==e?"":ie(e)||ue(e)&&(e.toString===pe||!ae(e.toString))?Ge(e)?Be(e.value):JSON.stringify(e,Fe,2):String(e),Fe=(e,t)=>Ge(t)?Fe(e,t.value):re(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],o)=>(e[Ue(t,o)+" =>"]=n,e)),{})}:se(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>Ue(e)))}:ce(t)?Ue(t):!ue(t)||ie(t)||me(t)?t:String(t),Ue=(e,t="")=>{var n;return ce(e)?`Symbol(${null!=(n=e.description)?n:t})`:e}; +/** +* @vue/reactivity v3.4.36 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +let ze,Ve;class He{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=ze,!e&&ze&&(this.index=(ze.scopes||(ze.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=ze;try{return ze=this,e()}finally{ze=t}}}on(){ze=this}off(){ze=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),nt()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=Je,t=Ve;try{return Je=!0,Ve=this,this._runnings++,Ke(this),this.fn()}finally{Xe(this),this._runnings--,Ve=t,Je=e}}stop(){this.active&&(Ke(this),Xe(this),this.onStop&&this.onStop(),this.active=!1)}}function Ke(e){e._trackId++,e._depsLength=0}function Xe(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},ct=new WeakMap,ut=Symbol(""),dt=Symbol("");function pt(e,t,n){if(Je&&Ve){let t=ct.get(e);t||ct.set(e,t=new Map);let o=t.get(n);o||t.set(n,o=lt((()=>t.delete(n)))),rt(Ve,o)}}function ft(e,t,n,o,i,r){const s=ct.get(e);if(!s)return;let a=[];if("clear"===t)a=[...s.values()];else if("length"===n&&ie(e)){const e=Number(o);s.forEach(((t,n)=>{("length"===n||!ce(n)&&n>=e)&&a.push(t)}))}else switch(void 0!==n&&a.push(s.get(n)),t){case"add":ie(e)?ge(n)&&a.push(s.get("length")):(a.push(s.get(ut)),re(e)&&a.push(s.get(dt)));break;case"delete":ie(e)||(a.push(s.get(ut)),re(e)&&a.push(s.get(dt)));break;case"set":re(e)&&a.push(s.get(ut))}ot();for(const l of a)l&&at(l,4);it()}const ht=Y("__proto__,__v_isRef,__isVue"),mt=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(ce)),gt=vt();function vt(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=on(this);for(let t=0,i=this.length;t{e[t]=function(...e){tt(),ot();const n=on(this)[t].apply(this,e);return it(),nt(),n}})),e}function yt(e){ce(e)||(e=String(e));const t=on(this);return pt(t,0,e),t.hasOwnProperty(e)}class bt{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const o=this._isReadonly,i=this._isShallow;if("__v_isReactive"===t)return!o;if("__v_isReadonly"===t)return o;if("__v_isShallow"===t)return i;if("__v_raw"===t)return n===(o?i?Kt:Zt:i?Yt:Wt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const r=ie(e);if(!o){if(r&&oe(gt,t))return Reflect.get(gt,t,n);if("hasOwnProperty"===t)return yt}const s=Reflect.get(e,t,n);return(ce(t)?mt.has(t):ht(t))?s:(o||pt(e,0,t),i?s:dn(s)?r&&ge(t)?s:s.value:ue(s)?o?Qt(s):Xt(s):s)}}class _t extends bt{constructor(e=!1){super(!1,e)}set(e,t,n,o){let i=e[t];if(!this._isShallow){const t=en(i);if(tn(n)||en(n)||(i=on(i),n=on(n)),!ie(e)&&dn(i)&&!dn(n))return!t&&(i.value=n,!0)}const r=ie(e)&&ge(t)?Number(t)e,At=e=>Reflect.getPrototypeOf(e);function Et(e,t,n=!1,o=!1){const i=on(e=e.__v_raw),r=on(t);n||(Ce(t,r)&&pt(i,0,t),pt(i,0,r));const{has:s}=At(i),a=o?Ct:n?an:sn;return s.call(i,t)?a(e.get(t)):s.call(i,r)?a(e.get(r)):void(e!==i&&e.get(t))}function Ot(e,t=!1){const n=this.__v_raw,o=on(n),i=on(e);return t||(Ce(e,i)&&pt(o,0,e),pt(o,0,i)),e===i?n.has(e):n.has(e)||n.has(i)}function Lt(e,t=!1){return e=e.__v_raw,!t&&pt(on(e),0,ut),Reflect.get(e,"size",e)}function Tt(e,t=!1){t||tn(e)||en(e)||(e=on(e));const n=on(this);return At(n).has.call(n,e)||(n.add(e),ft(n,"add",e,e)),this}function It(e,t,n=!1){n||tn(t)||en(t)||(t=on(t));const o=on(this),{has:i,get:r}=At(o);let s=i.call(o,e);s||(e=on(e),s=i.call(o,e));const a=r.call(o,e);return o.set(e,t),s?Ce(t,a)&&ft(o,"set",e,t):ft(o,"add",e,t),this}function Nt(e){const t=on(this),{has:n,get:o}=At(t);let i=n.call(t,e);i||(e=on(e),i=n.call(t,e)),o&&o.call(t,e);const r=t.delete(e);return i&&ft(t,"delete",e,void 0),r}function Pt(){const e=on(this),t=0!==e.size,n=e.clear();return t&&ft(e,"clear",void 0,void 0),n}function Dt(e,t){return function(n,o){const i=this,r=i.__v_raw,s=on(r),a=t?Ct:e?an:sn;return!e&&pt(s,0,ut),r.forEach(((e,t)=>n.call(o,a(e),a(t),i)))}}function jt(e,t,n){return function(...o){const i=this.__v_raw,r=on(i),s=re(r),a="entries"===e||e===Symbol.iterator&&s,l="keys"===e&&s,c=i[e](...o),u=n?Ct:t?an:sn;return!t&&pt(r,0,l?dt:ut),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function Mt(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Rt(){const e={get(e){return Et(this,e)},get size(){return Lt(this)},has:Ot,add:Tt,set:It,delete:Nt,clear:Pt,forEach:Dt(!1,!1)},t={get(e){return Et(this,e,!1,!0)},get size(){return Lt(this)},has:Ot,add(e){return Tt.call(this,e,!0)},set(e,t){return It.call(this,e,t,!0)},delete:Nt,clear:Pt,forEach:Dt(!1,!0)},n={get(e){return Et(this,e,!0)},get size(){return Lt(this,!0)},has(e){return Ot.call(this,e,!0)},add:Mt("add"),set:Mt("set"),delete:Mt("delete"),clear:Mt("clear"),forEach:Dt(!0,!1)},o={get(e){return Et(this,e,!0,!0)},get size(){return Lt(this,!0)},has(e){return Ot.call(this,e,!0)},add:Mt("add"),set:Mt("set"),delete:Mt("delete"),clear:Mt("clear"),forEach:Dt(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{e[i]=jt(i,!1,!1),n[i]=jt(i,!0,!1),t[i]=jt(i,!1,!0),o[i]=jt(i,!0,!0)})),[e,n,t,o]}const[$t,Gt,Bt,Ft]=Rt();function Ut(e,t){const n=t?e?Ft:Bt:e?Gt:$t;return(t,o,i)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(oe(n,o)&&o in t?n:t,o,i)}const zt={get:Ut(!1,!1)},Vt={get:Ut(!1,!0)},Ht={get:Ut(!0,!1)},Wt=new WeakMap,Yt=new WeakMap,Zt=new WeakMap,Kt=new WeakMap;function Xt(e){return en(e)?e:Jt(e,!1,St,zt,Wt)}function Qt(e){return Jt(e,!0,xt,Ht,Zt)}function Jt(e,t,n,o,i){if(!ue(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const r=i.get(e);if(r)return r;const s=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(he(a));var a;if(0===s)return e;const l=new Proxy(e,2===s?o:n);return i.set(e,l),l}function qt(e){return en(e)?qt(e.__v_raw):!(!e||!e.__v_isReactive)}function en(e){return!(!e||!e.__v_isReadonly)}function tn(e){return!(!e||!e.__v_isShallow)}function nn(e){return!!e&&!!e.__v_raw}function on(e){const t=e&&e.__v_raw;return t?on(t):e}function rn(e){return Object.isExtensible(e)&&Ee(e,"__v_skip",!0),e}const sn=e=>ue(e)?Xt(e):e,an=e=>ue(e)?Qt(e):e;class ln{constructor(e,t,n,o){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Ze((()=>e(this._value)),(()=>un(this,2===this.effect._dirtyLevel?2:3))),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=on(this);return e._cacheable&&!e.effect.dirty||!Ce(e._value,e._value=e.effect.run())||un(e,4),cn(e),e.effect._dirtyLevel>=2&&un(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function cn(e){var t;Je&&Ve&&(e=on(e),rt(Ve,null!=(t=e.dep)?t:e.dep=lt((()=>e.dep=void 0),e instanceof ln?e:void 0)))}function un(e,t=4,n,o){const i=(e=on(e)).dep;i&&at(i,t)}function dn(e){return!(!e||!0!==e.__v_isRef)}function pn(e){return function(e,t){if(dn(e))return e;return new fn(e,t)}(e,!1)}class fn{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:on(e),this._value=t?e:sn(e)}get value(){return cn(this),this._value}set value(e){const t=this.__v_isShallow||tn(e)||en(e);e=t?e:on(e),Ce(e,this._rawValue)&&(this._rawValue,this._rawValue=e,this._value=t?e:sn(e),un(this,4))}}function hn(e){return dn(e)?e.value:e}const mn={get:(e,t,n)=>hn(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const i=e[t];return dn(i)&&!dn(n)?(i.value=n,!0):Reflect.set(e,t,n,o)}};function gn(e){return qt(e)?e:new Proxy(e,mn)}class vn{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){const n=ct.get(e);return n&&n.get(t)}(on(this._object),this._key)}}class yn{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function bn(e,t,n){return dn(e)?e:ae(e)?new yn(e):ue(e)&&arguments.length>1?_n(e,t,n):pn(e)}function _n(e,t,n){const o=e[t];return dn(o)?o:new vn(e,t,n)} +/** +* @vue/runtime-core v3.4.36 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function wn(e,t,n,o){try{return o?e(...o):e()}catch(i){xn(i,t,n)}}function Sn(e,t,n,o){if(ae(e)){const i=wn(e,t,n,o);return i&&de(i)&&i.catch((e=>{xn(e,t,n)})),i}if(ie(e)){const i=[];for(let r=0;r>>1,i=An[o],r=$n(i);r$n(e)-$n(t)));if(On.length=0,Ln)return void Ln.push(...e);for(Ln=e,Tn=0;Tnnull==e.id?1/0:e.id,Gn=(e,t)=>{const n=$n(e)-$n(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Bn(e){Cn=!1,kn=!0,An.sort(Gn);try{for(En=0;En{o._d&&Bi(-1);const i=zn(t);let r;try{r=e(...n)}finally{zn(i),o._d&&Bi(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function Hn(e,t){if(null===Fn)return e;const n=yr(Fn),o=e.dirs||(e.dirs=[]);for(let i=0;i!!e.type.__asyncLoader,Kn=e=>e.type.__isKeepAlive;function Xn(e,t){Jn(e,"a",t)}function Qn(e,t){Jn(e,"da",t)}function Jn(e,t,n=sr){const o=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(eo(t,o,n),n){let e=n.parent;for(;e&&e.parent;)Kn(e.parent.vnode)&&qn(o,t,n,e),e=e.parent}}function qn(e,t,n,o){const i=eo(t,e,o,!0);ao((()=>{te(o[t],i)}),n)}function eo(e,t,n=sr,o=!1){if(n){const i=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...o)=>{tt();const i=ur(n),r=Sn(t,n,e,o);return i(),nt(),r});return o?i.unshift(r):i.push(r),r}}const to=e=>(t,n=sr)=>{hr&&"sp"!==e||eo(e,((...e)=>t(...e)),n)},no=to("bm"),oo=to("m"),io=to("bu"),ro=to("u"),so=to("bum"),ao=to("um"),lo=to("sp"),co=to("rtg"),uo=to("rtc");function po(e,t=sr){eo("ec",e,t)}const fo="components",ho="directives";function mo(e,t){return vo(fo,e,!0,t)||e}const go=Symbol.for("v-ndc");function vo(e,t,n=!0,o=!1){const i=Fn||sr;if(i){const n=i.type;if(e===fo){const e=br(n,!1);if(e&&(e===t||e===_e(t)||e===xe(_e(t))))return n}const r=yo(i[e]||n[e],t)||yo(i.appContext[e],t);return!r&&o?n:r}}function yo(e,t){return e&&(e[t]||e[_e(t)]||e[xe(_e(t))])}function bo(e,t,n,o){let i;const r=n;if(ie(e)||le(e)){i=new Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,r)));else{const n=Object.keys(e);i=new Array(n.length);for(let o=0,s=n.length;o!Vi(e)||e.type!==Di&&!(e.type===Ni&&!wo(e.children))))?e:null}const So=e=>e?pr(e)?yr(e):So(e.parent):null,xo=ee(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>So(e.parent),$root:e=>So(e.root),$emit:e=>e.emit,$options:e=>Io(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Dn(e.update)}),$nextTick:e=>e.n||(e.n=Pn.bind(e.proxy)),$watch:e=>wi.bind(e)}),ko=(e,t)=>e!==Z&&!e.__isScriptSetup&&oe(e,t),Co={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:o,data:i,props:r,accessCache:s,type:a,appContext:l}=e;let c;if("$"!==t[0]){const a=s[t];if(void 0!==a)switch(a){case 1:return o[t];case 2:return i[t];case 4:return n[t];case 3:return r[t]}else{if(ko(o,t))return s[t]=1,o[t];if(i!==Z&&oe(i,t))return s[t]=2,i[t];if((c=e.propsOptions[0])&&oe(c,t))return s[t]=3,r[t];if(n!==Z&&oe(n,t))return s[t]=4,n[t];Eo&&(s[t]=0)}}const u=xo[t];let d,p;return u?("$attrs"===t&&pt(e.attrs,0,""),u(e)):(d=a.__cssModules)&&(d=d[t])?d:n!==Z&&oe(n,t)?(s[t]=4,n[t]):(p=l.config.globalProperties,oe(p,t)?p[t]:void 0)},set({_:e},t,n){const{data:o,setupState:i,ctx:r}=e;return ko(i,t)?(i[t]=n,!0):o!==Z&&oe(o,t)?(o[t]=n,!0):!oe(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(r[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:i,propsOptions:r}},s){let a;return!!n[s]||e!==Z&&oe(e,s)||ko(t,s)||(a=r[0])&&oe(a,s)||oe(o,s)||oe(xo,s)||oe(i.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:oe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ao(e){return ie(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}let Eo=!0;function Oo(e){const t=Io(e),n=e.proxy,o=e.ctx;Eo=!1,t.beforeCreate&&Lo(t.beforeCreate,e,"bc");const{data:i,computed:r,methods:s,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:p,beforeUpdate:f,updated:h,activated:m,deactivated:g,beforeDestroy:v,beforeUnmount:y,destroyed:b,unmounted:_,render:w,renderTracked:S,renderTriggered:x,errorCaptured:k,serverPrefetch:C,expose:A,inheritAttrs:E,components:O,directives:L,filters:T}=t;if(c&&function(e,t){ie(e)&&(e=jo(e));for(const n in e){const o=e[n];let i;i=ue(o)?"default"in o?zo(o.from||n,o.default,!0):zo(o.from||n):zo(o),dn(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}(c,o,null),s)for(const N in s){const e=s[N];ae(e)&&(o[N]=e.bind(n))}if(i){const t=i.call(n,n);ue(t)&&(e.data=Xt(t))}if(Eo=!0,r)for(const N in r){const e=r[N],t=ae(e)?e.bind(n,n):ae(e.get)?e.get.bind(n,n):X,i=!ae(e)&&ae(e.set)?e.set.bind(n):X,s=_r({get:t,set:i});Object.defineProperty(o,N,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(a)for(const N in a)To(a[N],o,n,N);if(l){const e=ae(l)?l.call(n):l;Reflect.ownKeys(e).forEach((t=>{!function(e,t){if(sr){let n=sr.provides;const o=sr.parent&&sr.parent.provides;o===n&&(n=sr.provides=Object.create(o)),n[e]=t}else;}(t,e[t])}))}function I(e,t){ie(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(u&&Lo(u,e,"c"),I(no,d),I(oo,p),I(io,f),I(ro,h),I(Xn,m),I(Qn,g),I(po,k),I(uo,S),I(co,x),I(so,y),I(ao,_),I(lo,C),ie(A))if(A.length){const t=e.exposed||(e.exposed={});A.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});w&&e.render===X&&(e.render=w),null!=E&&(e.inheritAttrs=E),O&&(e.components=O),L&&(e.directives=L)}function Lo(e,t,n){Sn(ie(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function To(e,t,n,o){const i=o.includes(".")?Si(n,o):()=>n[o];if(le(e)){const n=t[e];ae(n)&&bi(i,n)}else if(ae(e))bi(i,e.bind(n));else if(ue(e))if(ie(e))e.forEach((e=>To(e,t,n,o)));else{const o=ae(e.handler)?e.handler.bind(n):t[e.handler];ae(o)&&bi(i,o,e)}}function Io(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:i,optionsCache:r,config:{optionMergeStrategies:s}}=e.appContext,a=r.get(t);let l;return a?l=a:i.length||n||o?(l={},i.length&&i.forEach((e=>No(l,e,s,!0))),No(l,t,s)):l=t,ue(t)&&r.set(t,l),l}function No(e,t,n,o=!1){const{mixins:i,extends:r}=t;r&&No(e,r,n,!0),i&&i.forEach((t=>No(e,t,n,!0)));for(const s in t)if(o&&"expose"===s);else{const o=Po[s]||n&&n[s];e[s]=o?o(e[s],t[s]):t[s]}return e}const Po={data:Do,props:$o,emits:$o,methods:Ro,computed:Ro,beforeCreate:Mo,created:Mo,beforeMount:Mo,mounted:Mo,beforeUpdate:Mo,updated:Mo,beforeDestroy:Mo,beforeUnmount:Mo,destroyed:Mo,unmounted:Mo,activated:Mo,deactivated:Mo,errorCaptured:Mo,serverPrefetch:Mo,components:Ro,directives:Ro,watch:function(e,t){if(!e)return t;if(!t)return e;const n=ee(Object.create(null),e);for(const o in t)n[o]=Mo(e[o],t[o]);return n},provide:Do,inject:function(e,t){return Ro(jo(e),jo(t))}};function Do(e,t){return t?e?function(){return ee(ae(e)?e.call(this,this):e,ae(t)?t.call(this,this):t)}:t:e}function jo(e){if(ie(e)){const t={};for(let n=0;n(r.has(e)||(e&&ae(e.install)?(r.add(e),e.install(a,...t)):ae(e)&&(r.add(e),e(a,...t))),a),mixin:e=>(i.mixins.includes(e)||i.mixins.push(e),a),component:(e,t)=>t?(i.components[e]=t,a):i.components[e],directive:(e,t)=>t?(i.directives[e]=t,a):i.directives[e],mount(r,l,c){if(!s){const u=Ki(n,o);return u.appContext=i,!0===c?c="svg":!1===c&&(c=void 0),l&&t?t(u,r):e(u,r,c),s=!0,a._container=r,r.__vue_app__=a,yr(u.component)}},unmount(){s&&(e(null,a._container),delete a._container.__vue_app__)},provide:(e,t)=>(i.provides[e]=t,a),runWithContext(e){const t=Uo;Uo=a;try{return e()}finally{Uo=t}}};return a}}let Uo=null;function zo(e,t,n=!1){const o=sr||Fn;if(o||Uo){const i=o?null==o.parent?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:Uo._context.provides;if(i&&e in i)return i[e];if(arguments.length>1)return n&&ae(t)?t.call(o&&o.proxy):t}}const Vo={},Ho=()=>Object.create(Vo),Wo=e=>Object.getPrototypeOf(e)===Vo;function Yo(e,t,n,o=!1){const i={},r=Ho();e.propsDefaults=Object.create(null),Zo(e,t,i,r);for(const s in e.propsOptions[0])s in i||(i[s]=void 0);n?e.props=o?i:Jt(i,!1,kt,Vt,Yt):e.type.props?e.props=i:e.props=r,e.attrs=r}function Zo(e,t,n,o){const[i,r]=e.propsOptions;let s,a=!1;if(t)for(let l in t){if(ve(l))continue;const c=t[l];let u;i&&oe(i,u=_e(l))?r&&r.includes(u)?(s||(s={}))[u]=c:n[u]=c:Ei(e.emitsOptions,l)||l in o&&c===o[l]||(o[l]=c,a=!0)}if(r){const t=on(n),o=s||Z;for(let s=0;s{l=!0;const[n,o]=Qo(e,t,!0);ee(s,n),o&&a.push(...o)};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}if(!r&&!l)return ue(e)&&o.set(e,K),K;if(ie(r))for(let u=0;u"_"===e[0]||"$stable"===e,ei=e=>ie(e)?e.map(qi):[qi(e)],ti=(e,t,n)=>{if(t._n)return t;const o=Vn(((...e)=>ei(t(...e))),n);return o._c=!1,o},ni=(e,t,n)=>{const o=e._ctx;for(const i in e){if(qo(i))continue;const n=e[i];if(ae(n))t[i]=ti(0,n,o);else if(null!=n){const e=ei(n);t[i]=()=>e}}},oi=(e,t)=>{const n=ei(t);e.slots.default=()=>n},ii=(e,t,n)=>{for(const o in t)(n||"_"!==o)&&(e[o]=t[o])},ri=(e,t,n)=>{const o=e.slots=Ho();if(32&e.vnode.shapeFlag){const e=t._;e?(ii(o,t,n),n&&Ee(o,"_",e,!0)):ni(t,o)}else t&&oi(e,t)},si=(e,t,n)=>{const{vnode:o,slots:i}=e;let r=!0,s=Z;if(32&o.shapeFlag){const e=t._;e?n&&1===e?r=!1:ii(i,t,n):(r=!t.$stable,ni(t,i)),s=t}else t&&(oi(e,t),s={default:1});if(r)for(const a in i)qo(a)||null!=s[a]||delete i[a]};function ai(e,t,n,o,i=!1){if(ie(e))return void e.forEach(((e,r)=>ai(e,t&&(ie(t)?t[r]:t),n,o,i)));if(Zn(o)&&!i)return;const r=4&o.shapeFlag?yr(o.component):o.el,s=i?null:r,{i:a,r:l}=e,c=t&&t.r,u=a.refs===Z?a.refs={}:a.refs,d=a.setupState;if(null!=c&&c!==l&&(le(c)?(u[c]=null,oe(d,c)&&(d[c]=null)):dn(c)&&(c.value=null)),ae(l))wn(l,a,12,[s,u]);else{const t=le(l),o=dn(l);if(t||o){const a=()=>{if(e.f){const n=t?oe(d,l)?d[l]:u[l]:l.value;i?ie(n)&&te(n,r):ie(n)?n.includes(r)||n.push(r):t?(u[l]=[r],oe(d,l)&&(d[l]=u[l])):(l.value=[r],e.k&&(u[e.k]=l.value))}else t?(u[l]=s,oe(d,l)&&(d[l]=s)):o&&(l.value=s,e.k&&(u[e.k]=s))};s?(a.id=-1,ci(a,n)):a()}}}const li=Symbol("_vte"),ci=function(e,t){t&&t.pendingBranch?ie(e)?t.effects.push(...e):t.effects.push(e):(ie(n=e)?On.push(...n):Ln&&Ln.includes(n,n.allowRecurse?Tn+1:Tn)||On.push(n),jn());var n};function ui(e){return function(e){Te().__VUE__=!0;const{insert:t,remove:n,patchProp:o,createElement:i,createText:r,createComment:s,setText:a,setElementText:l,parentNode:c,nextSibling:u,setScopeId:d=X,insertStaticContent:p}=e,f=(e,t,n,o=null,i=null,r=null,s=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Hi(e,t)&&(o=F(e),M(e,i,r,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:u,shapeFlag:d}=t;switch(c){case Pi:h(e,t,n,o);break;case Di:m(e,t,n,o);break;case ji:null==e&&g(t,n,o,s);break;case Ni:A(e,t,n,o,i,r,s,a,l);break;default:1&d?b(e,t,n,o,i,r,s,a,l):6&d?E(e,t,n,o,i,r,s,a,l):(64&d||128&d)&&c.process(e,t,n,o,i,r,s,a,l,V)}null!=u&&i&&ai(u,e&&e.ref,r,t||e,!t)},h=(e,n,o,i)=>{if(null==e)t(n.el=r(n.children),o,i);else{const t=n.el=e.el;n.children!==e.children&&a(t,n.children)}},m=(e,n,o,i)=>{null==e?t(n.el=s(n.children||""),o,i):n.el=e.el},g=(e,t,n,o)=>{[e.el,e.anchor]=p(e.children,t,n,o,e.el,e.anchor)},v=({el:e,anchor:n},o,i)=>{let r;for(;e&&e!==n;)r=u(e),t(e,o,i),e=r;t(n,o,i)},y=({el:e,anchor:t})=>{let o;for(;e&&e!==t;)o=u(e),n(e),e=o;n(t)},b=(e,t,n,o,i,r,s,a,l)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?_(t,n,o,i,r,s,a,l):x(e,t,i,r,s,a,l)},_=(e,n,r,s,a,c,u,d)=>{let p,f;const{props:h,shapeFlag:m,transition:g,dirs:v}=e;if(p=e.el=i(e.type,c,h&&h.is,h),8&m?l(p,e.children):16&m&&S(e.children,p,null,s,a,di(e,c),u,d),v&&Wn(e,null,s,"created"),w(p,e,e.scopeId,u,s),h){for(const e in h)"value"===e||ve(e)||o(p,e,null,h[e],c,s);"value"in h&&o(p,"value",null,h.value,c),(f=h.onVnodeBeforeMount)&&or(f,s,e)}v&&Wn(e,null,s,"beforeMount");const y=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(a,g);y&&g.beforeEnter(p),t(p,n,r),((f=h&&h.onVnodeMounted)||y||v)&&ci((()=>{f&&or(f,s,e),y&&g.enter(p),v&&Wn(e,null,s,"mounted")}),a)},w=(e,t,n,o,i)=>{if(n&&d(e,n),o)for(let r=0;r{for(let c=l;c{const c=t.el=e.el;let{patchFlag:u,dynamicChildren:d,dirs:p}=t;u|=16&e.patchFlag;const f=e.props||Z,h=t.props||Z;let m;if(n&&pi(n,!1),(m=h.onVnodeBeforeUpdate)&&or(m,n,t,e),p&&Wn(t,e,n,"beforeUpdate"),n&&pi(n,!0),(f.innerHTML&&null==h.innerHTML||f.textContent&&null==h.textContent)&&l(c,""),d?k(e.dynamicChildren,d,c,n,i,di(t,r),s):a||N(e,t,c,null,n,i,di(t,r),s,!1),u>0){if(16&u)C(c,f,h,n,r);else if(2&u&&f.class!==h.class&&o(c,"class",null,h.class,r),4&u&&o(c,"style",f.style,h.style,r),8&u){const e=t.dynamicProps;for(let t=0;t{m&&or(m,n,t,e),p&&Wn(t,e,n,"updated")}),i)},k=(e,t,n,o,i,r,s)=>{for(let a=0;a{if(t!==n){if(t!==Z)for(const s in t)ve(s)||s in n||o(e,s,t[s],null,r,i);for(const s in n){if(ve(s))continue;const a=n[s],l=t[s];a!==l&&"value"!==s&&o(e,s,l,a,r,i)}"value"in n&&o(e,"value",t.value,n.value,r)}},A=(e,n,o,i,s,a,l,c,u)=>{const d=n.el=e?e.el:r(""),p=n.anchor=e?e.anchor:r("");let{patchFlag:f,dynamicChildren:h,slotScopeIds:m}=n;m&&(c=c?c.concat(m):m),null==e?(t(d,o,i),t(p,o,i),S(n.children||[],o,p,s,a,l,c,u)):f>0&&64&f&&h&&e.dynamicChildren?(k(e.dynamicChildren,h,o,s,a,l,c),(null!=n.key||s&&n===s.subTree)&&fi(e,n,!0)):N(e,n,o,p,s,a,l,c,u)},E=(e,t,n,o,i,r,s,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?i.ctx.activate(t,n,o,s,l):O(t,n,o,i,r,s,l):L(e,t,l)},O=(e,t,n,o,i,r,s)=>{const a=e.component=function(e,t,n){const o=e.type,i=(t?t.appContext:e.appContext)||ir,r={uid:rr++,vnode:e,type:o,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new He(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Qo(o,i),emitsOptions:Ai(o,i),emit:null,emitted:null,propsDefaults:Z,inheritAttrs:o.inheritAttrs,ctx:Z,data:Z,props:Z,attrs:Z,slots:Z,refs:Z,setupState:Z,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};r.ctx={_:r},r.root=t?t.root:r,r.emit=Ci.bind(null,r),e.ce&&e.ce(r);return r}(e,o,i);if(Kn(e)&&(a.ctx.renderer=V),function(e,t=!1,n=!1){t&&cr(t);const{props:o,children:i}=e.vnode,r=pr(e);Yo(e,o,r,t),ri(e,i,n);const s=r?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Co);const{setup:o}=n;if(o){const n=e.setupContext=o.length>1?function(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,vr),slots:e.slots,emit:e.emit,expose:t}}(e):null,i=ur(e);tt();const r=wn(o,e,0,[e.props,n]);if(nt(),i(),de(r)){if(r.then(dr,dr),t)return r.then((n=>{mr(e,n,t)})).catch((t=>{xn(t,e,0)}));e.asyncDep=r}else mr(e,r,t)}else gr(e,t)}(e,t):void 0;t&&cr(!1)}(a,!1,s),a.asyncDep){if(i&&i.registerDep(a,T,s),!e.el){const e=a.subTree=Ki(Di);m(null,e,t,n)}}else T(a,e,t,n,i,r,s)},L=(e,t,n)=>{const o=t.component=e.component;if(function(e,t,n){const{props:o,children:i,component:r}=e,{props:s,children:a,patchFlag:l}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!i&&!a||a&&a.$stable)||o!==s&&(o?!s||Ii(o,s,c):!!s);if(1024&l)return!0;if(16&l)return o?Ii(o,s,c):!!s;if(8&l){const e=t.dynamicProps;for(let t=0;tEn&&An.splice(t,1)}(o.update),o.effect.dirty=!0,o.update()}else t.el=e.el,o.vnode=t},T=(e,t,n,o,i,r,s)=>{const a=()=>{if(e.isMounted){let{next:t,bu:n,u:o,parent:l,vnode:u}=e;{const n=hi(e);if(n)return t&&(t.el=u.el,I(e,t,s)),void n.asyncDep.then((()=>{e.isUnmounted||a()}))}let d,p=t;pi(e,!1),t?(t.el=u.el,I(e,t,s)):t=u,n&&Ae(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&or(d,l,t,u),pi(e,!0);const h=Oi(e),m=e.subTree;e.subTree=h,f(m,h,c(m.el),F(m),e,i,r),t.el=h.el,null===p&&function({vnode:e,parent:t},n){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.el=e.el),o!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,h.el),o&&ci(o,i),(d=t.props&&t.props.onVnodeUpdated)&&ci((()=>or(d,l,t,u)),i)}else{let s;const{el:a,props:l}=t,{bm:c,m:u,parent:d}=e,p=Zn(t);if(pi(e,!1),c&&Ae(c),!p&&(s=l&&l.onVnodeBeforeMount)&&or(s,d,t),pi(e,!0),a&&W){const n=()=>{e.subTree=Oi(e),W(a,e.subTree,e,i,null)};p?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const s=e.subTree=Oi(e);f(null,s,n,o,e,i,r),t.el=s.el}if(u&&ci(u,i),!p&&(s=l&&l.onVnodeMounted)){const e=t;ci((()=>or(s,d,e)),i)}(256&t.shapeFlag||d&&Zn(d.vnode)&&256&d.vnode.shapeFlag)&&e.a&&ci(e.a,i),e.isMounted=!0,t=n=o=null}},l=e.effect=new Ze(a,X,(()=>Dn(u)),e.scope),u=e.update=()=>{l.dirty&&l.run()};u.i=e,u.id=e.uid,pi(e,!0),u()},I=(e,t,n)=>{t.component=e;const o=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,o){const{props:i,attrs:r,vnode:{patchFlag:s}}=e,a=on(i),[l]=e.propsOptions;let c=!1;if(!(o||s>0)||16&s){let o;Zo(e,t,i,r)&&(c=!0);for(const r in a)t&&(oe(t,r)||(o=Se(r))!==r&&oe(t,o))||(l?!n||void 0===n[r]&&void 0===n[o]||(i[r]=Ko(l,a,r,void 0,e,!0)):delete i[r]);if(r!==a)for(const e in r)t&&oe(t,e)||(delete r[e],c=!0)}else if(8&s){const n=e.vnode.dynamicProps;for(let o=0;o{const u=e&&e.children,d=e?e.shapeFlag:0,p=t.children,{patchFlag:f,shapeFlag:h}=t;if(f>0){if(128&f)return void D(u,p,n,o,i,r,s,a,c);if(256&f)return void P(u,p,n,o,i,r,s,a,c)}8&h?(16&d&&B(u,i,r),p!==u&&l(n,p)):16&d?16&h?D(u,p,n,o,i,r,s,a,c):B(u,i,r,!0):(8&d&&l(n,""),16&h&&S(p,n,o,i,r,s,a,c))},P=(e,t,n,o,i,r,s,a,l)=>{t=t||K;const c=(e=e||K).length,u=t.length,d=Math.min(c,u);let p;for(p=0;pu?B(e,i,r,!0,!1,d):S(t,n,o,i,r,s,a,l,d)},D=(e,t,n,o,i,r,s,a,l)=>{let c=0;const u=t.length;let d=e.length-1,p=u-1;for(;c<=d&&c<=p;){const o=e[c],u=t[c]=l?er(t[c]):qi(t[c]);if(!Hi(o,u))break;f(o,u,n,null,i,r,s,a,l),c++}for(;c<=d&&c<=p;){const o=e[d],c=t[p]=l?er(t[p]):qi(t[p]);if(!Hi(o,c))break;f(o,c,n,null,i,r,s,a,l),d--,p--}if(c>d){if(c<=p){const e=p+1,d=ep)for(;c<=d;)M(e[c],i,r,!0),c++;else{const h=c,m=c,g=new Map;for(c=m;c<=p;c++){const e=t[c]=l?er(t[c]):qi(t[c]);null!=e.key&&g.set(e.key,c)}let v,y=0;const b=p-m+1;let _=!1,w=0;const S=new Array(b);for(c=0;c=b){M(o,i,r,!0);continue}let u;if(null!=o.key)u=g.get(o.key);else for(v=m;v<=p;v++)if(0===S[v-m]&&Hi(o,t[v])){u=v;break}void 0===u?M(o,i,r,!0):(S[u-m]=c+1,u>=w?w=u:_=!0,f(o,t[u],n,null,i,r,s,a,l),y++)}const x=_?function(e){const t=e.slice(),n=[0];let o,i,r,s,a;const l=e.length;for(o=0;o>1,e[n[a]]0&&(t[o]=n[r-1]),n[r]=o)}}r=n.length,s=n[r-1];for(;r-- >0;)n[r]=s,s=t[s];return n}(S):K;for(v=x.length-1,c=b-1;c>=0;c--){const e=m+c,d=t[e],p=e+1{const{el:s,type:a,transition:l,children:c,shapeFlag:u}=e;if(6&u)return void j(e.component.subTree,n,o,i);if(128&u)return void e.suspense.move(n,o,i);if(64&u)return void a.move(e,n,o,V);if(a===Ni){t(s,n,o);for(let e=0;el.enter(s)),r);else{const{leave:e,delayLeave:i,afterLeave:r}=l,a=()=>t(s,n,o),c=()=>{e(s,(()=>{a(),r&&r()}))};i?i(s,a,c):c()}else t(s,n,o)},M=(e,t,n,o=!1,i=!1)=>{const{type:r,props:s,ref:a,children:l,dynamicChildren:c,shapeFlag:u,patchFlag:d,dirs:p,cacheIndex:f}=e;if(-2===d&&(i=!1),null!=a&&ai(a,null,n,e,!0),null!=f&&(t.renderCache[f]=void 0),256&u)return void t.ctx.deactivate(e);const h=1&u&&p,m=!Zn(e);let g;if(m&&(g=s&&s.onVnodeBeforeUnmount)&&or(g,t,e),6&u)G(e.component,n,o);else{if(128&u)return void e.suspense.unmount(n,o);h&&Wn(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,V,o):c&&!c.hasOnce&&(r!==Ni||d>0&&64&d)?B(c,t,n,!1,!0):(r===Ni&&384&d||!i&&16&u)&&B(l,t,n),o&&R(e)}(m&&(g=s&&s.onVnodeUnmounted)||h)&&ci((()=>{g&&or(g,t,e),h&&Wn(e,null,t,"unmounted")}),n)},R=e=>{const{type:t,el:o,anchor:i,transition:r}=e;if(t===Ni)return void $(o,i);if(t===ji)return void y(e);const s=()=>{n(o),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){const{leave:t,delayLeave:n}=r,i=()=>t(o,s);n?n(e.el,s,i):i()}else s()},$=(e,t)=>{let o;for(;e!==t;)o=u(e),n(e),e=o;n(t)},G=(e,t,n)=>{const{bum:o,scope:i,update:r,subTree:s,um:a,m:l,a:c}=e;mi(l),mi(c),o&&Ae(o),i.stop(),r&&(r.active=!1,M(s,e,t,n)),a&&ci(a,t),ci((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},B=(e,t,n,o=!1,i=!1,r=0)=>{for(let s=r;s{if(6&e.shapeFlag)return F(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=u(e.anchor||e.el),n=t&&t[li];return n?u(n):t};let U=!1;const z=(e,t,n)=>{null==e?t._vnode&&M(t._vnode,null,null,!0):f(t._vnode||null,e,t,null,null,null,n),U||(U=!0,Mn(),Rn(),U=!1),t._vnode=e},V={p:f,um:M,m:j,r:R,mt:O,mc:S,pc:N,pbc:k,n:F,o:e};let H,W;return{render:z,hydrate:H,createApp:Fo(z,H)}}(e)}function di({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function pi({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function fi(e,t,n=!1){const o=e.children,i=t.children;if(ie(o)&&ie(i))for(let r=0;rzo(gi),yi={};function bi(e,t,n){return _i(e,t,n)}function _i(e,t,{immediate:n,deep:o,flush:i,once:r,onTrack:s,onTrigger:a}=Z){if(t&&r){const e=t;t=(...t)=>{e(...t),w()}}const l=sr,c=e=>!0===o?e:xi(e,!1===o?1:void 0);let u,d,p=!1,f=!1;if(dn(e)?(u=()=>e.value,p=tn(e)):qt(e)?(u=()=>c(e),p=!0):ie(e)?(f=!0,p=e.some((e=>qt(e)||tn(e))),u=()=>e.map((e=>dn(e)?e.value:qt(e)?c(e):ae(e)?wn(e,l,2):void 0))):u=ae(e)?t?()=>wn(e,l,2):()=>(d&&d(),Sn(e,l,3,[m])):X,t&&o){const e=u;u=()=>xi(e())}let h,m=e=>{d=b.onStop=()=>{wn(e,l,4),d=b.onStop=void 0}};if(hr){if(m=X,t?n&&Sn(t,l,3,[u(),f?[]:void 0,m]):u(),"sync"!==i)return X;{const e=vi();h=e.__watcherHandles||(e.__watcherHandles=[])}}let g=f?new Array(e.length).fill(yi):yi;const v=()=>{if(b.active&&b.dirty)if(t){const e=b.run();(o||p||(f?e.some(((e,t)=>Ce(e,g[t]))):Ce(e,g)))&&(d&&d(),Sn(t,l,3,[e,g===yi?void 0:f&&g[0]===yi?[]:g,m]),g=e)}else b.run()};let y;v.allowRecurse=!!t,"sync"===i?y=v:"post"===i?y=()=>ci(v,l&&l.suspense):(v.pre=!0,l&&(v.id=l.uid),y=()=>Dn(v));const b=new Ze(u,X,y),_=Ye(),w=()=>{b.stop(),_&&te(_.effects,b)};return t?n?v():g=b.run():"post"===i?ci(b.run.bind(b),l&&l.suspense):b.run(),h&&h.push(w),w}function wi(e,t,n){const o=this.proxy,i=le(e)?e.includes(".")?Si(o,e):()=>o[e]:e.bind(o,o);let r;ae(t)?r=t:(r=t.handler,n=t);const s=ur(this),a=_i(i,r.bind(o),n);return s(),a}function Si(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{xi(e,t,n)}));else if(me(e)){for(const o in e)xi(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&xi(e[o],t,n)}return e}const ki=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${_e(t)}Modifiers`]||e[`${Se(t)}Modifiers`];function Ci(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Z;let i=n;const r=t.startsWith("update:"),s=r&&ki(o,t.slice(7));let a;s&&(s.trim&&(i=n.map((e=>le(e)?e.trim():e))),s.number&&(i=n.map(Oe)));let l=o[a=ke(t)]||o[a=ke(_e(t))];!l&&r&&(l=o[a=ke(Se(t))]),l&&Sn(l,e,6,i);const c=o[a+"Once"];if(c){if(e.emitted){if(e.emitted[a])return}else e.emitted={};e.emitted[a]=!0,Sn(c,e,6,i)}}function Ai(e,t,n=!1){const o=t.emitsCache,i=o.get(e);if(void 0!==i)return i;const r=e.emits;let s={},a=!1;if(!ae(e)){const o=e=>{const n=Ai(e,t,!0);n&&(a=!0,ee(s,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return r||a?(ie(r)?r.forEach((e=>s[e]=null)):ee(s,r),ue(e)&&o.set(e,s),s):(ue(e)&&o.set(e,null),null)}function Ei(e,t){return!(!e||!J(t))&&(t=t.slice(2).replace(/Once$/,""),oe(e,t[0].toLowerCase()+t.slice(1))||oe(e,Se(t))||oe(e,t))}function Oi(e){const{type:t,vnode:n,proxy:o,withProxy:i,propsOptions:[r],slots:s,attrs:a,emit:l,render:c,renderCache:u,props:d,data:p,setupState:f,ctx:h,inheritAttrs:m}=e,g=zn(e);let v,y;try{if(4&n.shapeFlag){const e=i||o,t=e;v=qi(c.call(t,e,u,d,f,p,h)),y=a}else{const e=t;0,v=qi(e.length>1?e(d,{attrs:a,slots:s,emit:l}):e(d,null)),y=t.props?a:Li(a)}}catch(_){Mi.length=0,xn(_,e,1),v=Ki(Di)}let b=v;if(y&&!1!==m){const e=Object.keys(y),{shapeFlag:t}=b;e.length&&7&t&&(r&&e.some(q)&&(y=Ti(y,r)),b=Xi(b,y,!1,!0))}return n.dirs&&(b=Xi(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&(b.transition=n.transition),v=b,zn(g),v}const Li=e=>{let t;for(const n in e)("class"===n||"style"===n||J(n))&&((t||(t={}))[n]=e[n]);return t},Ti=(e,t)=>{const n={};for(const o in e)q(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function Ii(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let i=0;i0?Ri||K:null,Mi.pop(),Ri=Mi[Mi.length-1]||null,Gi>0&&Ri&&Ri.push(e),e}function Ui(e,t,n,o,i,r){return Fi(Zi(e,t,n,o,i,r,!0))}function zi(e,t,n,o,i){return Fi(Ki(e,t,n,o,i,!0))}function Vi(e){return!!e&&!0===e.__v_isVNode}function Hi(e,t){return e.type===t.type&&e.key===t.key}const Wi=({key:e})=>null!=e?e:null,Yi=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?le(e)||dn(e)||ae(e)?{i:Fn,r:e,k:t,f:!!n}:e:null);function Zi(e,t=null,n=null,o=0,i=null,r=(e===Ni?0:1),s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Wi(t),ref:t&&Yi(t),scopeId:Un,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:o,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Fn};return a?(tr(l,n),128&r&&e.normalize(l)):n&&(l.shapeFlag|=le(n)?8:16),Gi>0&&!s&&Ri&&(l.patchFlag>0||6&r)&&32!==l.patchFlag&&Ri.push(l),l}const Ki=function(e,t=null,n=null,o=0,i=null,r=!1){e&&e!==go||(e=Di);if(Vi(e)){const o=Xi(e,t,!0);return n&&tr(o,n),Gi>0&&!r&&Ri&&(6&o.shapeFlag?Ri[Ri.indexOf(e)]=o:Ri.push(o)),o.patchFlag=-2,o}s=e,ae(s)&&"__vccOpts"in s&&(e=e.__vccOpts);var s;if(t){t=function(e){return e?nn(e)||Wo(e)?ee({},e):e:null}(t);let{class:e,style:n}=t;e&&!le(e)&&(t.class=Me(e)),ue(n)&&(nn(n)&&!ie(n)&&(n=ee({},n)),t.style=Ie(n))}const a=le(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:ue(e)?4:ae(e)?2:0;return Zi(e,t,n,o,i,a,r,!0)};function Xi(e,t,n=!1,o=!1){const{props:i,ref:r,patchFlag:s,children:a,transition:l}=e,c=t?nr(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Wi(c),ref:t&&t.ref?n&&r?ie(r)?r.concat(Yi(t)):[r,Yi(t)]:Yi(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ni?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Xi(e.ssContent),ssFallback:e.ssFallback&&Xi(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&o&&Yn(u,l.clone(u)),u}function Qi(e=" ",t=0){return Ki(Pi,null,e,t)}function Ji(e="",t=!1){return t?($i(),zi(Di,null,e)):Ki(Di,null,e)}function qi(e){return null==e||"boolean"==typeof e?Ki(Di):ie(e)?Ki(Ni,null,e.slice()):"object"==typeof e?er(e):Ki(Pi,null,String(e))}function er(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Xi(e)}function tr(e,t){let n=0;const{shapeFlag:o}=e;if(null==t)t=null;else if(ie(t))n=16;else if("object"==typeof t){if(65&o){const n=t.default;return void(n&&(n._c&&(n._d=!1),tr(e,n()),n._c&&(n._d=!0)))}{n=32;const o=t._;o||Wo(t)?3===o&&Fn&&(1===Fn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=Fn}}else ae(t)?(t={default:t,_ctx:Fn},n=32):(t=String(t),64&o?(n=16,t=[Qi(t)]):n=8);e.children=t,e.shapeFlag|=n}function nr(...e){const t={};for(let n=0;nsr||Fn;let lr,cr;{const e=Te(),t=(t,n)=>{let o;return(o=e[t])||(o=e[t]=[]),o.push(n),e=>{o.length>1?o.forEach((t=>t(e))):o[0](e)}};lr=t("__VUE_INSTANCE_SETTERS__",(e=>sr=e)),cr=t("__VUE_SSR_SETTERS__",(e=>hr=e))}const ur=e=>{const t=sr;return lr(e),e.scope.on(),()=>{e.scope.off(),lr(t)}},dr=()=>{sr&&sr.scope.off(),lr(null)};function pr(e){return 4&e.vnode.shapeFlag}let fr,hr=!1;function mr(e,t,n){ae(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ue(t)&&(e.setupState=gn(t)),gr(e,n)}function gr(e,t,n){const o=e.type;if(!e.render){if(!t&&fr&&!o.render){const t=o.template||Io(e).template;if(t){const{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:r,compilerOptions:s}=o,a=ee(ee({isCustomElement:n,delimiters:r},i),s);o.render=fr(t,a)}}e.render=o.render||X}{const t=ur(e);tt();try{Oo(e)}finally{nt(),t()}}}const vr={get:(e,t)=>(pt(e,0,""),e[t])};function yr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(gn(rn(e.exposed)),{get:(t,n)=>n in t?t[n]:n in xo?xo[n](e):void 0,has:(e,t)=>t in e||t in xo})):e.proxy}function br(e,t=!0){return ae(e)?e.displayName||e.name:e.name||t&&e.__name}const _r=(e,t)=>{const n=function(e,t,n=!1){let o,i;const r=ae(e);return r?(o=e,i=X):(o=e.get,i=e.set),new ln(o,i,r||!i,n)}(e,0,hr);return n};const wr="3.4.36",Sr="undefined"!=typeof document?document:null,xr=Sr&&Sr.createElement("template"),kr={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const i="svg"===t?Sr.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?Sr.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?Sr.createElement(e,{is:n}):Sr.createElement(e);return"select"===e&&o&&null!=o.multiple&&i.setAttribute("multiple",o.multiple),i},createText:e=>Sr.createTextNode(e),createComment:e=>Sr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Sr.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,i,r){const s=n?n.previousSibling:t.lastChild;if(i&&(i===r||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==r&&(i=i.nextSibling););else{xr.innerHTML="svg"===o?`${e}`:"mathml"===o?`${e}`:e;const i=xr.content;if("svg"===o||"mathml"===o){const e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Cr=Symbol("_vtc"); +/** +* @vue/runtime-dom v3.4.36 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const Ar=Symbol("_vod"),Er=Symbol("_vsh"),Or=Symbol(""),Lr=/(^|;)\s*display\s*:/;const Tr=/\s*!important$/;function Ir(e,t,n){if(ie(n))n.forEach((n=>Ir(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=Pr[t];if(n)return n;let o=_e(t);if("filter"!==o&&o in e)return Pr[t]=o;o=xe(o);for(let i=0;i{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();Sn(function(e,t){if(ie(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Ur(),n}(o,i);Mr(e,n,s,a)}else s&&(!function(e,t,n,o){e.removeEventListener(t,n,o)}(e,n,s,a),r[t]=void 0)}}const Gr=/(?:Once|Passive|Capture)$/;let Br=0;const Fr=Promise.resolve(),Ur=()=>Br||(Fr.then((()=>Br=0)),Br=Date.now());const zr=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;const Vr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ie(t)?e=>Ae(t,e):t};function Hr(e){e.target.composing=!0}function Wr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Yr=Symbol("_assign"),Zr={created(e,{modifiers:{lazy:t,trim:n,number:o}},i){e[Yr]=Vr(i);const r=o||i.props&&"number"===i.props.type;Mr(e,t?"change":"input",(t=>{if(t.target.composing)return;let o=e.value;n&&(o=o.trim()),r&&(o=Oe(o)),e[Yr](o)})),n&&Mr(e,"change",(()=>{e.value=e.value.trim()})),t||(Mr(e,"compositionstart",Hr),Mr(e,"compositionend",Wr),Mr(e,"change",Wr))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:i,number:r}},s){if(e[Yr]=Vr(s),e.composing)return;const a=null==t?"":t;if((!r&&"number"!==e.type||/^0\d/.test(e.value)?e.value:Oe(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(o&&t===n)return;if(i&&e.value.trim()===a)return}e.value=a}}},Kr=["ctrl","shift","alt","meta"],Xr={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Kr.some((n=>e[`${n}Key`]&&!t.includes(n)))},Qr=(e,t)=>{const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(n,...o)=>{for(let e=0;e{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=n=>{if(!("key"in n))return;const o=Se(n.key);return t.some((e=>e===o||Jr[e]===o))?e(n):void 0})},es=ee({patchProp:(e,t,n,o,i,r)=>{const s="svg"===i;"class"===t?function(e,t,n){const o=e[Cr];o&&(t=(t?[t,...o]:[...o]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,o,s):"style"===t?function(e,t,n){const o=e.style,i=le(n);let r=!1;if(n&&!i){if(t)if(le(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&Ir(o,t,"")}else for(const e in t)null==n[e]&&Ir(o,e,"");for(const e in n)"display"===e&&(r=!0),Ir(o,e,n[e])}else if(i){if(t!==n){const e=o[Or];e&&(n+=";"+e),o.cssText=n,r=Lr.test(n)}}else t&&e.removeAttribute("style");Ar in e&&(e[Ar]=r?o.display:"",e[Er]&&(o.display="none"))}(e,n,o):J(t)?q(t)||$r(e,t,0,o,r):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,o){if(o)return"innerHTML"===t||"textContent"===t||!!(t in e&&zr(t)&&ae(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}if(zr(t)&&le(n))return!1;return t in e}(e,t,o,s))?(!function(e,t,n){if("innerHTML"===t||"textContent"===t){if(null==n)return;return void(e[t]=n)}const o=e.tagName;if("value"===t&&"PROGRESS"!==o&&!o.includes("-")){const i="OPTION"===o?e.getAttribute("value")||"":e.value,r=null==n?"":String(n);return i===r&&"_value"in e||(e.value=r),null==n&&e.removeAttribute(t),void(e._value=n)}let i=!1;if(""===n||null==n){const o=typeof e[t];"boolean"===o?n=$e(n):null==n&&"string"===o?(n="",i=!0):"number"===o&&(n=0,i=!0)}try{e[t]=n}catch(r){}i&&e.removeAttribute(t)}(e,t,o),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||jr(e,t,o,s,0,"value"!==t)):("true-value"===t?e._trueValue=o:"false-value"===t&&(e._falseValue=o),jr(e,t,o,s))}},kr);let ts;function ns(){return ts||(ts=ui(es))} +/*! + * pinia v2.2.1 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */ +let os;const is=e=>os=e,rs=Symbol();function ss(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var as,ls;(ls=as||(as={})).direct="direct",ls.patchObject="patch object",ls.patchFunction="patch function";const cs=()=>{};function us(e,t,n,o=cs){e.push(t);const i=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),o())};var r;return!n&&Ye()&&(r=i,ze&&ze.cleanups.push(r)),i}function ds(e,...t){e.slice().forEach((e=>{e(...t)}))}const ps=e=>e(),fs=Symbol(),hs=Symbol();function ms(e,t){e instanceof Map&&t instanceof Map?t.forEach(((t,n)=>e.set(n,t))):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const o=t[n],i=e[n];ss(i)&&ss(o)&&e.hasOwnProperty(n)&&!dn(o)&&!qt(o)?e[n]=ms(i,o):e[n]=o}return e}const gs=Symbol();const{assign:vs}=Object;function ys(e,t,n,o){const{state:i,actions:r,getters:s}=t,a=n.state.value[e];let l;return l=bs(e,(function(){a||(n.state.value[e]=i?i():{});const t=function(e){const t=ie(e)?new Array(e.length):{};for(const n in e)t[n]=_n(e,n);return t}(n.state.value[e]);return vs(t,r,Object.keys(s||{}).reduce(((t,o)=>(t[o]=rn(_r((()=>{is(n);const t=n._s.get(e);return s[o].call(t,t)}))),t)),{}))}),t,n,o,!0),l}function bs(e,t,n={},o,i,r){let s;const a=vs({actions:{}},n),l={deep:!0};let c,u,d,p=[],f=[];const h=o.state.value[e];let m;function g(t){let n;c=u=!1,"function"==typeof t?(t(o.state.value[e]),n={type:as.patchFunction,storeId:e,events:d}):(ms(o.state.value[e],t),n={type:as.patchObject,payload:t,storeId:e,events:d});const i=m=Symbol();Pn().then((()=>{m===i&&(c=!0)})),u=!0,ds(p,n,o.state.value[e])}r||h||(o.state.value[e]={}),pn({});const v=r?function(){const{state:e}=n,t=e?e():{};this.$patch((e=>{vs(e,t)}))}:cs;const y=(t,n="")=>{if(fs in t)return t[hs]=n,t;const i=function(){is(o);const n=Array.from(arguments),r=[],s=[];let a;ds(f,{args:n,name:i[hs],store:b,after:function(e){r.push(e)},onError:function(e){s.push(e)}});try{a=t.apply(this&&this.$id===e?this:b,n)}catch(l){throw ds(s,l),l}return a instanceof Promise?a.then((e=>(ds(r,e),e))).catch((e=>(ds(s,e),Promise.reject(e)))):(ds(r,a),a)};return i[fs]=!0,i[hs]=n,i},b=Xt({_p:o,$id:e,$onAction:us.bind(null,f),$patch:g,$reset:v,$subscribe(t,n={}){const i=us(p,t,n.detached,(()=>r())),r=s.run((()=>bi((()=>o.state.value[e]),(o=>{("sync"===n.flush?u:c)&&t({storeId:e,type:as.direct,events:d},o)}),vs({},l,n))));return i},$dispose:function(){s.stop(),p=[],f=[],o._s.delete(e)}});o._s.set(e,b);const _=(o._a&&o._a.runWithContext||ps)((()=>o._e.run((()=>(s=We()).run((()=>t({action:y})))))));for(const x in _){const t=_[x];if(dn(t)&&(!dn(S=t)||!S.effect)||qt(t))r||(!h||ss(w=t)&&w.hasOwnProperty(gs)||(dn(t)?t.value=h[x]:ms(t,h[x])),o.state.value[e][x]=t);else if("function"==typeof t){const e=y(t,x);_[x]=e,a.actions[x]=t}}var w,S;return vs(b,_),vs(on(b),_),Object.defineProperty(b,"$state",{get:()=>o.state.value[e],set:e=>{g((t=>{vs(t,e)}))}}),o._p.forEach((e=>{vs(b,s.run((()=>e({store:b,app:o._a,pinia:o,options:a}))))})),h&&r&&n.hydrate&&n.hydrate(b.$state,h),c=!0,u=!0,b}function _s(e,t,n){let o,i;const r="function"==typeof t;function s(e,n){(e=e||(!!(sr||Fn||Uo)?zo(rs,null):null))&&is(e),(e=os)._s.has(o)||(r?bs(o,t,i,e):ys(o,i,e));return e._s.get(o)}return"string"==typeof e?(o=e,i=r?n:t):(i=e,o=e.id),s.$id=o,s}function ws(e){{e=on(e);const t={};for(const n in e){const o=e[n];(dn(o)||qt(o))&&(t[n]=bn(e,n))}return t}}var Ss="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ks=function(){this.__data__=[],this.size=0};var Cs=function(e,t){return e===t||e!=e&&t!=t},As=Cs;var Es=function(e,t){for(var n=e.length;n--;)if(As(e[n][0],t))return n;return-1},Os=Es,Ls=Array.prototype.splice;var Ts=Es;var Is=Es;var Ns=Es;var Ps=ks,Ds=function(e){var t=this.__data__,n=Os(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ls.call(t,n,1),--this.size,!0)},js=function(e){var t=this.__data__,n=Ts(t,e);return n<0?void 0:t[n][1]},Ms=function(e){return Is(this.__data__,e)>-1},Rs=function(e,t){var n=this.__data__,o=Ns(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this};function $s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},ec=sa,tc=ql,nc=Il,oc={};oc["[object Float32Array]"]=oc["[object Float64Array]"]=oc["[object Int8Array]"]=oc["[object Int16Array]"]=oc["[object Int32Array]"]=oc["[object Uint8Array]"]=oc["[object Uint8ClampedArray]"]=oc["[object Uint16Array]"]=oc["[object Uint32Array]"]=!0,oc["[object Arguments]"]=oc["[object Array]"]=oc["[object ArrayBuffer]"]=oc["[object Boolean]"]=oc["[object DataView]"]=oc["[object Date]"]=oc["[object Error]"]=oc["[object Function]"]=oc["[object Map]"]=oc["[object Number]"]=oc["[object Object]"]=oc["[object RegExp]"]=oc["[object Set]"]=oc["[object String]"]=oc["[object WeakMap]"]=!1;var ic=function(e){return nc(e)&&tc(e.length)&&!!oc[ec(e)]};var rc=function(e){return function(t){return e(t)}},sc={exports:{}};!function(e,t){var n=Hs,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,r=i&&i.exports===o&&n.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||r&&r.binding&&r.binding("util")}catch(t){}}();e.exports=s}(sc,sc.exports);var ac=sc.exports,lc=ic,cc=rc,uc=ac&&ac.isTypedArray,dc=uc?cc(uc):lc,pc=Tl,fc=Yl,hc=Zl,mc=Xl,gc=Jl,vc=dc,yc=Object.prototype.hasOwnProperty;var bc=function(e,t){var n=hc(e),o=!n&&fc(e),i=!n&&!o&&mc(e),r=!n&&!o&&!i&&vc(e),s=n||o||i||r,a=s?pc(e.length,String):[],l=a.length;for(var c in e)!t&&!yc.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||gc(c,l))||a.push(c);return a},_c=Object.prototype;var wc=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_c)};var Sc=function(e,t){return function(n){return e(t(n))}},xc=Sc(Object.keys,Object),kc=wc,Cc=xc,Ac=Object.prototype.hasOwnProperty;var Ec=da,Oc=ql;var Lc=function(e){return null!=e&&Oc(e.length)&&!Ec(e)},Tc=bc,Ic=function(e){if(!kc(e))return Cc(e);var t=[];for(var n in Object(e))Ac.call(e,n)&&"constructor"!=n&&t.push(n);return t},Nc=Lc;var Pc=function(e){return Nc(e)?Tc(e):Ic(e)},Dc=Ll,jc=Pc;var Mc=function(e,t){return e&&Dc(t,jc(t),e)};var Rc=aa,$c=wc,Gc=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Bc=Object.prototype.hasOwnProperty;var Fc=bc,Uc=function(e){if(!Rc(e))return Gc(e);var t=$c(e),n=[];for(var o in e)("constructor"!=o||!t&&Bc.call(e,o))&&n.push(o);return n},zc=Lc;var Vc=function(e){return zc(e)?Fc(e,!0):Uc(e)},Hc=Ll,Wc=Vc;var Yc=function(e,t){return e&&Hc(t,Wc(t),e)},Zc={exports:{}};!function(e,t){var n=Zs,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,r=i&&i.exports===o?n.Buffer:void 0,s=r?r.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,o=s?s(n):new e.constructor(n);return e.copy(o),o}}(Zc,Zc.exports);var Kc=Zc.exports;var Xc=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n({groups:[],nodes:[]}),getters:{groups_nodes(){var e;let t=[],n=[];if((null==(e=this.nodes)?void 0:e.length)>0){this.nodes.map((e=>{let o=e.pos,i=!1;for(let n=0;nr.pos[0]&&o[0]r.pos[1]&&o[1]e.pos[0]-t.pos[0])).sort(((e,t)=>e.pos[1]-t.pos[1])))},setNodes(e){this.nodes=tp(e)},update(){y.extensionManager.activeSidebarTab===M&&setTimeout((e=>{this.setGroups(y.canvas.graph._groups),this.setNodes(y.canvas.graph._nodes)}),1)},watchGraph(){let e=this;this.update();const t=y.graph.onNodeAdded;y.graph.onNodeAdded=function(n){e.update();const o=n.onRemoved;return n.onRemoved=function(){return e.update(),null==o?void 0:o.apply(this,arguments)},null==t?void 0:t.apply(this,arguments)},y.canvas.onNodeMoved=function(t){e.update()};const n=LGraphCanvas.onNodeAlign;LGraphCanvas.onNodeAlign=function(t){return e.update(),null==n?void 0:n.apply(this,arguments)};const o=LGraphCanvas.onGroupAdd;LGraphCanvas.onGroupAdd=function(){return e.update(),null==o?void 0:o.apply(this,arguments)};const i=LGraphCanvas.onGroupAlign;LGraphCanvas.onGroupAlign=function(t){return e.update(),null==i?void 0:i.apply(this,arguments)};const r=LGraphCanvas.onMenuNodeRemove;LGraphCanvas.onMenuNodeRemove=function(t){return e.update(),null==r?void 0:r.apply(this,arguments)}}}});let op=null;const ip=["custom_obsidian","custom_obsidian_dark","custom_milk_white"],rp={"easy positive":"green","easy negative":"red","easy promptList":"cyan","easy promptLine":"cyan","easy promptConcat":"cyan","easy promptReplace":"cyan","easy textSwitch":"pale_blue"};let sp=LGraphCanvas.node_colors,ap=null,lp=null,cp=null,up=null;for(let by in H)dp=H[by],y.ui.settings.addSetting(dp);var dp;function pp(e,t=!1){let n="after",o="before";t&&([o,n]=[n,o]),e.label=(e.label??e.name).replace(o,n),e.name=e.label}function fp(e,t,n,o,i,r,s){t.strokeStyle=o,t.fillStyle=i;let a=LiteGraph.NODE_TITLE_HEIGHT,l=this.ds.scale<.5,c=e._shape||e.constructor.shape||LiteGraph.ROUND_SHAPE,u=e.constructor.title_mode,d=!0;u==LiteGraph.TRANSPARENT_TITLE||u==LiteGraph.NO_TITLE?d=!1:u==LiteGraph.AUTOHIDE_TITLE&&mouse_over&&(d=!0);let p=new Float32Array(4);p=[0,d?-a:0,n[0]+1,d?n[1]+a:n[1]];let f=t.globalAlpha;if(t.lineWidth=1,t.beginPath(),c==LiteGraph.BOX_SHAPE||l?t.fillRect(p[0],p[1],p[2],p[3]):c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CARD_SHAPE?t.roundRect(p[0],p[1],p[2],p[3],c==LiteGraph.CARD_SHAPE?[this.round_radius,this.round_radius,0,0]:[this.round_radius]):c==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*n[0],.5*n[1],.5*n[0],0,2*Math.PI),t.strokeStyle=LiteGraph.WIDGET_OUTLINE_COLOR,t.stroke(),t.strokeStyle=o,t.fill(),!e.flags.collapsed&&d&&(t.shadowColor="transparent",t.fillStyle="rgba(0,0,0,0.2)",t.fillRect(0,-1,p[2],2)),t.shadowColor="transparent",e.onDrawBackground&&e.onDrawBackground(t,this,this.canvas,this.graph_mouse),d||u==LiteGraph.TRANSPARENT_TITLE){const i="dark"==function(e){let t=e.replace("#","");return n=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16),.299*n+.587*o+.114*i>127.5?"light":"dark";var n,o,i}((null==e?void 0:e.color)||"#ffffff");if(e.onDrawTitleBar)e.onDrawTitleBar(t,a,n,this.ds.scale,o);else if(u!=LiteGraph.TRANSPARENT_TITLE&&(e.constructor.title_color||this.render_title_colored)){let i=e.constructor.title_color||o;if(e.flags.collapsed&&(t.shadowColor=LiteGraph.DEFAULT_SHADOW_COLOR),this.use_gradients){let e=LGraphCanvas.gradients[i];e||(e=LGraphCanvas.gradients[i]=t.createLinearGradient(0,0,400,0),e.addColorStop(0,i),e.addColorStop(1,"#000")),t.fillStyle=e}else t.fillStyle=i;t.beginPath(),c==LiteGraph.BOX_SHAPE||l?t.rect(0,-a,n[0]+1,a):c!=LiteGraph.ROUND_SHAPE&&c!=LiteGraph.CARD_SHAPE||t.roundRect(0,-a,n[0]+1,a,e.flags.collapsed?[this.round_radius]:[this.round_radius,this.round_radius,0,0]),t.fill(),t.shadowColor="transparent"}let s=!1;LiteGraph.node_box_coloured_by_mode&&LiteGraph.NODE_MODES_COLORS[e.mode]&&(s=LiteGraph.NODE_MODES_COLORS[e.mode]),LiteGraph.node_box_coloured_when_on&&(s=e.action_triggered?"#FFF":e.execute_triggered?"#AAA":s);let d=10;if(e.onDrawTitleBox)e.onDrawTitleBox(t,a,n,this.ds.scale);else if(c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CIRCLE_SHAPE||c==LiteGraph.CARD_SHAPE){const n=i?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR,o=i?"#eeeeee":e.boxcolor||s||LiteGraph.NODE_DEFAULT_BOXCOLOR;t.fillStyle=r?n:o,t.beginPath(),t.fillRect(10,0-1.05*d-1,1.1*d,.125*d),t.fillRect(10,0-1.45*d-1,1.1*d,.125*d),t.fillRect(10,0-1.85*d-1,1.1*d,.125*d)}else t.fillStyle=e.boxcolor||s||LiteGraph.NODE_DEFAULT_BOXCOLOR,t.fillRect(.5*(a-d),-.5*(a+d),d,d);if(t.globalAlpha=f,e.onDrawTitleText&&e.onDrawTitleText(t,a,n,this.ds.scale,this.title_text_font,r),!l){t.font=this.title_text_font;let n=String(e.getTitle());n&&(t.fillStyle=r?i?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR:i?"#ffffff":e.constructor.title_text_color||this.node_title_color,e.flags.collapsed?(t.textAlign="left",t.measureText(n),t.fillText(n.substr(0,20),a,LiteGraph.NODE_TITLE_TEXT_Y-a),t.textAlign="left"):(t.textAlign="left",t.fillText(n,a,LiteGraph.NODE_TITLE_TEXT_Y-a)))}if(!e.flags.collapsed&&e.subgraph&&!e.skip_subgraph_button){let n=LiteGraph.NODE_TITLE_HEIGHT,o=e.size[0]-n,i=LiteGraph.isInsideRectangle(this.graph_mouse[0]-e.pos[0],this.graph_mouse[1]-e.pos[1],o+2,2-n,n-4,n-4);t.fillStyle=i?"#888":"#555",c==LiteGraph.BOX_SHAPE||l?t.fillRect(o+2,2-n,n-4,n-4):(t.beginPath(),t.roundRect(o+2,2-n,n-4,n-4,[4]),t.fill()),t.fillStyle="#333",t.beginPath(),t.moveTo(o+.2*n,.6*-n),t.lineTo(o+.8*n,.6*-n),t.lineTo(o+.5*n,.3*-n),t.fill()}e.onDrawTitle&&e.onDrawTitle(t)}if(r){e.onBounding&&e.onBounding(p),u==LiteGraph.TRANSPARENT_TITLE&&(p[1]-=a,p[3]+=a),t.lineWidth=2,t.globalAlpha=.8,t.beginPath();let i=0,r=0,s=1;c==LiteGraph.BOX_SHAPE?t.rect(i+p[0],i+p[1],r+p[2],r+p[3]):c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CARD_SHAPE&&e.flags.collapsed?t.roundRect(i+p[0],i+p[1],r+p[2],r+p[3],[this.round_radius*s]):c==LiteGraph.CARD_SHAPE?t.roundRect(i+p[0],i+p[1],r+p[2],r+p[3],[this.round_radius*s,s,this.round_radius*s,s]):c==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*n[0],.5*n[1],.5*n[0]+6,0,2*Math.PI),t.strokeStyle=LiteGraph.NODE_BOX_OUTLINE_COLOR,t.stroke(),t.strokeStyle=o,t.globalAlpha=1}e.execute_triggered>0&&e.execute_triggered--,e.action_triggered>0&&e.action_triggered--}function hp(e,t,n,o){if(!e.widgets||!e.widgets.length)return 0;let i=e.size[0],r=e.widgets;t+=2;let s=LiteGraph.NODE_WIDGET_HEIGHT,a=this.ds.scale>.5;n.save(),n.globalAlpha=this.editor_alpha;let l=LiteGraph.WIDGET_OUTLINE_COLOR,c=LiteGraph.WIDGET_BGCOLOR,u=LiteGraph.WIDGET_TEXT_COLOR,d=LiteGraph.WIDGET_SECONDARY_TEXT_COLOR,p=12;for(let f=0;f1&&(i=1),n.fillStyle=h.options.hasOwnProperty("slider_color")?h.options.slider_color:o==h?l:I,n.beginPath(),n.roundRect(p,m,i*(g-24),s,[.25*s]),n.fill(),h.marker){let e=(h.marker-h.options.min)/t;e<0&&(e=0),e>1&&(e=1),n.fillStyle=h.options.hasOwnProperty("marker_color")?h.options.marker_color:"#AA9",n.roundRect(p+e*(g-24),m,2,s,[.25*s])}if(a){n.textAlign="center",n.fillStyle=u;let e=(h.label||h.name)+": "+Number(h.value).toFixed(null!=h.options.precision?h.options.precision:3).toString();n.fillText(e,.5*g,m+.7*s)}break;case"number":case"combo":if(n.textAlign="left",n.strokeStyle=l,n.fillStyle=c,n.beginPath(),a?n.roundRect(p,m,g-24,s,[.25*s]):n.rect(p,m,g-24,s),n.fill(),a){h.disabled||n.stroke(),n.fillStyle=u,h.disabled||(n.beginPath(),n.moveTo(24,m+6.5),n.lineTo(18,m+.5*s),n.lineTo(24,m+s-6.5),n.fill(),n.beginPath(),n.moveTo(g-p-12,m+6.5),n.lineTo(g-p-6,m+.5*s),n.lineTo(g-p-12,m+s-6.5),n.fill()),n.fillStyle=d,n.font="10px Inter",n.fillText(h.label||h.name,29,m+.7*s),n.fillStyle=u,n.textAlign="right";let e=6;if("number"==h.type)n.font="10px Inter",n.fillText(Number(h.value).toFixed(void 0!==h.options.precision?h.options.precision:3),g-24-e,m+.7*s);else{let t=h.value;if(h.options.values){let e=h.options.values;e.constructor===Function&&(e=e()),e&&e.constructor!==Array&&(t=e[h.value])}n.fillText(t,g-24-e,m+.7*s)}}break;case"string":case"text":if(n.textAlign="left",n.strokeStyle=l,n.fillStyle=c,n.beginPath(),a?n.roundRect(p,m,g-24,s,[.25*s]):n.rect(p,m,g-24,s),n.fill(),a){h.disabled||n.stroke(),n.save(),n.beginPath(),n.rect(p,m,g-24,s),n.clip(),n.fillStyle=d;const e=h.label||h.name;n.font="10px Inter",null!=e&&n.fillText(e,24,m+.7*s),n.fillStyle=u,n.textAlign="right",n.fillText(String(h.value).substr(0,30),g-24,m+.7*s),n.restore()}break;default:h.draw&&h.draw(n,e,g,m,s)}t+=(h.computeSize?h.computeSize(g)[1]:s)+4,n.globalAlpha=this.editor_alpha}n.restore(),n.textAlign="left"}function mp(e,t,n,o,i){return new LiteGraph.ContextMenu(LiteGraph.NODE_MODES,{event:n,callback:function(e){if(!i)return;var t=Object.values(LiteGraph.NODE_MODES).indexOf(e),n=function(e){t>=0&&LiteGraph.NODE_MODES[t]?e.changeMode(t):e.changeMode(LiteGraph.ALWAYS),op||(op=np()),op.update()},o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)n(i);else for(var r in o.selected_nodes)n(o.selected_nodes[r])},parentMenu:o,node:i}),!1}function gp(e,t,n,o,i){if(!i)throw"no node for color";var r=[];for(var s in r.push({value:null,content:"No color"}),LGraphCanvas.node_colors){var a=LGraphCanvas.node_colors[s];e={value:s,content:""+s+""};r.push(e)}return new LiteGraph.ContextMenu(r,{event:n,callback:function(e){if(!i)return;var t=e.value?LGraphCanvas.node_colors[e.value]:null,n=function(e){t?e.constructor===LiteGraph.LGraphGroup?e.color=t.groupcolor:(e.color=t.color,e.bgcolor=t.bgcolor):(delete e.color,delete e.bgcolor),op||(op=np()),op.update()},o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)n(i);else for(var r in o.selected_nodes)n(o.selected_nodes[r]);i.setDirtyCanvas(!0,!0)},parentMenu:o,node:i}),!1}function vp(e,t,n,o,i){var r=e.property||"title",s=i[r],a=document.createElement("div");a.is_modified=!1,a.className="graphdialog",a.innerHTML="",a.close=function(){a.parentNode&&a.parentNode.removeChild(a)},a.querySelector(".name").innerText=r;var l=a.querySelector(".value");l&&(l.value=s,l.addEventListener("blur",(function(e){this.focus()})),l.addEventListener("keydown",(function(e){if(a.is_modified=!0,27==e.keyCode)a.close();else if(13==e.keyCode)h();else if(13!=e.keyCode&&"textarea"!=e.target.localName)return;e.preventDefault(),e.stopPropagation()})));var c=LGraphCanvas.active_canvas.canvas,u=c.getBoundingClientRect(),d=-20,p=-20;u&&(d-=u.left,p-=u.top),event?(a.style.left=event.clientX+d+"px",a.style.top=event.clientY+p+"px"):(a.style.left=.5*c.width+d+"px",a.style.top=.5*c.height+p+"px"),a.querySelector("button").addEventListener("click",h),c.parentNode.appendChild(a),l&&l.focus();var f=null;function h(){l&&function(t){"Number"==e.type?t=Number(t):"Boolean"==e.type&&(t=Boolean(t));i[r]=t,a.parentNode&&a.parentNode.removeChild(a);i.setDirtyCanvas(!0,!0),op||(op=np());op.update()}(l.value)}a.addEventListener("mouseleave",(function(e){LiteGraph.dialog_close_on_mouse_leave&&!a.is_modified&&LiteGraph.dialog_close_on_mouse_leave&&(f=setTimeout(a.close,LiteGraph.dialog_close_on_mouse_leave_delay))})),a.addEventListener("mouseenter",(function(e){LiteGraph.dialog_close_on_mouse_leave&&f&&clearTimeout(f)}))}y.registerExtension({name:"Comfy.EasyUse.UI",init(){var e,t;const n="Comfy.CustomColorPalettes",o="Comfy.Settings.Comfy.CustomColorPalettes";if(lp||(lp=A(n,o)),cp||(cp=A("Comfy.ColorPalette","Comfy.Settings.Comfy.ColorPalette")||"dark"),(!(null==(e=null==lp?void 0:lp.obsidian)?void 0:e.version)||lp.obsidian.version<$.ColorPalette.version)&&(lp.obsidian=$.ColorPalette,lp.obsidian_dark=G.ColorPalette,E(n,lp,o)),(!(null==(t=null==lp?void 0:lp.milk_white)?void 0:t.version)||lp.milk_white.version{(null==e?void 0:e.value)&&(null==e?void 0:e.oldValue)&&(await W(1),Object.assign(y.canvas.default_connection_color_byType,N),Object.assign(LGraphCanvas.link_type_colors,N)),"custom_milk_white"==e.value&&document.body.classList.remove(T)})),setTimeout((e=>bp(A("Comfy.UseNewMenu")||"Disabled")),1)},async nodeCreated(e){var t;if(rp.hasOwnProperty(e.comfyClass)){const t=rp[e.comfyClass],n=sp[t];if(!n)return;n.color&&(e.color=n.color),n.bgcolor&&(e.bgcolor=n.bgcolor)}if(ap||(ap=A("Comfy.WidgetControlMode")),"before"==ap){const n="before"==ap;if((null==(t=e.widgets)?void 0:t.length)>0)for(const t of e.widgets)if(["control_before_generate","control_after_generate"].includes(t.name)&&(await pp(t,n),t.linkedWidgets))for(const e of t.linkedWidgets)await pp(e,n)}}});const yp=null==(h=y.ui.settings.settingsLookup)?void 0:h["Comfy.UseNewMenu"];yp&&(yp.onChange=e=>bp(e));const bp=e=>{var t;const n=(null==(t=document.getElementById("crystools-root"))?void 0:t.children)||null;if((null==n?void 0:n.length)>0){if(!up)for(let e=0;ee.widgets.find((e=>e.name===t)),Sp=(e,t,n=!1,o="")=>{var i;if(!t||((e,t)=>!!e.inputs&&e.inputs.some((e=>e.name===t)))(e,t.name))return;_p[t.name]||(_p[t.name]={origType:t.type,origComputeSize:t.computeSize});const r=e.size;t.type=n?_p[t.name].origType:"easyHidden"+o,t.computeSize=n?_p[t.name].origComputeSize:()=>[0,-4],null==(i=t.linkedWidgets)||i.forEach((o=>Sp(e,o,":"+t.name,n)));const s=n?Math.max(e.computeSize()[1],r[1]):e.size[1];e.setSize([e.size[0],s])},xp=(e,t=0)=>{var n,o;if(e)return(null==(n=e.widgets)?void 0:n[t])?e.widgets[t].value:e.widgets_values?null==(o=e.widgets_values)?void 0:o[t]:void 0},kp=e=>e.setSize([e.size[0],e.computeSize()[1]]),Cp=(e,t)=>graph.getNodeById(e),Ap=e=>{var t;try{return Object.values(null==(t=null==graph?void 0:graph.list_of_graphcanvas[0])?void 0:t.selected_nodes)}catch(n){return[]}};function Ep(e,t,n){return e+(o=n,(.5-.5*Math.cos(Math.PI*o))*(t-e));var o}const Op=(e,t=!0)=>{var n,o;const i=(null==(o=null==(n=e.graph)?void 0:n.list_of_graphcanvas)?void 0:o[0])||null;if(!i)return;const[r,s]=e.pos,[a,l]=e.size;(([e,t],n)=>{const o=n.ds,i=document.body.clientWidth,r=document.body.clientHeight,s=o.scale,a=.5*i/s-e,l=.5*r/s-t,c=Date.now()+250,u=o.offset[0],d=o.offset[1],p=()=>{const e=c-Date.now();if(!(Date.now(){const t=Cp(e);t&&Op(t)},Tp=(e,t=(()=>graph.links??[])())=>t[e],Ip=e=>e.toLowerCase().replace(/_./g,(e=>e.replace("_","").toUpperCase())),Np=e=>"easy getNode"===e.type,Pp=e=>"easy setNode"===e.type,Dp=e=>Np(e)||Pp(e),jp=(e=(()=>graph._nodes??[])())=>e.filter((e=>Dp(e))),Mp=(e,t,n=0)=>{e.widgets_values||(e.widgets_values=[]),e.widgets_values[n]=t,e.widgets[n].value=t},Rp=e=>graph.add(e),$p=e=>graph.remove(e),Gp=(e,t=0)=>{var n,o;if("Reroute"!==e.type)return[e,t];const i=e,r=null==(o=null==(n=i.inputs)?void 0:n[0])?void 0:o.link;if(!r)return[i,t];const s=Tp(r);if(!s)return[i,t];const a=Cp(s.origin_id);return a?(setTimeout((()=>{$p(i)})),Gp(a,s.origin_slot)):[i,t]},Bp=e=>{var t,n,o;if("Reroute"!==e.type)return e;const i=e,r=null==(n=null==(t=i.outputs)?void 0:t[0])?void 0:n.links;if(!r)return i;const s=r[0];if(!s)return i;const a=Tp(s);if(!a)return i;const l=Cp(a.target_id);return l?(1===(null==(o=i.outputs[0].links)?void 0:o.length)&&setTimeout((()=>{$p(i)})),Bp(l)):i};const Fp=new class{constructor(){v(this,"element",_(`div.${L}toast`)),v(this,"children",HTMLElement),v(this,"container",document.body),this.container.appendChild(this.element)}async show(e){let t=_(`div.${L}toast-container`,[_("div",[_("span",[...e.icon?[_("i",{className:e.icon})]:[],_("span",e.content)])])]);t.setAttribute("toast-id",e.id),this.element.replaceChildren(t),this.container.appendChild(this.element),await W(64),t.style.marginTop=`-${t.offsetHeight}px`,await W(64),t.classList.add("show"),e.duration&&(await W(e.duration),this.hide(e.id))}async hide(e){const t=document.querySelector(`.${L}toast > [toast-id="${e}"]`);(null==t?void 0:t.classList.contains("show"))&&(t.classList.remove("show"),await W(750)),t&&t.remove()}async clearAllMessages(){let e=document.querySelector(`.${L}container`);e&&(e.innerHTML="")}async info(e,t=3e3,n=[]){this.show({id:"toast-info",icon:`mdi mdi-information ${L}theme`,content:e,duration:t})}async success(e,t=3e3){this.show({id:"toast-success",icon:`mdi mdi-check-circle ${L}success`,content:e,duration:t})}async error(e,t=3e3){this.show({id:"toast-error",icon:`mdi mdi-close-circle ${L}error`,content:e,duration:t})}async warn(e,t=3e3){this.show({id:"toast-warn",icon:`mdi mdi-alert-circle ${L}warning`,content:e,duration:t})}async showLoading(e,t=0){this.show({id:"toast-loading",icon:"mdi mdi-rotate-right loading",content:e,duration:t})}async hideLoading(){this.hide("toast-loading")}},Up=["rescale_after_model","rescale","lora_name","upscale_method","image_output","add_noise","info","sampler_name","ckpt_B_name","ckpt_C_name","save_model","refiner_ckpt_name","num_loras","num_controlnet","mode","toggle","resolution","ratio","target_parameter","input_count","replace_count","downscale_mode","range_mode","text_combine_mode","input_mode","lora_count","ckpt_count","conditioning_mode","preset","use_tiled","use_batch","num_embeds","easing_mode","guider","scheduler","inpaint_mode","t5_type","rem_mode"],zp=["LIGHT - SD1.5 only (low strength)","STANDARD (medium strength)","VIT-G (medium strength)","PLUS (high strength)","PLUS FACE (portraits)","FULL FACE - SD1.5 only (portraits stronger)"],Vp=["FACEID","FACEID PLUS - SD1.5 only","FACEID PLUS V2","FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"],Hp=["easy seed","easy latentNoisy","easy wildcards","easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingSdTurbo","easy preSamplingCascade","easy preSamplingDynamicCFG","easy preSamplingLayerDiffusion","easy fullkSampler","easy fullCascadeKSampler"],Wp=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy hyditLoader","easy pixArtLoader"],Yp=["easy imageSize","easy imageSizeBySide","easy imageSizeByLongerSide","easy imageSizeShow","easy imageRatio","easy imagePixelPerfect"];function Zp(e,t){const n=e.comfyClass,o=t.value;switch(t.name){case"range_mode":Sp(e,wp(e,"step"),"step"==o),Sp(e,wp(e,"num_steps"),"num_steps"==o),kp(e);break;case"text_combine_mode":Sp(e,wp(e,"replace_text"),"replace"==o);break;case"lora_name":["lora_model_strength","lora_clip_strength"].map((t=>Sp(e,wp(e,t),"None"!==o)));break;case"resolution":"自定义 x 自定义"===o&&(t.value="width x height (custom)"),["empty_latent_width","empty_latent_height"].map((t=>Sp(e,wp(e,t),"width x height (custom)"===o)));break;case"ratio":["empty_latent_width","empty_latent_height"].map((t=>Sp(e,wp(e,t),"custom"===o)));break;case"num_loras":var i=o+1,r=wp(e,"mode").value;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));for(let t=i;t<21;t++)["lora_"+t+"_name","lora_"+t+"_strength","lora_"+t+"_model_strength","lora_"+t+"_clip_strength"].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"num_controlnet":i=o+1,r=wp(e,"mode").value;for(let t=0;tSp(e,wp(e,t),!0))),["start_percent_"+t,"end_percent_"+t].map((t=>Sp(e,wp(e,t),"simple"!==r)));for(let t=i;t<21;t++)["controlnet_"+t,"controlnet_"+t+"_strength","scale_soft_weight_"+t,"start_percent_"+t,"end_percent_"+t].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"mode":switch(null==e?void 0:e.comfyClass){case"easy loraStack":i=wp(e,"num_loras").value+1,r=o;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));kp(e);break;case"easy controlnetStack":i=wp(e,"num_controlnet").value+1,r=o;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));kp(e);break;case"easy icLightApply":r=o;["lighting","remove_bg"].map((t=>Sp(e,wp(e,t),"Foreground"===r))),Sp(e,wp(e,"source"),"Foreground"!==r),kp(e)}break;case"toggle":t.type="toggle",t.options={on:"Enabled",off:"Disabled"};break;case"t5_type":["clip_name","padding"].map((t=>Sp(e,wp(e,t),"sd3"==o))),["t5_name","device","dtype"].map((t=>Sp(e,wp(e,t),"t5v11"==o))),kp(e);break;case"preset":if(zp.includes(o)){let t=wp(e,"use_tiled");Sp(e,wp(e,"lora_strength")),Sp(e,wp(e,"provider")),Sp(e,wp(e,"weight_faceidv2")),Sp(e,wp(e,"weight_kolors")),Sp(e,wp(e,"use_tiled"),!0),Sp(e,wp(e,"sharpening"),t&&t.value)}else Vp.includes(o)&&(Sp(e,wp(e,"weight_faceidv2"),!!["FACEID PLUS V2","FACEID PLUS KOLORS"].includes(o)),Sp(e,wp(e,"weight_kolors"),!!["FACEID PLUS KOLORS"].includes(t.value)),["FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"].includes(o)?Sp(e,wp(e,"lora_strength"),!1):Sp(e,wp(e,"lora_strength"),!0),Sp(e,wp(e,"provider"),!0),Sp(e,wp(e,"use_tiled")),Sp(e,wp(e,"sharpening")));kp(e);break;case"use_tiled":Sp(e,wp(e,"sharpening"),!!o),kp(e);break;case"num_embeds":i=o+1;for(let t=0;tSp(e,wp(e,t),!1)));break;case"brushnet_random":case"brushnet_segmentation":["dtype","scale","start_at","end_at"].map((t=>Sp(e,wp(e,t),!0))),["fitting","function"].map((t=>Sp(e,wp(e,t),!1)));break;case"powerpaint":["dtype","fitting","function","scale","start_at","end_at"].map((t=>Sp(e,wp(e,t),!0)))}kp(e);break;case"image_output":Sp(e,wp(e,"link_id"),!!["Sender","Sender&Save"].includes(o)),Sp(e,wp(e,"decode_vae_name"),!!["Hide","Hide&Save"].includes(o)),["save_prefix","output_path","embed_workflow","number_padding","overwrite_existing"].map((t=>Sp(e,wp(e,t),!!["Save","Hide&Save","Sender&Save"].includes(o))));break;case"add_noise":var s=wp(e,"control_before_generate"),a=wp(e,"control_after_generate")||s;"disable"===o?(Sp(e,wp(e,"seed")),a&&(a.last_value=a.value,a.value="fixed",Sp(e,a))):(Sp(e,wp(e,"seed"),!0),a&&((null==a?void 0:a.last_value)&&(a.value=a.last_value),Sp(e,a,!0))),kp(e);break;case"guider":switch(o){case"Basic":["cfg","cfg_negative"].map((t=>Sp(e,wp(e,t))));break;case"CFG":Sp(e,wp(e,"cfg"),!0),Sp(e,wp(e,"cfg_negative"));break;case"IP2P+DualCFG":case"DualCFG":["cfg","cfg_negative"].map((t=>Sp(e,wp(e,t))),!0)}kp(e);break;case"scheduler":["karrasADV","exponentialADV","polyExponential"].includes(o)?(["sigma_max","sigma_min"].map((t=>Sp(e,wp(e,t),!0))),["denoise","beta_d","beta_min","eps_s","coeff"].map((t=>Sp(e,wp(e,t))),!1),Sp(e,wp(e,"rho"),"exponentialADV"!=o)):"vp"==o?(["sigma_max","sigma_min","denoise","rho","coeff"].map((t=>Sp(e,wp(e,t)))),["beta_d","beta_min","eps_s"].map((t=>Sp(e,wp(e,t),!0)))):(["sigma_max","sigma_min","beta_d","beta_min","eps_s","rho"].map((t=>Sp(e,wp(e,t)))),Sp(e,wp(e,"coeff"),"gits"==o),Sp(e,wp(e,"denoise"),!0)),kp(e);break;case"conditioning_mode":["replace","concat","combine"].includes(o)?["average_strength","old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t)))):"average"==o?(Sp(e,wp(e,"average_strength"),!0),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t),!1)))):"timestep"==o&&(["average_strength"].map((t=>Sp(e,wp(e,t),!1))),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t)))));break;case"rescale":wp(e,"rescale_after_model").value,Sp(e,wp(e,"width"),"to Width/Height"===o),Sp(e,wp(e,"height"),"to Width/Height"===o),Sp(e,wp(e,"percent"),"by percentage"===o),Sp(e,wp(e,"longer_side"),"to longer side - maintain aspect"===o),kp(e);break;case"upscale_method":["factor","crop"].map((t=>Sp(e,wp(e,t),"None"!==o)));break;case"target_parameter":switch(n){case"easy XYInputs: Steps":["first_step","last_step"].map((t=>Sp(e,wp(e,t),"steps"==o))),["first_start_step","last_start_step"].map((t=>Sp(e,wp(e,t),"start_at_step"==o))),["first_end_step","last_end_step"].map((t=>Sp(e,wp(e,t),"end_at_step"==o)));break;case"easy XYInputs: Sampler/Scheduler":let t=wp(e,"input_count").value+1;for(let n=0;nSp(e,wp(e,t),"strength"==o))),["first_start_percent","last_start_percent"].map((t=>Sp(e,wp(e,t),"start_percent"==o))),["first_end_percent","last_end_percent"].map((t=>Sp(e,wp(e,t),"end_percent"==o))),["strength","start_percent","end_percent"].map((t=>Sp(e,wp(e,t),o!=t))),kp(e)}case"replace_count":i=o+1;for(let t=0;tSp(e,wp(e,t),!l)));for(let t=i;t<11;t++)["lora_name_"+t,"model_str_"+t,"clip_str_"+t].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"ckpt_count":i=o+1;var c=-1!=wp(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=wp(e,"input_mode").value.indexOf("VAE");for(let t=0;tSp(e,wp(e,t),!1)));kp(e);break;case"input_count":i=o+1;var d=wp(e,"target_parameter").value;for(let t=0;tSp(e,wp(e,n),!t)));["model_strength","clip_strength"].map((n=>Sp(e,wp(e,n),!t)));break;case"easy XYInputs: Checkpoint":i=wp(e,"ckpt_count").value+1,c=-1!=wp(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=wp(e,"input_mode").value.indexOf("VAE");for(let n=0;ne.name===t));if(-1!==e){for(let t=e;t{var e;const t=this.computeSize();t[0]"info"===e.name));if(-1!==e&&this.widgets[e]){this.widgets[e].value=t}}requestAnimationFrame((()=>{var e;const t=this.computeSize();t[0]"prompt"==e.name));this.addWidget("button","get values from COMBO link","",(()=>{var t,o;const i=(null==(o=null==(t=this.outputs[1])?void 0:t.links)?void 0:o.length)>0?this.outputs[1].links[0]:null,r=n.graph._nodes.find((e=>{var t;return null==(t=e.inputs)?void 0:t.find((e=>e.link==i))}));if(i&&r){const t=r.inputs.find((e=>e.link==i)).widget.name,n=r.widgets.find((e=>e.name==t));let o=(null==n?void 0:n.options.values)||null;o&&(o=o.join("\n"),e.value=o)}else Fp.error(V("No COMBO link"),3e3)}),{serialize:!1})}),Wp.includes(t.name)){let t=function(e){var t="";for(let n=0;ne.name===t+"_prompt")),o="comfy-multiline-input wildcard_"+t+"_"+this.id.toString();if(-1==n&&e){const n=document.createElement("textarea");n.className=o,n.placeholder="Wildcard Prompt ("+t+")";const i=this.addDOMWidget(t+"_prompt","customtext",n,{getValue:e=>n.value,setValue(e){n.value=e},serialize:!1});i.inputEl=n,i.inputEl.readOnly=!0,n.addEventListener("input",(()=>{var e;null==(e=i.callback)||e.call(i,i.value)})),i.value=e}else if(this.widgets[n])if(e){this.widgets[n].value=e}else{this.widgets.splice(n,1);const e=document.getElementsByClassName(o);e&&e[0]&&e[0].remove()}}};e.prototype.onExecuted=function(e){null==a||a.apply(this,arguments);const o=t(e.positive),i=t(e.negative);n.call(this,o,"positive"),n.call(this,i,"negative")}}if(["easy sv3dLoader"].includes(t.name)){let t=function(e,t,n){switch(e){case"azimuth":return n.readOnly=!0,n.style.opacity=.6,"0:(0.0,0.0)"+(t>1?`\n${t-1}:(360.0,0.0)`:"");case"elevation":return n.readOnly=!0,n.style.opacity=.6,"0:(-90.0,0.0)"+(t>1?`\n${t-1}:(90.0,0.0)`:"");case"custom":return n.readOnly=!1,n.style.opacity=1,"0:(0.0,0.0)\n9:(180.0,0.0)\n20:(360.0,0.0)"}};e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>"easing_mode"==e.name)),n=this.widgets.find((e=>"batch_size"==e.name)),o=this.widgets.find((e=>"scheduler"==e.name));setTimeout((i=>{o.value||(o.value=t(e.value,n.value,o.inputEl))}),1),e.callback=e=>{o.value=t(e,n.value,o.inputEl)},n.callback=n=>{o.value=t(e.value,n,o.inputEl)}}}if(Hp.includes(o)&&(e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),o=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));if("easy seed"==t.name){const t=this.addWidget("button","🎲 Manual Random Seed",null,(t=>{"fixed"!=o.value&&(o.value="fixed"),e.value=Math.floor(Math.random()*P),n.queuePrompt(0,1)}),{serialize:!1});e.linkedWidgets=[t,o]}},e.prototype.onAdded=async function(){i&&i.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),t=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));setTimeout((n=>{"control_before_generate"==t.name&&0===e.value&&(e.value=Math.floor(Math.random()*P))}),1)}),"easy convertAnything"==o&&(e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>"output_type"==e.name)),t=t=>{this.outputs[0].type=e.value.toUpperCase(),this.outputs[0].name=e.value,this.outputs[0].label=e.value};setTimeout((e=>t()),10),e.callback=e=>t()}),"easy imageInsetCrop"==o){let t=function(e){const t=e.widgets[0];for(let n=1;n<=4;n++)"Pixels"===t.value?(e.widgets[n].options.step=80,e.widgets[n].options.max=8192):(e.widgets[n].options.step=10,e.widgets[n].options.max=99)};e.prototype.onAdded=async function(e){const n=this.widgets[0];let o=n.callback;n.callback=(...e)=>{t(this),o&&o.apply(n,[...e])},setTimeout((e=>{t(this)}),1)}}},nodeCreated(e){if(e.comfyClass.startsWith("easy ")){if(e.widgets)for(const n of e.widgets){if(!Up.includes(n.name))continue;let t=n.value;Zp(e,n),Object.defineProperty(n,"value",{get:e=>t,set(o){o!==t&&(t=o,Zp(e,n))}})}const t=e.comfyClass;if("easy preDetailerFix"==t){const t=e.widgets.find((e=>"customtext"===e.type));if(!t)return;t.dynamicPrompts=!1,t.inputEl.placeholder="wildcard spec: if kept empty, this option will be ignored",t.serializeValue=()=>t.value}if("easy wildcards"==t){const t=e.widgets.find((e=>"text"==e.name));let n=1;Object.defineProperty(e.widgets[n],"value",{set:e=>{if((new Error).stack.includes("inner_value_change")&&"Select the LoRA to add to the text"!=e){let n=e;n.endsWith(".safetensors")&&(n=n.slice(0,-12)),t.value+=``}},get:e=>"Select the LoRA to add to the text"}),Object.defineProperty(e.widgets[n+1],"value",{set:e=>{(new Error).stack.includes("inner_value_change")&&"Select the Wildcard to add to the text"!=e&&(""!=t.value&&(t.value+=", "),t.value+=e)},get:e=>"Select the Wildcard to add to the text"}),e.widgets[n].serializeValue=e=>"Select the LoRA to add to the text",e.widgets[n+1].serializeValue=e=>"Select the Wildcard to add to the text"}if(Yp.includes(t)){const t=document.createElement("textarea");t.className="comfy-multiline-input",t.readOnly=!0;const n=e.addDOMWidget("info","customtext",t,{getValue:e=>t.value,setValue:e=>t.value=e,serialize:!1});n.inputEl=t,t.addEventListener("input",(()=>{var e;null==(e=n.callback)||e.call(n,n.value)}))}}}}),y.registerExtension({name:"easy bookmark",registerCustomNodes(){class e{constructor(){v(this,"type","easy bookmark"),v(this,"title","🔖"),v(this,"slot_start_y",-20),v(this,"___collapsed_width",0),v(this,"isVirtualNode",!0),v(this,"serialize_widgets",!0),v(this,"keypressBound",null),this.addWidget("text","shortcut_key","1",(e=>{""!==(e=e.trim()[0]||"1")&&(this.title="🔖 "+e)}),{y:8}),this.addWidget("number","zoom",1,(e=>{}),{y:8+LiteGraph.NODE_WIDGET_HEIGHT+4,max:2,min:.5,precision:2}),this.keypressBound=this.onKeypress.bind(this)}get _collapsed_width(){return this.___collapsed_width}set _collapsed_width(e){const t=y.canvas,n=t.canvas.getContext("2d");if(n){const e=n.font;n.font=t.title_text_font,this.___collapsed_width=40+n.measureText(this.title).width,n.font=e}}onAdded(){setTimeout((e=>{const t=this.widgets[0].value;t&&(this.title="🔖 "+t)}),1),window.addEventListener("keydown",this.keypressBound)}onRemoved(){window.removeEventListener("keydown",this.keypressBound)}onKeypress(e){const t=e.target;["input","textarea"].includes(t.localName)||this.widgets[0]&&e.key.toLocaleLowerCase()===this.widgets[0].value.toLocaleLowerCase()&&this.canvasToBookmark()}canvasToBookmark(){var e,t;const n=y.canvas;(null==(e=null==n?void 0:n.ds)?void 0:e.offset)&&(n.ds.offset[0]=16-this.pos[0],n.ds.offset[1]=40-this.pos[1]),null!=(null==(t=null==n?void 0:n.ds)?void 0:t.scale)&&(n.ds.scale=Number(this.widgets[1].value||1)),n.setDirty(!0,!0)}}LiteGraph.registerNodeType("easy bookmark",Object.assign(e,{title:"Bookmark 🔖"})),e.category="EasyUse/Util"}}),y.registerExtension({name:"Comfy.EasyUse.ChainNode",init(){y.canvas._mousemove_callback=e=>{if(!A("EasyUse.Nodes.ChainGetSet",null,!0))return;((e,t=!1,n={})=>{var o,i,r,s,a;if(0===e.length)return;const l=n.inputX||160,c=n.ouputX||60;if(e.filter((e=>Dp(e))).length>1)return;for(const d of e){let s=0,a=0;const u=n.inputY||10,p=n.outputY||30,f=[];if(d.graph){for(const e of d.inputs??[]){const t=e.link;if(!t)continue;const{origin_id:n,target_slot:o}=Tp(t),i=Cp(n);if(!i)continue;if(!Dp(i))continue;const r=d.getConnectionPos(!0,o);i.pos=[r[0]-l,r[1]+15+s*u],s+=1,f.push(i),i.flags.collapsed=!0}for(const e of d.outputs??[])if(e.links&&d.graph)for(const t of e.links){const{target_id:e}=Tp(t),n=Cp(e);if(!n)continue;if(!Dp(n))continue;const i=null==(o=n.outputs)?void 0:o.links;if((null==i?void 0:i.length)>1)return;const r=d.getConnectionPos(!1,0);n.pos=[r[0]+c,r[1]+15+a*p],a+=1,f.push(n),n.flags.collapsed=!0}if(t&&1===e.length){const e=[d,...f];(null==(r=null==(i=d.graph)?void 0:i.list_of_graphcanvas)?void 0:r[0]).selectNodes(e)}}}const u=e[0];if(!u)return;(null==(a=null==(s=u.graph)?void 0:s.list_of_graphcanvas)?void 0:a[0]).setDirty(!0,!0)})(Ap())};const e=LGraphCanvas.prototype.showLinkMenu;LGraphCanvas.prototype.showLinkMenu=function(t,n){return n.shiftKey?(((e,t=!1)=>{var n,o,i,r,s,a,l,c,u,d;const{type:p}=e;if("*"===p)return;let{origin_id:f,target_id:h,origin_slot:m,target_slot:g}=e,v=Cp(f),y=Cp(h);if(!v||!y)return!1;if("Reroute"===v.type){let e=0;[v,e]=Gp(v),f=null==v?void 0:v.id,m=e,void 0!==m&&-1!==m||(m=0)}if("Reroute"===y.type&&(y=Bp(y),h=null==y?void 0:y.id,g=null==y?void 0:y.inputs.findIndex((e=>e.type===p)),void 0!==g&&-1!==g||(g=0)),void 0===f||void 0===h||!v||!y)return!1;if(t&&(Dp(v)||Dp(y)))return!1;let b=Ip((null==(n=y.getInputInfo(g))?void 0:n.name)??p.toLowerCase());b||(b=Ip((null==(i=null==(o=null==v?void 0:v.outputs)?void 0:o[m])?void 0:i.name)??(null==(s=null==(r=null==v?void 0:v.outputs)?void 0:r[m])?void 0:s.type.toString())??b+`_from_${f}_to_${h}`));let _,w=!1,S=!1;if(Dp(v))b=xp(v),S=!0;else{const e=null==(l=null==(a=v.outputs)?void 0:a[m])?void 0:l.links;if(e)for(const t of e){const e=Cp((null==(c=Tp(t))?void 0:c.target_id)??-1);e&&Dp(e)&&Pp(e)&&(b=xp(e),S=!0)}if(!S){for(const e of jp()){if(b!==xp(e)||!Pp(e))continue;const t=null==(u=e.inputs[0])?void 0:u.link;(null==(d=Tp(t))?void 0:d.origin_id)===v.id?S=!0:w=!0}w&&(b+=`_from_${f}_to_${h}`)}}if(!S){_=LiteGraph.createNode("easy setNode"),_.is_auto_link=!0;const e=v.getConnectionPos(!1,m);_.pos=[e[0]+20,e[1]],_.inputs[0].name=b,_.inputs[0].type=p,_.inputs[0].widget=y.inputs[g].widget,Mp(_,b),Rp(_),_.flags.collapsed=!0;let t=[];v.widgets?t=Object.values(v.widgets).map((e=>e.value)):v.widgets_values&&(t=JSON.parse(JSON.stringify(v.widgets_values))),v.connect(m,_,0),v.widgets_values=t,"PrimitiveNode"===v.type&&setTimeout((()=>{if(v){v.connect(m,_,0);for(const[e,n]of t.entries())Mp(v,n,e);null!==_&&_.setSize(_.computeSize())}}))}const x=LiteGraph.createNode("easy getNode"),k=y.getConnectionPos(!0,g);x.pos=[k[0]-150,k[1]],x.outputs[0].name=b,x.outputs[0].type=p,x.outputs[0].widget=y.inputs[g].widget,Rp(x),Mp(x,b),null===x||(x.flags.collapsed=!0,x.setSize(x.computeSize()),x.connect(0,y,g))})(t),!1):(e.apply(this,[t,n]),!1)}}});let Kp=[];function Xp(e,t,n,o,i){var r=LGraphCanvas.active_canvas,s=r.getCanvasWindow(),a=r.graph;if(a)return function e(t,o){var l=LiteGraph.getNodeTypesCategories(r.filter||a.filter).filter((function(e){return e.startsWith(t)})),c=[];l.map((function(n){if(n){var o=new RegExp("^("+t+")"),i=n.replace(o,"").split("/")[0],r=""===t?i+"/":t+i+"/",s=i;-1!=s.indexOf("::")&&(s=s.split("::")[1]),-1===c.findIndex((function(e){return e.value===r}))&&c.push({value:r,content:s,has_submenu:!0,callback:function(t,n,o,i){e(t.value,i)}})}})),LiteGraph.getNodeTypesInCategory(t.slice(0,-1),r.filter||a.filter).map((function(e){if(!e.skip_list){var t={value:e.type,content:e.title,has_submenu:!1,callback:function(e,t,n,o){var s=o.getFirstEvent();r.graph.beforeChange();var a=LiteGraph.createNode(e.value);a&&(a.pos=r.convertEventToCanvasOffset(s),r.graph.add(a)),i&&i(a),r.graph.afterChange()}};c.push(t)}}));const u=A("EasyUse.ContextMenu.NodesSort",null,!0);""===t&&u&&(c=function(e){let t=[],n=[];return e.forEach((e=>{(null==e?void 0:e.value)&&D.includes(e.value.split("/")[0])?t.push(e):n.push(e)})),[{title:V("ComfyUI Basic"),is_category_title:!0},...t,{title:V("Others A~Z"),is_category_title:!0},...n.sort(((e,t)=>e.content.localeCompare(t.content)))]}(c)),new LiteGraph.ContextMenu(c,{event:n,parentMenu:o},s)}("",o),!1}function Qp(e,t,n){var o=this;n=n||{};var i=document.createElement("div");i.className="litemenu-entry submenu";var r=!1;function s(e){var t=this.value,i=!0;(o.current_submenu&&o.current_submenu.close(e),n.callback)&&(!0===n.callback.call(this,t,n,e,o,n.node)&&(i=!1));if(t){if(t.callback&&!n.ignore_item_callbacks&&!0!==t.disabled)!0===t.callback.call(this,t,n,e,o,n.extra)&&(i=!1);if(t.submenu){if(!t.submenu.options)throw"ContextMenu submenu needs options";new o.constructor(t.submenu.options,{callback:t.submenu.callback,event:e,parentMenu:o,ignore_item_callbacks:t.submenu.ignore_item_callbacks,title:t.submenu.title,extra:t.submenu.extra,autoopen:n.autoopen}),i=!1}}i&&!o.lock&&o.close()}return null===t?i.classList.add("separator"):t.is_category_title?(i.classList.remove("litemenu-entry"),i.classList.remove("submenu"),i.classList.add("litemenu-title"),i.innerHTML=t.title):(i.innerHTML=t&&t.title?t.title:e,i.value=t,t&&(t.disabled&&(r=!0,i.classList.add("disabled")),(t.submenu||t.has_submenu)&&i.classList.add("has_submenu")),"function"==typeof t?(i.dataset.value=e,i.onclick_callback=t):i.dataset.value=t,t.className&&(i.className+=" "+t.className)),this.root.appendChild(i),r||i.addEventListener("click",s),!r&&n.autoopen&&LiteGraph.pointerListenerAdd(i,"enter",(function(e){var t=this.value;if(!t||!t.has_submenu)return;s.call(this,e)})),i}function Jp(e){return e.substring(0,e.lastIndexOf("."))}function qp(e){return e.substring(e.lastIndexOf(".")+1)}y.registerExtension({name:"Comfy.EasyUse.ContextMenu",async setup(){LGraphCanvas.onMenuAdd=Xp;const e=await b.fetchApi("/easyuse/models/thumbnail");if(200===e.status){let t=await e.json();Kp=t}else Fp.error(V("Too many thumbnails, have closed the display"));const t=LiteGraph.ContextMenu;LiteGraph.ContextMenu=function(e,n){var o,i;if(n.parentMenu);else if(n.extra)null==(o=n.extra.constructor)||o.name;else if(n.scale){if(A("EasyUse.ContextMenu.SubDirectories",null,!0)){const o=function(e,t){const n=e,o=[...n],i={},r=[],s=[],a=["ckpt","pt","bin","pth","safetensors"];if((null==e?void 0:e.length)>0){const t=qp(e[e.length-1]);if(!a.includes(t))return null}for(const l of n){const e=l.indexOf("/")>-1?"/":"\\",t=l.split(e);if(t.length>1){const n=t.shift();i[n]=i[n]||[],i[n].push(t.join(e))}else"CHOOSE"===l||l.startsWith("DISABLE ")?r.push(l):s.push(l)}if(Object.values(i).length>0){const e=t.callback;t.callback=null;const n=(t,n)=>{["None","无","無","なし"].includes(t.content)?e("None",n):e(o.find((e=>e.endsWith(t.content)),n))},l=(e,t="")=>{const o=t?t+"\\"+Jp(e):Jp(e),i=qp(e),r=(new Date).getTime();let s,l="";if(a.includes(i))for(let n=0;n{let n=[],o=[];const r=e.map((e=>{const r={},s=e.indexOf("/")>-1?"/":"\\",a=e.split(s);if(a.length>1){const e=a.shift();r[e]=r[e]||[],r[e].push(a.join(s))}if(Object.values(i).length>0){let t=Object.keys(r)[0];t&&r[t]?n.push({key:t,value:r[t][0]}):o.push(l(e,t))}return l(e,t)}));if(n.length>0){let e={};return n.forEach((t=>{e[t.key]=e[t.key]||[],e[t.key].push(t.value)})),[...Object.entries(e).map((e=>({content:e[0],has_submenu:!0,callback:()=>{},submenu:{options:u(e[1],e[0])}}))),...o]}return r};for(const[t,o]of Object.entries(i))c.push({content:t,has_submenu:!0,callback:()=>{},submenu:{options:u(o,t)}});return c.push(...s.map((e=>l(e,"")))),r.length>0&&c.push(...r.map((e=>l(e,"")))),c}return null}(e,n);if(o)return t.call(this,o,n)}}else n.hasOwnProperty("extra")&&(e.unshift(null),i=window.location.host,["192.168.","10.","127.",/^172\.((1[6-9]|2[0-9]|3[0-1])\.)/].some((e=>"string"==typeof e?i.startsWith(e):e.test(i)))&&e.unshift({content:`${V("Reboot ComfyUI")}`,callback:e=>async function(){if(confirm(V("Are you sure you'd like to reboot the server?")))try{b.fetchApi("/easyuse/reboot")}catch(e){}}()}),e.unshift({content:`${V("Cleanup Of GPU Usage")}`,callback:e=>async function(){try{const{Running:e,Pending:t}=await b.getQueue();if(e.length>0||t.length>0)return void Fp.error(V("Clean Failed")+":"+V("Please stop all running tasks before cleaning GPU"));200==(await b.fetchApi("/easyuse/cleangpu",{method:"POST"})).status?Fp.success(V("Clean SuccessFully")):Fp.error(V("Clean Failed"))}catch(e){}}()}));return t.apply(this,[...arguments])},LiteGraph.ContextMenu.prototype=t.prototype,LiteGraph.ContextMenu.prototype.addItem=Qp}});class ef extends w{constructor(){super(),this.element.classList.add("easyuse-model-metadata")}show(e){super.show(_("div",Object.keys(e).map((t=>_("div",[_("label",{textContent:t}),_("span",{textContent:e[t]})])))))}}class tf extends w{constructor(e){super(),this.name=e,this.element.classList.add("easyuse-model-info")}get customNotes(){return this.metadata["easyuse.notes"]}set customNotes(e){this.metadata["easyuse.notes"]=e}get hash(){return this.metadata["easyuse.sha256"]}async show(e,t){this.type=e;const n=b.fetchApi("/easyuse/metadata/"+encodeURIComponent(`${e}/${t}`));this.info=_("div",{style:{flex:"auto"}}),this.imgCurrent=0,this.imgList=_("div.easyuse-preview-list",{style:{display:"none"}}),this.imgWrapper=_("div.easyuse-preview",[_("div.easyuse-preview-group",[this.imgList])]),this.main=_("main",{style:{display:"flex"}},[this.imgWrapper,this.info]),this.content=_("div.easyuse-model-content",[_("div.easyuse-model-header",[_("h2",{textContent:this.name})]),this.main]);const o=_("div",{textContent:"ℹ️ Loading...",parent:this.content});super.show(this.content),this.metadata=await(await n).json(),this.viewMetadata.style.cursor=this.viewMetadata.style.opacity="",this.viewMetadata.removeAttribute("disabled"),o.remove(),this.addInfo()}createButtons(){const e=super.createButtons();return this.viewMetadata=_("button",{type:"button",textContent:"View raw metadata",disabled:"disabled",style:{opacity:.5,cursor:"not-allowed"},onclick:e=>{this.metadata&&(new ef).show(this.metadata)}}),e.unshift(this.viewMetadata),e}parseNote(){if(!this.customNotes)return[];let e=[];const t=new RegExp("(\\bhttps?:\\/\\/[^\\s]+)","g");let n,o=0;do{let i;n=t.exec(this.customNotes);let r=0;n?(i=n.index,r=n.index+n[0].length):i=this.customNotes.length;let s=this.customNotes.substring(o,i);s&&(s=s.replaceAll("\n","
"),e.push(_("span",{innerHTML:s}))),n&&e.push(_("a",{href:n[0],textContent:n[0],target:"_blank"})),o=r}while(n);return e}addInfoEntry(e,t){return _("p",{parent:this.info},["string"==typeof e?_("label",{textContent:e+": "}):e,"string"==typeof t?_("span",{textContent:t}):t])}async getCivitaiDetails(){const e=await fetch("https://civitai.com/api/v1/model-versions/by-hash/"+this.hash);if(200===e.status)return await e.json();throw 404===e.status?new Error("Model not found"):new Error(`Error loading info (${e.status}) ${e.statusText}`)}addCivitaiInfo(){const e=this.getCivitaiDetails(),t=_("span",{textContent:"ℹ️ Loading..."});return this.addInfoEntry(_("label",[_("img",{style:{width:"18px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),_("span",{textContent:"Civitai: "})]),t),e.then((e=>{var t,n;this.imgWrapper.style.display="block";let o=this.element.querySelector(".easyuse-model-header");o&&o.replaceChildren(_("h2",{textContent:this.name}),_("div.easyuse-model-header-remark",[_("h5",{textContent:V("Updated At:")+O(new Date(e.updatedAt),"yyyy/MM/dd")}),_("h5",{textContent:V("Created At:")+O(new Date(e.updatedAt),"yyyy/MM/dd")})]));let i=null,r=this.parseNote.call(this),s=V("✏️ Edit"),a=_("div.easyuse-model-detail-textarea",[_("p",(null==r?void 0:r.length)>0?r:{textContent:V("No notes")})]);if(r&&0!=r.length?a.classList.remove("empty"):a.classList.add("empty"),this.info.replaceChildren(_("div.easyuse-model-detail",[_("div.easyuse-model-detail-head.flex-b",[_("span",V("Notes")),_("a",{textContent:s,href:"#",style:{fontSize:"12px",float:"right",color:"var(--warning-color)",textDecoration:"none"},onclick:async e=>{if(e.preventDefault(),i){if(i.value!=this.customNotes){toast.showLoading(V("Saving Notes...")),this.customNotes=i.value;const e=await b.fetchApi("/easyuse/metadata/notes/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:this.customNotes});if(toast.hideLoading(),200!==e.status)return toast.error(V("Saving Failed")),void alert(`Error saving notes (${e.status}) ${e.statusText}`);toast.success(V("Saving Succeed")),r=this.parseNote.call(this),a.replaceChildren(_("p",(null==r?void 0:r.length)>0?r:{textContent:V("No notes")})),i.value?a.classList.remove("empty"):a.classList.add("empty")}else a.replaceChildren(_("p",{textContent:V("No notes")})),a.classList.add("empty");e.target.textContent=s,i.remove(),i=null}else e.target.textContent="💾 Save",i=_("textarea",{placeholder:V("Type your notes here"),style:{width:"100%",minWidth:"200px",minHeight:"50px",height:"100px"},textContent:this.customNotes}),a.replaceChildren(i),i.focus()}})]),a]),_("div.easyuse-model-detail",[_("div.easyuse-model-detail-head",{textContent:V("Details")}),_("div.easyuse-model-detail-body",[_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Type")}),_("div.easyuse-model-detail-item-value",{textContent:e.model.type})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("BaseModel")}),_("div.easyuse-model-detail-item-value",{textContent:e.baseModel})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Download")}),_("div.easyuse-model-detail-item-value",{textContent:(null==(t=e.stats)?void 0:t.downloadCount)||0})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Trained Words")}),_("div.easyuse-model-detail-item-value",{textContent:(null==e?void 0:e.trainedWords.join(","))||"-"})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Source")}),_("div.easyuse-model-detail-item-value",[_("label",[_("img",{style:{width:"14px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),_("a",{href:"https://civitai.com/models/"+e.modelId,textContent:"View "+e.model.name,target:"_blank"})])])])])])),null==(n=e.images)?void 0:n.length){this.imgCurrent=0,this.isSaving=!1,e.images.map((e=>e.url&&this.imgList.appendChild(_("div.easyuse-preview-slide",[_("div.easyuse-preview-slide-content",[_("img",{src:e.url}),_("div.save",{textContent:"Save as preview",onclick:async()=>{if(this.isSaving)return;this.isSaving=!0,toast.showLoading(V("Saving Preview..."));const t=await(await fetch(e.url)).blob(),n="temp_preview."+new URL(e.url).pathname.split(".")[1],o=new FormData;o.append("image",new File([t],n)),o.append("overwrite","true"),o.append("type","temp");if(200!==(await b.fetchApi("/upload/image",{method:"POST",body:o})).status)return this.isSaving=!1,toast.error(V("Saving Failed")),toast.hideLoading(),void alert(`Error saving preview (${req.status}) ${req.statusText}`);await b.fetchApi("/easyuse/save/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:JSON.stringify({filename:n,type:"temp"}),headers:{"content-type":"application/json"}}).then((e=>{toast.success(V("Saving Succeed")),toast.hideLoading()})),this.isSaving=!1,app.refreshComboInNodes()}})])]))));let t=this;this.imgDistance=(-660*this.imgCurrent).toString(),this.imgList.style.display="",this.imgList.style.transform="translate3d("+this.imgDistance+"px, 0px, 0px)",this.slides=this.imgList.querySelectorAll(".easyuse-preview-slide"),this.slideLeftButton=_("button.left",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{e.images.length<=2||(t.imgList.classList.remove("no-transition"),0==t.imgCurrent?(t.imgCurrent=e.images.length/2-1,this.slides[this.slides.length-1].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d(660px, 0px, 0px)",setTimeout((e=>{this.slides[this.slides.length-1].style.transform="translate3d(0px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)):(t.imgCurrent=t.imgCurrent-1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"))}}),this.slideRightButton=_("button.right",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{if(!(e.images.length<=2))if(t.imgList.classList.remove("no-transition"),t.imgCurrent>=e.images.length/2-1){t.imgCurrent=0;const n=e.images.length/2;this.slides[0].style.transform="translate3d("+(660*n).toString()+"px, 0px, 0px)",this.slides[1].style.transform="translate3d("+(660*n).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d("+(-660*n).toString()+"px, 0px, 0px)",setTimeout((e=>{this.slides[0].style.transform="translate3d(0px, 0px, 0px)",this.slides[1].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)}else t.imgCurrent=t.imgCurrent+1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"}})}return e.description&&_("div",{parent:this.content,innerHTML:e.description,style:{marginTop:"10px"}}),e})).catch((e=>{this.imgWrapper.style.display="none",t.textContent="⚠️ "+e.message})).finally((e=>{}))}}class nf extends tf{async addInfo(){await this.addCivitaiInfo()}}class of extends tf{getTagFrequency(){if(!this.metadata.ss_tag_frequency)return[];const e=JSON.parse(this.metadata.ss_tag_frequency),t={};for(const n in e){const o=e[n];for(const e in o)e in t?t[e]+=o[e]:t[e]=o[e]}return Object.entries(t).sort(((e,t)=>t[1]-e[1]))}getResolutions(){let e=[];if(this.metadata.ss_bucket_info){const t=JSON.parse(this.metadata.ss_bucket_info);if(null==t?void 0:t.buckets)for(const{resolution:n,count:o}of Object.values(t.buckets))e.push([o,`${n.join("x")} * ${o}`])}e=e.sort(((e,t)=>t[0]-e[0])).map((e=>e[1]));let t=this.metadata.ss_resolution;if(t){const n=t.split(","),o=n[0].replace("(",""),i=n[1].replace(")","");e.push(`${o.trim()}x${i.trim()} (Base res)`)}else(t=this.metadata["modelspec.resolution"])&&e.push(t+" (Base res");return e.length||e.push("⚠️ Unknown"),e}getTagList(e){return e.map((e=>_("li.easyuse-model-tag",{dataset:{tag:e[0]},$:e=>{e.onclick=()=>{e.classList.toggle("easyuse-model-tag--selected")}}},[_("p",{textContent:e[0]}),_("span",{textContent:e[1]})])))}addTags(){let e,t=this.getTagFrequency();if(null==t?void 0:t.length){const n=t.length;let o;n>500&&(t=t.slice(0,500),e=_("p",[_("span",{textContent:"⚠️ Only showing first 500 tags "}),_("a",{href:"#",textContent:`Show all ${n}`,onclick:()=>{o.replaceChildren(...this.getTagList(this.getTagFrequency())),e.remove()}})])),o=_("ol.easyuse-model-tags-list",this.getTagList(t)),this.tags=_("div",[o])}else this.tags=_("p",{textContent:"⚠️ No tag frequency metadata found"});this.content.append(this.tags),e&&this.content.append(e)}async addInfo(){const e=this.addCivitaiInfo();this.addTags();const t=await e;t&&_("div",{parent:this.content,innerHTML:t.description,style:{maxHeight:"250px",overflow:"auto"}})}createButtons(){const e=super.createButtons();function t(e,t){const n=_("textarea",{parent:document.body,style:{position:"fixed"},textContent:t.map((e=>e.dataset.tag)).join(", ")});n.select();try{document.execCommand("copy"),e.target.dataset.text||(e.target.dataset.text=e.target.textContent),e.target.textContent="Copied "+t.length+" tags",setTimeout((()=>{e.target.textContent=e.target.dataset.text}),1e3)}catch(o){prompt("Copy to clipboard: Ctrl+C, Enter",text)}finally{document.body.removeChild(n)}}return e.unshift(_("button",{type:"button",textContent:"Copy Selected",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag--selected")])}}),_("button",{type:"button",textContent:"Copy All",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag")])}})),e}}const rf=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy kolorsLoader","easy hunyuanDiTLoader","easy pixArtLoader"],sf=["easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingLayerDiffusion","easy fullkSampler"],af=["KSamplerSelect","SamplerEulerAncestral","SamplerEulerAncestralCFG++","SamplerLMS","SamplerDPMPP_3M_SDE","SamplerDPMPP_2M_SDE","SamplerDPMPP_SDE","SamplerDPMAdaptative","SamplerLCMUpscale","SamplerTCD","SamplerTCD EulerA"],lf=["BasicScheduler","KarrasScheduler","ExponentialScheduler","PolyexponentialScheduler","VPScheduler","BetaSamplingScheduler","SDTurboScheduler","SplitSigmas","SplitSigmasDenoise","FlipSigmas","AlignYourStepsScheduler","GITSScheduler"],cf=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerLayerDiffusion"],uf=["easy controlnetLoader","easy controlnetLoaderADV","easy controlnetLoader++","easy instantIDApply","easy instantIDApplyADV"],df=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition","easy ipadapterApplyFromParams","easy pulIDApply","easy pulIDApplyADV"],pf=["easy positive","easy wildcards"],ff=["easy loadImageBase64","LoadImage","LoadImageMask"],hf=["easy applyBrushNet","easy applyPowerPaint","easy applyInpaint"],mf={positive_prompt:{text:"positive",positive:"text"},loaders:{ckpt_name:"ckpt_name",vae_name:"vae_name",clip_skip:"clip_skip",lora_name:"lora_name",resolution:"resolution",empty_latent_width:"empty_latent_width",empty_latent_height:"empty_latent_height",positive:"positive",negative:"negative",batch_size:"batch_size",a1111_prompt_style:"a1111_prompt_style"},preSampling:{steps:"steps",cfg:"cfg",cfg_scale_min:"cfg",sampler_name:"sampler_name",scheduler:"scheduler",denoise:"denoise",seed_num:"seed_num",seed:"seed"},kSampler:{image_output:"image_output",save_prefix:"save_prefix",link_id:"link_id"},controlnet:{control_net_name:"control_net_name",strength:["strength","cn_strength"],scale_soft_weights:["scale_soft_weights","cn_soft_weights"],cn_strength:["strength","cn_strength"],cn_soft_weights:["scale_soft_weights","cn_soft_weights"]},ipadapter:{preset:"preset",lora_strength:"lora_strength",provider:"provider",weight:"weight",weight_faceidv2:"weight_faceidv2",start_at:"start_at",end_at:"end_at",cache_mode:"cache_mode",use_tiled:"use_tiled",insightface:"insightface",pulid_file:"pulid_file"},load_image:{image:"image",base64_data:"base64_data",channel:"channel"},inpaint:{dtype:"dtype",fitting:"fitting",function:"function",scale:"scale",start_at:"start_at",end_at:"end_at"},sampler:{},sigmas:{}},gf={loaders:{optional_lora_stack:"optional_lora_stack",positive:"positive",negative:"negative"},preSampling:{pipe:"pipe",image_to_latent:"image_to_latent",latent:"latent"},kSampler:{pipe:"pipe",model:"model"},controlnet:{pipe:"pipe",image:"image",image_kps:"image_kps",control_net:"control_net",positive:"positive",negative:"negative",mask:"mask"},positive_prompt:{},ipadapter:{model:"model",image:"image",image_style:"image",attn_mask:"attn_mask",optional_ipadapter:"optional_ipadapter"},inpaint:{pipe:"pipe",image:"image",mask:"mask"},sampler:{},sigmas:{}},vf={loaders:{pipe:"pipe",model:"model",vae:"vae",clip:null,positive:null,negative:null,latent:null},preSampling:{pipe:"pipe"},kSampler:{pipe:"pipe",image:"image"},controlnet:{pipe:"pipe",positive:"positive",negative:"negative"},positive_prompt:{text:"positive",positive:"text"},load_image:{IMAGE:"IMAGE",MASK:"MASK"},ipadapter:{model:"model",tiles:"tiles",masks:"masks",ipadapter:"ipadapter"},inpaint:{pipe:"pipe"},sampler:{SAMPLER:"SAMPLER"},sigmas:{SIGMAS:"SIGMAS"}};function yf(e,t,n){return function(){!function(e,t,n){const o=LiteGraph.createNode(t);if(o){if(y.graph.add(o),o.pos=e.pos.slice(),o.size=e.size.slice(),e.widgets.forEach((e=>{if(mf[n][e.name]){const i=mf[n][e.name];if(i){const n=(t=i,o.widgets.find((e=>"object"==typeof t?t.includes(e.name):e.name===t)));n&&(n.value=e.value,"seed_num"==e.name&&(n.linkedWidgets[0].value=e.linkedWidgets[0].value),"converted-widget"==e.type&&Cf(o,n,e))}}var t})),e.inputs&&e.inputs.forEach(((t,i)=>{if(t&&t.link&&gf[n][t.name]){const i=gf[n][t.name];if(null===i)return;const r=o.findInputSlot(i);if(-1!==r){const n=e.graph.links[t.link];if(n){const t=e.graph.getNodeById(n.origin_id);t&&t.connect(n.origin_slot,o,r)}}}})),e.outputs&&e.outputs.forEach(((t,i)=>{if(t&&t.links&&vf[n]&&vf[n][t.name]){const i=vf[n][t.name];if(null===i)return;const r=o.findOutputSlot(i);-1!==r&&t.links.forEach((t=>{const n=e.graph.links[t];if(n){const t=e.graph.getNodeById(n.target_id);t&&o.connect(r,t,n.target_slot)}}))}})),y.graph.remove(e),"easy fullkSampler"==o.type){const e=o.outputs[0].links;if(e&&e[0]){const t=y.graph._nodes.find((t=>t.inputs&&t.inputs[0]&&t.inputs[0].link==e[0]));t&&y.graph.remove(t)}}else if(sf.includes(o.type)){const e=o.outputs[0].links;if(!e||!e[0]){const e=LiteGraph.createNode("easy kSampler");y.graph.add(e),e.pos=o.pos.slice(),e.pos[0]=e.pos[0]+o.size[0]+20;const t=o.findInputSlot("pipe");-1!==t&&o&&o.connect(0,e,t)}}o.setSize([o.size[0],o.computeSize()[1]])}}(e,t,n)}}const bf=(e,t)=>{const n=e.prototype.getExtraMenuOptions;e.prototype.getExtraMenuOptions=function(){const e=n.apply(this,arguments);return t.apply(this,arguments),e}},_f=(e,t,n,o,i=!0)=>{bf(o,(function(o,r){r.unshift({content:e,has_submenu:i,callback:(e,o,i,r,s)=>wf(e,o,i,r,s,t,n)}),"loaders"==t&&(r.unshift({content:V("💎 View Lora Info..."),callback:(e,t,n,o,i)=>{let r=i.widgets.find((e=>"lora_name"==e.name)).value;r&&"None"!=r&&new of(r).show("loras",r)}}),r.unshift({content:V("💎 View Checkpoint Info..."),callback:(e,t,n,o,i)=>{let r=i.widgets[0].value;r&&"None"!=r&&new nf(r).show("checkpoints",r)}}))}))},wf=(e,t,n,o,i,r,s)=>{const a=[];return s.map((e=>{i.type!==e&&a.push({content:`${e}`,callback:yf(i,e,r)})})),new LiteGraph.ContextMenu(a,{event:n,callback:null,parentMenu:o,node:i}),!1},Sf="converted-widget",xf=Symbol();function kf(e,t,n=""){if(t.origType=t.type,t.origComputeSize=t.computeSize,t.origSerializeValue=t.serializeValue,t.computeSize=()=>[0,-4],t.type=Sf+n,t.serializeValue=()=>{if(!e.inputs)return;let n=e.inputs.find((e=>{var n;return(null==(n=e.widget)?void 0:n.name)===t.name}));return n&&n.link?t.origSerializeValue?t.origSerializeValue():t.value:void 0},t.linkedWidgets)for(const o of t.linkedWidgets)kf(e,o,":"+t.name)}function Cf(e,t,n){kf(e,t);const{type:o}=function(e){let t=e[0];t instanceof Array&&(t="COMBO");return{type:t}}(n),i=e.size;t.options&&t.options.forceInput||e.addInput(t.name,o,{widget:{name:t.name,[xf]:()=>n}});for(const r of e.widgets)r.last_y+=LiteGraph.NODE_SLOT_HEIGHT;e.setSize([Math.max(i[0],e.size[0]),Math.max(i[1],e.size[1])])}const Af=function(e){var t,n,o,i;const r=e.constructor.type,s=e.properties.origVals||{},a=s.title||e.title,l=s.color||e.color,c=s.bgcolor||e.bgcolor,u=e,d={size:[...e.size],color:l,bgcolor:c,pos:[...e.pos]};let p=[],f=[];if(e.inputs)for(const y of e.inputs)if(y.link){const t=y.name,n=e.findInputSlot(t),o=e.getInputNode(n),i=e.getInputLink(n);p.push([i.origin_slot,o,t])}if(e.outputs)for(const y of e.outputs)if(y.links){const e=y.name;for(const t of y.links){const n=graph.links[t],o=graph._nodes_by_id[n.target_id];f.push([e,o,n.target_slot])}}y.graph.remove(e);const h=y.graph.add(LiteGraph.createNode(r,a,d));function m(){if(u.widgets)for(let e of u.widgets)if("converted-widget"===e.type){const t=h.widgets.find((t=>t.name===e.name));for(let n of u.inputs)n.name===e.name&&Cf(h,t,n.widget)}for(let e of p){const[t,n,o]=e;n.connect(t,h.id,o)}for(let e of f){const[t,n,o]=e;h.connect(t,n,o)}}let g=u.widgets_values;if(!g&&(null==(t=h.widgets)?void 0:t.length)>0)return h.widgets.forEach(((e,t)=>{const n=u.widgets[t];e.name===n.name&&e.type===n.type&&(e.value=n.value)})),void m();const v=(null==g?void 0:g.length)<=(null==(n=h.widgets)?void 0:n.length);let b=v?0:g.length-1;function _(e,t){var n,o,i,r,s,a;if(!0===e||!1===e){if((null==(n=t.options)?void 0:n.on)&&(null==(o=t.options)?void 0:o.off))return{value:e,pass:!0}}else if("number"==typeof e){if((null==(i=t.options)?void 0:i.min)<=e&&e<=(null==(r=t.options)?void 0:r.max))return{value:e,pass:!0}}else{if(null==(a=null==(s=t.options)?void 0:s.values)?void 0:a.includes(e))return{value:e,pass:!0};if(t.inputEl&&"string"==typeof e)return{value:e,pass:!0}}return{value:t.value,pass:!1}}const w=e=>{var t;const n=u.widgets[e];let o=h.widgets[e];if(o.name===n.name&&o.type===n.type){for(;v?b=0;){let{value:e,pass:t}=_(g[b],o);if(t&&null!==e){o.value=e;break}b+=v?1:-1}b++,v||(b=g.length-((null==(t=h.widgets)?void 0:t.length)-1-e))}};if(v&&(null==(o=h.widgets)?void 0:o.length)>0)for(let y=0;y0)for(let y=h.widgets.length-1;y>=0;y--)w(y);m()};y.registerExtension({name:"Comfy.EasyUse.ExtraMenu",async beforeRegisterNodeDef(e,t,n){bf(e,(function(e,n){n.unshift({content:V("🔃 Reload Node"),callback:(e,t,n,o,i)=>{let r=LGraphCanvas.active_canvas;if(!r.selected_nodes||Object.keys(r.selected_nodes).length<=1)Af(i);else for(let s in r.selected_nodes)Af(r.selected_nodes[s])}}),"easy ckptNames"==t.name&&n.unshift({content:V("💎 View Checkpoint Info..."),callback:(e,t,n,o,i)=>{i.widgets[0].value}})})),pf.includes(t.name)&&_f("↪️ Swap EasyPrompt","positive_prompt",pf,e),rf.includes(t.name)&&_f("↪️ Swap EasyLoader","loaders",rf,e),sf.includes(t.name)&&_f("↪️ Swap EasyPreSampling","preSampling",sf,e),cf.includes(t.name)&&_f("↪️ Swap EasyKSampler","preSampling",cf,e),af.includes(t.name)&&_f("↪️ Swap Custom Sampler","sampler",af,e),lf.includes(t.name)&&_f("↪️ Swap Custom Sigmas","sigmas",lf,e),uf.includes(t.name)&&_f("↪️ Swap EasyControlnet","controlnet",uf,e),df.includes(t.name)&&_f("↪️ Swap EasyAdapater","ipadapter",df,e),ff.includes(t.name)&&_f("↪️ Swap LoadImage","load_image",ff,e),hf.includes(t.name)&&_f("↪️ Swap InpaintNode","inpaint",hf,e)}});const Ef="➡️";y.registerExtension({name:"easy setNode",registerCustomNodes(){class e{constructor(){v(this,"defaultVisibility",!0),v(this,"serialize_widgets",!0),this.properties||(this.properties={previousName:""}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("text","Constant","",((e,n,o,i,r)=>{t.validateName(t.graph),""!==this.widgets[0].value&&(this.title=Ef+this.widgets[0].value),this.update(),this.properties.previousName=this.widgets[0].value}),{}),this.addInput("*","*"),this.onConnectionsChange=function(e,n,o,i,r){if(1!=e||o||(this.inputs[n].type="*",this.inputs[n].name="*",this.title="Set"),i&&t.graph&&1==e&&o){const e=t.graph._nodes.find((e=>e.id==i.origin_id)).outputs[i.origin_slot],n=e.type,o=t.is_auto_link?this.widgets[0].value:e.name;"Set"===this.title&&(this.title=Ef+o,this.widgets[0].value=o),"*"===this.widgets[0].value&&(this.widgets[0].value=o),this.validateName(t.graph),this.inputs[0].type=n,this.inputs[0].name=o,setTimeout((e=>{this.title=Ef+this.widgets[0].value}),1)}this.update()},this.validateName=function(e){let n=t.widgets[0].value;if(""!=n){let o=0,i=[];do{i=e._nodes.filter((e=>e!=this&&("easy setNode"==e.type&&e.widgets[0].value===n))),i.length>0&&(n=t.widgets[0].value+o),o++}while(i.length>0);t.widgets[0].value=n,this.update()}},this.clone=function(){const t=e.prototype.clone.apply(this);return t.inputs[0].name="*",t.inputs[0].type="*",t.properties.previousName="",t.size=t.computeSize(),t},this.onAdded=function(e){this.validateName(e)},this.update=function(){if(t.graph){this.findGetters(t.graph).forEach((e=>{e.setType(this.inputs[0].type)})),this.widgets[0].value&&this.findGetters(t.graph,!0).forEach((e=>{e.setName(this.widgets[0].value)}));t.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues()}))}},this.findGetters=function(e,t){const n=t?this.properties.previousName:this.widgets[0].value;return e._nodes.filter((e=>"easy getNode"==e.type&&e.widgets[0].value===n&&""!=n))},this.isVirtualNode=!0}onRemoved(){this.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues([this])}))}}LiteGraph.registerNodeType("easy setNode",Object.assign(e,{title:"Set"})),e.category="EasyUse/Util"}}),y.registerExtension({name:"easy getNode",registerCustomNodes(){class e{constructor(){v(this,"defaultVisibility",!0),v(this,"serialize_widgets",!0),this.properties||(this.properties={}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("combo","Constant","",(e=>{this.onRename()}),{values:()=>t.graph._nodes.filter((e=>"easy setNode"==e.type)).map((e=>e.widgets[0].value)).sort()}),this.addOutput("*","*"),this.onConnectionsChange=function(e,t,n,o,i){this.validateLinks(),2!=e||n?(this.onRename(),setTimeout((e=>{this.title="⬅️"+this.widgets[0].value}),1)):(this.outputs[t].type="*",this.outputs[t].name="*",this.title="Get")},this.setName=function(e){t.widgets[0].value=e,t.onRename(),t.serialize()},this.onRename=function(e=0){const n=this.findSetter(t.graph);if(n){const t=n.inputs[0].type,o=n.inputs[0].name;this.setType(t,o),this.outputs[e].type=t,this.outputs[e].name=o,this.title="⬅️"+n.widgets[0].value}else this.setType("*","*"),this.outputs[e].type="*",this.outputs[e].name="*"},this.clone=function(){const t=e.prototype.clone.apply(this);return t.size=t.computeSize(),t},this.validateLinks=function(){"*"!=this.outputs[0].type&&this.outputs[0].links&&this.outputs[0].links.forEach((e=>{const n=t.graph.links[e];n&&n.type!=this.outputs[0].type&&"*"!=n.type&&t.graph.removeLink(e)}))},this.setType=function(e,t){this.outputs[0].name=t,this.outputs[0].type=e,this.validateLinks()},this.findSetter=function(e){const t=this.widgets[0].value;return e._nodes.find((e=>"easy setNode"==e.type&&e.widgets[0].value===t&&""!=t))},this.isVirtualNode=!0}getInputLink(e){const t=this.findSetter(this.graph);if(t){const n=t.inputs[e];return this.graph.links[n.link]}throw new Error("No setter found for "+this.widgets[0].value+"("+this.type+")")}onAdded(e){}}LiteGraph.registerNodeType("easy getNode",Object.assign(e,{title:"Get"})),e.category="EasyUse/Util"}}),b.addEventListener("easyuse-global-seed",(function(e){let t=app.graph._nodes_by_id;for(let n in t){let o=t[n];if("easy globalSeed"==o.type){if(o.widgets){const t=o.widgets.find((e=>"value"==e.name));o.widgets.find((e=>"last_seed"==e.name)).value=t.value,t.value=e.detail.value}}else if(o.widgets){const t=o.widgets.find((e=>"seed_num"==e.name||"seed"==e.name||"noise_seed"==e.name));t&&null!=e.detail.seed_map[o.id]&&(t.value=e.detail.seed_map[o.id])}}}));const Of=b.queuePrompt;b.queuePrompt=async function(e,{output:t,workflow:n}){n.seed_widgets={};for(let o in app.graph._nodes_by_id){let e=app.graph._nodes_by_id[o].widgets;if(e)for(let t in e)"seed_num"!=e[t].name&&"seed"!=e[t].name&&"noise_seed"!=e[t].name||"converted-widget"==e[t].type||(n.seed_widgets[o]=parseInt(t))}return await Of.call(b,e,{output:t,workflow:n})};const Lf=["easy imageSave","easy fullkSampler","easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo","easy detailerFix"];y.registerExtension({name:"Comfy.EasyUse.SaveImageExtraOutput",async beforeRegisterNodeDef(e,t,n){if(Lf.includes(t.name)){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0,o=this.widgets.find((e=>"filename_prefix"===e.name||"save_prefix"===e.name));return o.serializeValue=()=>x(n,o.value),e}}else{const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0;return this.properties&&"Node name for S&R"in this.properties||this.addProperty("Node name for S&R",this.constructor.type,"string"),e}}}});const Tf=["easy wildcards","easy positive","easy negative","easy stylesSelector","easy promptConcat","easy promptReplace"],If=["easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingDynamicCFG","easy preSamplingSdTurbo","easy preSamplingLayerDiffusion"],Nf=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo"],Pf=["easy controlnetLoader","easy controlnetLoaderADV"],Df=["easy instantIDApply","easy instantIDApplyADV"],jf=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition"],Mf=["easy pipeIn","easy pipeOut","easy pipeEdit"],Rf=["easy XYPlot","easy XYPlotAdvanced"],$f=["easy setNode"],Gf=["Reroute","RescaleCFG","LoraLoaderModelOnly","LoraLoader","FreeU","FreeU_v2",...jf,...$f],Bf={"easy seed":{from:{INT:["Reroute",...If,"easy fullkSampler"]}},"easy positive":{from:{STRING:["Reroute",...Tf]}},"easy negative":{from:{STRING:["Reroute",...Tf]}},"easy wildcards":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy stylesSelector":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy promptConcat":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy promptReplace":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy fullLoader":{from:{PIPE_LINE:["Reroute",...If,"easy fullkSampler",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy a1111Loader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy comfyLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy hunyuanDiTLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy kolorsLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy pixArtLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy svdLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy zero123Loader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy sv3dLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy preSampling":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingAdvanced":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingDynamicCFG":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingCustom":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingLayerDiffusion":{from:{PIPE_LINE:["Reroute","easy kSamplerLayerDiffusion",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingNoiseIn":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy fullkSampler":{from:{PIPE_LINE:["Reroute",...Mf.reverse(),"easy preDetailerFix","easy preMaskDetailerFix",...If,...$f]}},"easy kSampler":{from:{PIPE_LINE:["Reroute",...Mf.reverse(),"easy preDetailerFix","easy preMaskDetailerFix","easy hiresFix",...If,...$f]}},"easy controlnetLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f]}},"easy controlnetLoaderADV":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f]}},"easy instantIDApply":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{COMBO:["Reroute","easy promptLine"]}},"easy instantIDApplyADV":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApply":{to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApplyADV":{to:{STRING:["Reroute","easy sliderControl",...Tf],COMBO:["Reroute","easy promptLine"]}},"easy ipadapterStyleComposition":{to:{COMBO:["Reroute","easy promptLine"]}},"easy preDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Mf,...$f]},to:{PIPE_LINE:["Reroute","easy ultralyticsDetectorPipe","easy samLoaderPipe","easy kSampler","easy fullkSampler"]}},"easy preMaskDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Mf,...$f]}},"easy samLoaderPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Mf,...$f]}},"easy ultralyticsDetectorPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Mf,...$f]}},"easy cascadeLoader":{from:{PIPE_LINE:["Reroute","easy fullCascadeKSampler","easy preSamplingCascade",...Pf,...Mf,...$f],MODEL:Gf.filter((e=>!jf.includes(e)))}},"easy fullCascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Mf,...$f]}},"easy preSamplingCascade":{from:{PIPE_LINE:["Reroute","easy cascadeKSampler",...Mf,...$f]}},"easy cascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Mf,...$f]}}};y.registerExtension({name:"Comfy.EasyUse.Suggestions",async setup(e){LGraphCanvas.prototype.createDefaultNodeForSlot=function(e){e=e||{};var t,n=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,position:[],nodeType:null,posAdd:[0,0],posSizeFix:[0,0]},e),o=n.nodeFrom&&null!==n.slotFrom,i=!o&&n.nodeTo&&null!==n.slotTo;if(!o&&!i)return!1;if(!n.nodeType)return!1;var r=o?n.nodeFrom:n.nodeTo,s=o?n.slotFrom:n.slotTo,a=r.type,l=!1;switch(typeof s){case"string":l=o?r.findOutputSlot(s,!1):r.findInputSlot(s,!1),s=o?r.outputs[s]:r.inputs[s];break;case"object":l=o?r.findOutputSlot(s.name):r.findInputSlot(s.name);break;case"number":l=s,s=o?r.outputs[s]:r.inputs[s];break;default:return!1}var c=s.type==LiteGraph.EVENT?"_event_":s.type,u=o?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in;if(u&&u[c]){s.link;let e=!1;const i=o?"from":"to";if(Bf[a]&&Bf[a][i]&&(null==(t=Bf[a][i][c])?void 0:t.length)>0){for(var d in Bf[a][i][c])if(n.nodeType==Bf[a][i][c][d]||"AUTO"==n.nodeType){e=Bf[a][i][c][d];break}}else if("object"==typeof u[c]||"array"==typeof u[c]){for(var d in u[c])if(n.nodeType==u[c][d]||"AUTO"==n.nodeType){e=u[c][d];break}}else n.nodeType!=u[c]&&"AUTO"!=n.nodeType||(e=u[c]);if(e){var p=!1;"object"==typeof e&&e.node&&(p=e,e=e.node);var f=LiteGraph.createNode(e);if(f){if(p){if(p.properties)for(var h in p.properties)f.addProperty(h,p.properties[h]);if(p.inputs)for(var h in f.inputs=[],p.inputs)f.addOutput(p.inputs[h][0],p.inputs[h][1]);if(p.outputs)for(var h in f.outputs=[],p.outputs)f.addOutput(p.outputs[h][0],p.outputs[h][1]);p.title&&(f.title=p.title),p.json&&f.configure(p.json)}return this.graph.add(f),f.pos=[n.position[0]+n.posAdd[0]+(n.posSizeFix[0]?n.posSizeFix[0]*f.size[0]:0),n.position[1]+n.posAdd[1]+(n.posSizeFix[1]?n.posSizeFix[1]*f.size[1]:0)],o?n.nodeFrom.connectByType(l,f,c):n.nodeTo.connectByTypeOutput(l,f,c),!0}}}return!1},LGraphCanvas.prototype.showConnectionMenu=function(e){e=e||{};var t,n=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,e:null},e),o=this,i=n.nodeFrom&&n.slotFrom,r=!i&&n.nodeTo&&n.slotTo;if(!i&&!r)return!1;var s=i?n.nodeFrom:n.nodeTo,a=i?n.slotFrom:n.slotTo,l=!1;switch(typeof a){case"string":l=i?s.findOutputSlot(a,!1):s.findInputSlot(a,!1),a=i?s.outputs[a]:s.inputs[a];break;case"object":l=i?s.findOutputSlot(a.name):s.findInputSlot(a.name);break;case"number":l=a,a=i?s.outputs[a]:s.inputs[a];break;default:return!1}var c=["Add Node",null];o.allow_searchbox&&(c.push("Search"),c.push(null));var u=a.type==LiteGraph.EVENT?"_event_":a.type,d=i?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in,p=s.type;if(d&&d[u]){const e=i?"from":"to";if(Bf[p]&&Bf[p][e]&&(null==(t=Bf[p][e][u])?void 0:t.length)>0)for(var f in Bf[p][e][u])c.push(Bf[p][e][u][f]);else if("object"==typeof d[u]||"array"==typeof d[u])for(var f in d[u])c.push(d[u][f]);else c.push(d[u])}var h=new LiteGraph.ContextMenu(c,{event:n.e,title:(a&&""!=a.name?a.name+(u?" | ":""):"")+(a&&u?u:""),callback:function(e,t,r){switch(e){case"Add Node":LGraphCanvas.onMenuAdd(null,null,r,h,(function(e){i?n.nodeFrom.connectByType(l,e,u):n.nodeTo.connectByTypeOutput(l,e,u)}));break;case"Search":i?o.showSearchBox(r,{node_from:n.nodeFrom,slot_from:a,type_filter_in:u}):o.showSearchBox(r,{node_to:n.nodeTo,slot_from:a,type_filter_out:u});break;default:o.createDefaultNodeForSlot(Object.assign(n,{position:[n.e.canvasX,n.e.canvasY],nodeType:e}))}}});return!1}}}),y.registerExtension({name:"Comfy.EasyUse.TimeTaken",setup(){const e=new Map;let t=0;b.addEventListener("executing",(n=>{if(!A("EasyUse.Nodes.Runtime",null,!0))return;const o=(null==n?void 0:n.node)||(null==n?void 0:n.detail)||null,i=Cp(o);i&&(i.executionDuration="");const r=e.get(t);if(e.delete(t),t&&r){const e=Date.now()-r,n=Cp(t);n&&(n.executionDuration=`${(e/1e3).toFixed(2)}${V("s")}`)}t=o,e.set(o,Date.now())}))},beforeRegisterNodeDef(e,t){const n=e.prototype.onDrawForeground;e.prototype.onDrawForeground=function(...e){const[t]=e;return function(e,t){if(!t)return;e.save(),e.fillStyle=LiteGraph.NODE_DEFAULT_BGCOLOR,function(e,t,n,o,i,r){e.beginPath(),e.moveTo(t+r,n),e.lineTo(t+o-r,n),e.arcTo(t+o,n,t+o,n+r,r),e.lineTo(t+o,n+i-r),e.arcTo(t+o,n+i,t+o-r,n+i,r),e.lineTo(t+r,n+i),e.arcTo(t,n+i,t,n+i-r,r),e.lineTo(t,n+r),e.arcTo(t,n,t+r,n,r),e.closePath()}(e,0,-LiteGraph.NODE_TITLE_HEIGHT-20,e.measureText(t).width+10,LiteGraph.NODE_TITLE_HEIGHT-10,4),e.fill(),function(e,t,n,o,i="#000",r=12,s="Inter"){e.font=`${r}px ${s}`,e.fillStyle=i,e.fillText(t,n,o)}(e,t,8,-LiteGraph.NODE_TITLE_HEIGHT-6,LiteGraph.NODE_TITLE_COLOR),e.restore()}(t,this.executionDuration||""),null==n?void 0:n.apply(this,e)}}});const Ff="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function Uf(e,t,n,o){e.addEventListener?e.addEventListener(t,n,o):e.attachEvent&&e.attachEvent("on".concat(t),n)}function zf(e,t,n,o){e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent&&e.detachEvent("on".concat(t),n)}function Vf(e,t){const n=t.slice(0,t.length-1);for(let o=0;o=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}const Wf={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Ff?173:189,"=":Ff?61:187,";":Ff?59:186,"'":222,"[":219,"]":221,"\\":220},Yf={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Zf={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Kf={16:!1,18:!1,17:!1,91:!1},Xf={};for(let by=1;by<20;by++)Wf["f".concat(by)]=111+by;let Qf=[],Jf=null,qf="all";const eh=new Map,th=e=>Wf[e.toLowerCase()]||Yf[e.toLowerCase()]||e.toUpperCase().charCodeAt(0);function nh(e){qf=e||"all"}function oh(){return qf||"all"}function ih(e){if(void 0===e)Object.keys(Xf).forEach((e=>{Array.isArray(Xf[e])&&Xf[e].forEach((e=>rh(e))),delete Xf[e]})),ch(null);else if(Array.isArray(e))e.forEach((e=>{e.key&&rh(e)}));else if("object"==typeof e)e.key&&rh(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o{let{key:t,scope:n,method:o,splitKey:i="+"}=e;Hf(t).forEach((e=>{const t=e.split(i),r=t.length,s=t[r-1],a="*"===s?"*":th(s);if(!Xf[a])return;n||(n=oh());const l=r>1?Vf(Yf,t):[],c=[];Xf[a]=Xf[a].filter((e=>{const t=(!o||e.method===o)&&e.scope===n&&function(e,t){const n=e.length>=t.length?e:t,o=e.length>=t.length?t:e;let i=!0;for(let r=0;rch(e)))}))};function sh(e,t,n,o){if(t.element!==o)return;let i;if(t.scope===n||"all"===t.scope){i=t.mods.length>0;for(const e in Kf)Object.prototype.hasOwnProperty.call(Kf,e)&&(!Kf[e]&&t.mods.indexOf(+e)>-1||Kf[e]&&-1===t.mods.indexOf(+e))&&(i=!1);(0!==t.mods.length||Kf[16]||Kf[18]||Kf[17]||Kf[91])&&!i&&"*"!==t.shortcut||(t.keys=[],t.keys=t.keys.concat(Qf),!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function ah(e,t){const n=Xf["*"];let o=e.keyCode||e.which||e.charCode;if(!lh.filter.call(this,e))return;if(93!==o&&224!==o||(o=91),-1===Qf.indexOf(o)&&229!==o&&Qf.push(o),["ctrlKey","altKey","shiftKey","metaKey"].forEach((t=>{const n=Zf[t];e[t]&&-1===Qf.indexOf(n)?Qf.push(n):!e[t]&&Qf.indexOf(n)>-1?Qf.splice(Qf.indexOf(n),1):"metaKey"===t&&e[t]&&3===Qf.length&&(e.ctrlKey||e.shiftKey||e.altKey||(Qf=Qf.slice(Qf.indexOf(n))))})),o in Kf){Kf[o]=!0;for(const e in Yf)Yf[e]===o&&(lh[e]=!0);if(!n)return}for(const a in Kf)Object.prototype.hasOwnProperty.call(Kf,a)&&(Kf[a]=e[Zf[a]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===Qf.indexOf(17)&&Qf.push(17),-1===Qf.indexOf(18)&&Qf.push(18),Kf[17]=!0,Kf[18]=!0);const i=oh();if(n)for(let a=0;a1&&(i=Vf(Yf,e)),(e="*"===(e=e[e.length-1])?"*":th(e))in Xf||(Xf[e]=[]),Xf[e].push({keyup:l,keydown:c,scope:r,mods:i,shortcut:o[a],method:n,key:o[a],splitKey:u,element:s});if(void 0!==s&&window){if(!eh.has(s)){const e=function(){return ah(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event,s)},t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event;ah(e,s),function(e){let t=e.keyCode||e.which||e.charCode;const n=Qf.indexOf(t);if(n>=0&&Qf.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&Qf.splice(0,Qf.length),93!==t&&224!==t||(t=91),t in Kf){Kf[t]=!1;for(const e in Yf)Yf[e]===t&&(lh[e]=!1)}}(e)};eh.set(s,{keydownListener:e,keyupListenr:t,capture:d}),Uf(s,"keydown",e,d),Uf(s,"keyup",t,d)}if(!Jf){const e=()=>{Qf=[]};Jf={listener:e,capture:d},Uf(window,"focus",e,d)}}}function ch(e){const t=Object.values(Xf).flat();if(t.findIndex((t=>{let{element:n}=t;return n===e}))<0){const{keydownListener:t,keyupListenr:n,capture:o}=eh.get(e)||{};t&&n&&(zf(e,"keyup",n,o),zf(e,"keydown",t,o),eh.delete(e))}if(t.length<=0||eh.size<=0){if(Object.keys(eh).forEach((e=>{const{keydownListener:t,keyupListenr:n,capture:o}=eh.get(e)||{};t&&n&&(zf(e,"keyup",n,o),zf(e,"keydown",t,o),eh.delete(e))})),eh.clear(),Object.keys(Xf).forEach((e=>delete Xf[e])),Jf){const{listener:e,capture:t}=Jf;zf(window,"focus",e,t),Jf=null}}}const uh={getPressedKeyString:function(){return Qf.map((e=>{return t=e,Object.keys(Wf).find((e=>Wf[e]===t))||(e=>Object.keys(Yf).find((t=>Yf[t]===e)))(e)||String.fromCharCode(e);var t}))},setScope:nh,getScope:oh,deleteScope:function(e,t){let n,o;e||(e=oh());for(const i in Xf)if(Object.prototype.hasOwnProperty.call(Xf,i))for(n=Xf[i],o=0;o{let{element:t}=e;return ch(t)}))}else o++;oh()===e&&nh(t||"all")},getPressedKeyCodes:function(){return Qf.slice(0)},getAllKeyCodes:function(){const e=[];return Object.keys(Xf).forEach((t=>{Xf[t].forEach((t=>{let{key:n,scope:o,mods:i,shortcut:r}=t;e.push({scope:o,shortcut:r,mods:i,keys:n.split("+").map((e=>th(e)))})}))})),e},isPressed:function(e){return"string"==typeof e&&(e=th(e)),-1!==Qf.indexOf(e)},filter:function(e){const t=e.target||e.srcElement,{tagName:n}=t;let o=!0;const i="INPUT"===n&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(i||"TEXTAREA"===n||"SELECT"===n)&&!t.readOnly)&&(o=!1),o},trigger:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(Xf).forEach((n=>{Xf[n].filter((n=>n.scope===t&&n.shortcut===e)).forEach((e=>{e&&e.method&&e.method()}))}))},unbind:ih,keyMap:Wf,modifier:Yf,modifierMap:Zf};for(const by in uh)Object.prototype.hasOwnProperty.call(uh,by)&&(lh[by]=uh[by]);if("undefined"!=typeof window){const e=window.hotkeys;lh.noConflict=t=>(t&&window.hotkeys===lh&&(window.hotkeys=e),lh),window.hotkeys=lh}let dh=null;y.registerExtension({name:"Comfy.EasyUse.HotKeys",setup(){if(void 0!==lh){lh("up,down,left,right",(function(e,t){var n,o,i,r,s,a,l,c,u,d,p,f,h,m,g;e.preventDefault();if(!A("EasyUse.Hotkeys.JumpNearestNodes",null,!0))return;const v=Ap();if(0===v.length)return;const y=v[0];switch(t.key){case"up":case"left":let e=null;if(Np(y)){const e=null==(n=y.widgets_values)?void 0:n[0],t=null==(o=y.graph)?void 0:o._nodes,i=null==t?void 0:t.find((t=>{var n;if(Pp(t)){if((null==(n=t.widgets_values)?void 0:n[0])===e)return t}return null}));i&&Op(i)}else if((null==(i=y.inputs)?void 0:i.length)>0){for(let t=0;t{var n;if(Np(t)){if((null==(n=t.widgets_values)?void 0:n[0])===e)return t}return null}));n&&Op(n)}else if((null==(d=y.outputs)?void 0:d.length)>0){for(let e=0;e0&&y.outputs[e].links[0]){t=y.outputs[e].links[0];break}if(t){const e=null==(f=y.graph)?void 0:f.links;if(e[t]){const n=null==(h=e[t])?void 0:h.target_id,o=null==(g=null==(m=y.graph)?void 0:m._nodes_by_id)?void 0:g[n];o&&Op(o)}}}}})),lh("shift+up,shift+down,shift+left,shift+right",(function(e,t){e.preventDefault();if(!A("EasyUse.Hotkeys.AlignSelectedNodes",null,!0))return;const n=Ap();if(n.length<=1)return;const o=n;switch(t.key){case"shift+up":LGraphCanvas.alignNodes(o,"top",o[0]);break;case"shift+down":LGraphCanvas.alignNodes(o,"bottom",o[0]);break;case"shift+left":LGraphCanvas.alignNodes(o,"left",o[0]);break;case"shift+right":LGraphCanvas.alignNodes(o,"right",o[0])}dh||(dh=np()),dh&&dh.update()})),lh("shift+g",(function(e,t){e.preventDefault();A("EasyUse.Hotkeys.AddGroup",null,!0)&&(fh(),dh||(dh=np()),dh&&dh.update())}));const e=[];Array.from(Array(10).keys()).forEach((t=>e.push(`alt+${t}`))),lh(e.join(","),(async function(e,t){e.preventDefault();if(!A("EasyUse.Hotkeys.NodesTemplate",null,!0))return;const n=t.key;let o=parseInt(n.split("+")[1]);const i=await b.getUserData("comfy.templates.json");let r=null;if(200==i.status)try{r=await i.json()}catch(a){Fp.error(V("Get Node Templates File Failed"))}else localStorage["Comfy.NodeTemplates"]?r=JSON.parse(localStorage["Comfy.NodeTemplates"]):Fp.warn(V("No Node Templates Found"));if(!r)return void Fp.warn(V("No Node Templates Found"));o=0===o?9:o-1;const s=r[o];if(s)try{const e=(null==s?void 0:s.name)||"Group",t=(null==s?void 0:s.data)?JSON.parse(s.data):[];ph((async()=>{await k.registerFromWorkflow(t.groupNodes,{}),localStorage.litegrapheditor_clipboard=s.data,y.canvas.pasteFromClipboard(),t.groupNodes||fh(e)}))}catch(a){Fp.error(a)}else Fp.warn(V("Node template with {key} not set").replace("{key}",n))}));const t=async function(e){if(("b"===e.key||"m"==e.key)&&(e.metaKey||e.ctrlKey)){if(0===Ap().length)return;dh||(dh=np()),dh&&dh.update()}};window.addEventListener("keydown",t,!0)}}});const ph=async e=>{const t=localStorage.litegrapheditor_clipboard;await e(),localStorage.litegrapheditor_clipboard=t},fh=e=>{const t=Ap();if(0===t.length)return;const n=t;let o=new LiteGraph.LGraphGroup;o.title=e||"Group",((e,t=[],n=20)=>{var o,i,r,s,a,l,c,u,d,p;for(var f of(i=r=s=a=-1,l=c=u=d=-1,[e._nodes,t]))for(var h in f)l=(p=f[h]).pos[0],c=p.pos[1],u=p.pos[0]+p.size[0],d=p.pos[1]+p.size[1],"Reroute"!=p.type&&(c-=LiteGraph.NODE_TITLE_HEIGHT),(null==(o=p.flags)?void 0:o.collapsed)&&(d=c+LiteGraph.NODE_TITLE_HEIGHT,(null==p?void 0:p._collapsed_width)&&(u=l+Math.round(p._collapsed_width))),(-1==i||ls)&&(s=u),(-1==a||d>a)&&(a=d);r-=Math.round(1.4*e.font_size),e.pos=[i-n,r-n],e.size=[s-i+2*n,a-r+2*n]})(o,n),y.canvas.graph.add(o)};function hh(e,t,n,o){const i=[];return e.workflow.links.forEach((e=>{n&&e[1]===t&&!i.includes(e[3])&&i.push(e[3]),o&&e[3]===t&&!i.includes(e[1])&&i.push(e[1])})),i}async function mh(e,t=!1){const n=structuredClone(await y.graphToPrompt()),o=[];if(n.workflow.nodes.forEach((e=>{o.push(e.id)})),n.workflow.links=n.workflow.links.filter((e=>o.includes(e[1])&&o.includes(e[3]))),t)for(;!y.graph._nodes_by_id[e].isChooser;)e=hh(n,e,!0,!1)[0];const i=function(e,t){const n=[],o=[t];for(;o.length>0;){const t=o.pop();n.push(t),o.push(...hh(e,t,!0,!1).filter((e=>!(n.includes(e)||o.includes(e)))))}o.push(...n.filter((e=>e!=t)));const i=[t];for(;o.length>0;){const t=o.pop();i.push(t),o.push(...hh(e,t,!1,!0).filter((e=>!(i.includes(e)||o.includes(e)))))}const r=[];return r.push(...n),r.push(...i.filter((e=>!r.includes(e)))),r}(n,e);n.workflow.nodes=n.workflow.nodes.filter((t=>(t.id===e&&t.inputs.forEach((e=>{e.link=null})),i.includes(t.id)))),n.workflow.links=n.workflow.links.filter((e=>i.includes(e[1])&&i.includes(e[3])));const r={};for(const[l,c]of Object.entries(n.output))i.includes(parseInt(l))&&(r[l]=c);const s={};for(const[l,c]of Object.entries(r[e.toString()].inputs))Array.isArray(c)||(s[l]=c);r[e.toString()].inputs=s,n.output=r;const a=y.graphToPrompt;y.graphToPrompt=()=>(y.graphToPrompt=a,n),y.queuePrompt(0)}const gh=new class{constructor(){this.current_node_id=void 0,this.class_of_current_node=null,this.current_node_is_chooser=!1}update(){var e,t;return y.runningNodeId!=this.current_node_id&&(this.current_node_id=y.runningNodeId,this.current_node_id?(this.class_of_current_node=null==(t=null==(e=y.graph)?void 0:e._nodes_by_id[y.runningNodeId.toString()])?void 0:t.comfyClass,this.current_node_is_chooser="easy imageChooser"===this.class_of_current_node):(this.class_of_current_node=void 0,this.current_node_is_chooser=!1),!0)}},vh=class e{constructor(){}static idle(){return!y.runningNodeId}static paused(){return!0}static paused_here(t){return e.here(t)}static running(){return!e.idle()}static here(e){return y.runningNodeId==e}static state(){return"Paused"}};v(vh,"cancelling",!1);let yh=vh;function bh(e,t){const n=new FormData;n.append("message",t),n.append("id",e),b.fetchApi("/easyuse/image_chooser_message",{method:"POST",body:n})}function _h(){bh(-1,"__cancel__"),yh.cancelling=!0,b.interrupt(),yh.cancelling=!1}var wh=0;function Sh(){wh+=1}const xh=["easy kSampler","easy kSamplerTiled","easy fullkSampler"];function kh(e){const t=y.graph._nodes_by_id[e.detail.id];if(t){t.selected=new Set,t.anti_selected=new Set;const n=function(e,t){var n;return e.imgs=[],t.forEach((t=>{const n=new Image;e.imgs.push(n),n.onload=()=>{y.graph.setDirtyCanvas(!0)},n.src=`/view?filename=${encodeURIComponent(t.filename)}&type=temp&subfolder=${y.getPreviewFormatParam()}`})),null==(n=e.setSizeForImage)||n.call(e),e.imgs}(t,e.detail.urls);return{node:t,image:n,isKSampler:xh.includes(t.type)}}}function Ch(e,t,n){var o;if(e.imageRects)o=e.imageRects[t];else{const t=e.imagey;o=[1,t+1,e.size[0]-2,e.size[1]-t-2]}n.strokeRect(o[0]+1,o[1]+1,o[2]-2,o[3]-2)}class Ah extends w{constructor(){super(),this.node=null,this.select_index=[],this.dialog_div=null}show(e,t){this.select_index=[],this.node=t;const n=e.map(((e,n)=>{const o=_("img",{src:e.src,onclick:e=>{this.select_index.includes(n)?(this.select_index=this.select_index.filter((e=>e!==n)),o.classList.remove("selected")):(this.select_index.push(n),o.classList.add("selected")),t.selected.has(n)?t.selected.delete(n):t.selected.add(n)}});return o}));super.show(_("div.comfyui-easyuse-chooser-dialog",[_("h5.comfyui-easyuse-chooser-dialog-title",V("Choose images to continue")),_("div.comfyui-easyuse-chooser-dialog-images",n)]))}createButtons(){const e=super.createButtons();return e[0].onclick=e=>{yh.running()&&_h(),super.close()},e.unshift(_("button",{type:"button",textContent:V("Choose Selected Images"),onclick:e=>{bh(this.node.id,[...this.node.selected,-1,...this.node.anti_selected]),yh.idle()&&(Sh(),mh(this.node.id).then((()=>{bh(this.node.id,[...this.node.selected,-1,...this.node.anti_selected])}))),super.close()}})),e}}function Eh(){const e=y.graph._nodes_by_id[this.node_id];if(e){const t=[...e.selected];(null==t?void 0:t.length)>0&&e.setProperty("values",t),bh(e.id,[...e.selected,-1,...e.anti_selected]),yh.idle()&&(Sh(),mh(e.id).then((()=>{bh(e.id,[...e.selected,-1,...e.anti_selected])})))}}function Oh(){yh.running()&&_h()}function Lh(e){Object.defineProperty(e,"clicked",{get:function(){return this._clicked},set:function(e){this._clicked=e&&""!=this.name}})}function Th(e){e.options||(e.options={}),e.options.serialize=!1}y.registerExtension({name:"Comfy.EasyUse.imageChooser",init(){window.addEventListener("beforeunload",_h,!0)},setup(e){const t=LGraphCanvas.prototype.draw;LGraphCanvas.prototype.draw=function(){gh.update()&&e.graph._nodes.forEach((e=>{e.update&&e.update()})),t.apply(this,arguments)},b.addEventListener("easyuse-image-choose",(function(e){const{node:t,image:n,isKSampler:o}=kh(e);if(o){(new Ah).show(n,t)}}));const n=b.interrupt;b.interrupt=function(){yh.cancelling||_h(),n.apply(this,arguments)},b.addEventListener("execution_start",(function(){(wh>0?(wh-=1,0):(bh(-1,"__start__"),1))&&e.graph._nodes.forEach((e=>{(e.selected||e.anti_selected)&&(e.selected.clear(),e.anti_selected.clear(),e.update())}))}))},async nodeCreated(e,t){if("easy imageChooser"==e.comfyClass){e.setProperty("values",[]),void 0===(null==e?void 0:e.imageIndex)&&Object.defineProperty(e,"imageIndex",{get:function(){return null},set:function(t){e.overIndex=t}}),void 0===(null==e?void 0:e.imagey)&&Object.defineProperty(e,"imagey",{get:function(){return null},set:function(t){return e.widgets[e.widgets.length-1].last_y+LiteGraph.NODE_WIDGET_HEIGHT}});const t=e.onMouseDown;e.onMouseDown=function(n,o,i){if(n.isPrimary){const t=function(e,t){var n,o;if((null==(n=e.imgs)?void 0:n.length)>1)for(var i=0;i0&&n0&&oe.imagey)return 0;return-1}(e,o);t>=0&&this.imageClicked(t)}return t&&t.apply(this,arguments)},e.send_button_widget=e.addWidget("button","","",Eh),e.cancel_button_widget=e.addWidget("button","","",Oh),Lh(e.cancel_button_widget),Lh(e.send_button_widget),Th(e.cancel_button_widget),Th(e.send_button_widget)}},beforeRegisterNodeDef(e,t,n){if("easy imageChooser"==(null==t?void 0:t.name)){const t=e.prototype.onDrawBackground;e.prototype.onDrawBackground=function(e){t.apply(this,arguments),function(e,t){var n,o;if(e.imgs){if(e.imageRects)for(let n=0;n{Ch(e,n,t)})),t.strokeStyle="#F88",null==(o=null==e?void 0:e.anti_selected)||o.forEach((n=>{Ch(e,n,t)}))}}(this,e)},e.prototype.imageClicked=function(t){"easy imageChooser"===(null==e?void 0:e.comfyClass)&&(this.selected.has(t)?this.selected.delete(t):this.selected.add(t),this.update())};const n=e.prototype.update;e.prototype.update=function(){var e;if(n&&n.apply(this,arguments),this.send_button_widget){this.send_button_widget.node_id=this.id;const t=(this.selected?this.selected.size:0)+(this.anti_selected?this.anti_selected.size:0),n=(null==(e=this.imgs)?void 0:e.length)||0;yh.paused_here(this.id)&&t>0?this.send_button_widget.name=t>1?"Progress selected ("+t+"/"+n+")":"Progress selected image":this.send_button_widget.name=t>0?t>1?"Progress selected ("+t+"/"+n+")":"Progress selected image as restart":""}if(this.cancel_button_widget){const e=yh.running();this.cancel_button_widget.name=e?"Cancel current run":""}this.setDirtyCanvas(!0,!0)}}}}),Number.prototype.div=function(e){return function(e,t){let n,o,i=0,r=0,s="string"==typeof e?e:e.toString(),a="string"==typeof t?t:t.toString();try{i=s.toString().split(".")[1].length}catch(l){}try{r=a.toString().split(".")[1].length}catch(l){}return n=Number(s.toString().replace(".","")),o=Number(a.toString().replace(".","")),n/o*Math.pow(10,r-i)}(this,e)};let Ih=[],Nh=0;const Ph={sd3:6.5,"sd3-turbo":4};class Dh extends w{constructor(){super(),this.lists=[],this.dialog_div=null,this.user_div=null}addItem(e,t){return _("div.easyuse-account-dialog-item",[_("input",{type:"text",placeholder:"Enter name",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Ih[t].name=e.target.value},value:Ih[e].name}),_("input.key",{type:"text",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Ih[t].key=e.target.value},placeholder:"Enter APIKEY",value:Ih[e].key}),_("button.choose",{textContent:V("Choose"),onclick:async e=>{var n,o,i;const r=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);let s=Ih[r].name,a=Ih[r].key;if(!s)return void Fp.error(V("Please enter the account name"));if(!a)return void Fp.error(V("Please enter the APIKEY"));let l=!0;for(let t=0;t{(new Dh).show(t)}},[_("div.user",[_("div.avatar",r?[_("img",{src:r})]:"😀"),_("div.info",[_("h5.name",s),_("h6.remark","Credits: "+a)])]),_("div.edit",{textContent:V("Edit")})])),Fp.success(V("Save Succeed"))}else Fp.success(V("Save Succeed"));this.close()}else Fp.error(V("Save Failed"))}}),_("button.delete",{textContent:V("Delete"),onclick:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Ih.length<=1?Fp.error(V("At least one account is required")):(Ih.splice(t,1),this.dialog_div.removeChild(e.target.parentNode))}})])}show(e){Ih.forEach(((t,n)=>{this.lists.push(this.addItem(n,e))})),this.dialog_div=_("div.easyuse-account-dialog",this.lists),super.show(_("div.easyuse-account-dialog-main",[_("div",[_("a",{href:"https://platform.stability.ai/account/keys",target:"_blank",textContent:V("Getting Your APIKEY")})]),this.dialog_div]))}createButtons(){const e=super.createButtons();return e.unshift(_("button",{type:"button",textContent:V("Save Account Info"),onclick:e=>{let t=!0;for(let n=0;n{200==e.status?Fp.success(V("Save Succeed")):Fp.error(V("Save Failed"))}))}else Fp.error(V("APIKEY is not Empty"))}})),e.unshift(_("button",{type:"button",textContent:V("Add Account"),onclick:e=>{const t="Account "+Ih.length.toString();Ih.push({name:t,key:""});const n=this.addItem(Ih.length-1);this.lists.push(n),this.dialog_div.appendChild(n)}})),e}}y.registerExtension({name:"Comfy.EasyUse.API.SD3",async beforeRegisterNodeDef(e,t,n){if("easy stableDiffusion3API"==t.name){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=async function(){var e,n,o;t&&(null==t||t.apply(this,arguments));const i=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),r=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));let s=this.widgets.find((e=>"model"==e.name));s.callback=e=>{a.value="-"+Ph[e]};const a=this.addWidget("text","cost_credit","0",(e=>{}),{serialize:!1});a.disabled=!0,setTimeout((e=>{"control_before_generate"==r.name&&0===i.value&&(i.value=Math.floor(4294967294*Math.random())),a.value="-"+Ph[s.value]}),100);let l=_("div.easyuse-account-user",[V("Loading UserInfo...")]);this.addDOMWidget("account","btn",_("div.easyuse-account",l)),b.addEventListener("stable-diffusion-api-generate-succeed",(async({detail:e})=>{var t;let n=l.querySelectorAll(".remark");if(n&&n[0]){const t=(null==e?void 0:e.model)?Ph[e.model]:0;if(t){let e=function(e,t){let n,o,i,r,s,a;s="string"==typeof e?e:e.toString(),a="string"==typeof t?t:t.toString();try{n=s.split(".")[1].length}catch(l){n=0}try{o=a.split(".")[1].length}catch(l){o=0}return i=Math.pow(10,Math.max(n,o)),r=n>=o?n:o,((e*i-t*i)/i).toFixed(r)}(parseFloat(n[0].innerText.replace(/Credits: /g,"")),t);e>0&&(n[0].innerText="Credits: "+e.toString())}}await W(1e4);const o=await b.fetchApi("/easyuse/stability/balance");if(200==o.status){const e=await o.json();if(null==e?void 0:e.balance){const o=(null==(t=e.balance)?void 0:t.credits)||0;n&&n[0]&&(n[0].innerText="Credits: "+o)}}}));const c=await b.fetchApi("/easyuse/stability/api_keys");if(200==c.status){let t=await c.json();if(Ih=t.keys,Nh=t.current,Ih.length>0&&void 0!==Nh){const t=Ih[Nh].key,i=Ih[Nh].name;if(t){const t=await b.fetchApi("/easyuse/stability/user_info");if(200==t.status){const i=await t.json();if((null==i?void 0:i.account)&&(null==i?void 0:i.balance)){const t=(null==(e=i.account)?void 0:e.profile_picture)||null,r=(null==(n=i.account)?void 0:n.email)||null,s=(null==(o=i.balance)?void 0:o.credits)||0;l.replaceChildren(_("div.easyuse-account-user-info",{onclick:e=>{(new Dh).show(l)}},[_("div.user",[_("div.avatar",t?[_("img",{src:t})]:"😀"),_("div.info",[_("h5.name",r),_("h6.remark","Credits: "+s)])]),_("div.edit",{textContent:V("Edit")})]))}}}else l.replaceChildren(_("div.easyuse-account-user-info",{onclick:e=>{(new Dh).show(l)}},[_("div.user",[_("div.avatar","😀"),_("div.info",[_("h5.name",i),_("h6.remark",V("Click to set the APIKEY first"))])]),_("div.edit",{textContent:V("Edit")})]))}}}}}});let jh=null;function Mh(){jh&&(jh.removeEventListeners(),jh.dropdown.remove(),jh=null)}function Rh(e,t,n,o=!1){Mh(),new $h(e,t,n,o)}class $h{constructor(e,t,n,o=!1){this.dropdown=document.createElement("ul"),this.dropdown.setAttribute("role","listbox"),this.dropdown.classList.add("easy-dropdown"),this.selectedIndex=-1,this.inputEl=e,this.suggestions=t,this.onSelect=n,this.isDict=o,this.focusedDropdown=this.dropdown,this.buildDropdown(),this.onKeyDownBound=this.onKeyDown.bind(this),this.onWheelBound=this.onWheel.bind(this),this.onClickBound=this.onClick.bind(this),this.addEventListeners()}buildDropdown(){this.isDict?this.buildNestedDropdown(this.suggestions,this.dropdown):this.suggestions.forEach(((e,t)=>{this.addListItem(e,t,this.dropdown)}));const e=this.inputEl.getBoundingClientRect();this.dropdown.style.top=e.top+e.height-10+"px",this.dropdown.style.left=e.left+"px",document.body.appendChild(this.dropdown),jh=this}buildNestedDropdown(e,t){let n=0;Object.keys(e).forEach((o=>{const i=e[o];if("object"==typeof i&&null!==i){const e=document.createElement("ul");e.setAttribute("role","listbox"),e.classList.add("easy-nested-dropdown");const r=document.createElement("li");r.classList.add("folder"),r.textContent=o,r.appendChild(e),r.addEventListener("mouseover",this.onMouseOver.bind(this,n,t)),t.appendChild(r),this.buildNestedDropdown(i,e),n+=1}else{const e=document.createElement("li");e.classList.add("item"),e.setAttribute("role","option"),e.textContent=o,e.addEventListener("mouseover",this.onMouseOver.bind(this,n,t)),e.addEventListener("mousedown",this.onMouseDown.bind(this,o)),t.appendChild(e),n+=1}}))}addListItem(e,t,n){const o=document.createElement("li");o.setAttribute("role","option"),o.textContent=e,o.addEventListener("mouseover",this.onMouseOver.bind(this,t)),o.addEventListener("mousedown",this.onMouseDown.bind(this,e)),n.appendChild(o)}addEventListeners(){document.addEventListener("keydown",this.onKeyDownBound),this.dropdown.addEventListener("wheel",this.onWheelBound),document.addEventListener("click",this.onClickBound)}removeEventListeners(){document.removeEventListener("keydown",this.onKeyDownBound),this.dropdown.removeEventListener("wheel",this.onWheelBound),document.removeEventListener("click",this.onClickBound)}onMouseOver(e,t){t&&(this.focusedDropdown=t),this.selectedIndex=e,this.updateSelection()}onMouseOut(){this.selectedIndex=-1,this.updateSelection()}onMouseDown(e,t){t.preventDefault(),this.onSelect(e),this.dropdown.remove(),this.removeEventListeners()}onKeyDown(e){const t=Array.from(this.focusedDropdown.children),n=t[this.selectedIndex];if(jh)if(38===e.keyCode)e.preventDefault(),this.selectedIndex=Math.max(0,this.selectedIndex-1),this.updateSelection();else if(40===e.keyCode)e.preventDefault(),this.selectedIndex=Math.min(t.length-1,this.selectedIndex+1),this.updateSelection();else if(39===e.keyCode){if(e.preventDefault(),n&&n.classList.contains("folder")){const e=n.querySelector(".easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=0,this.updateSelection())}}else if(37===e.keyCode&&this.focusedDropdown!==this.dropdown){const e=this.focusedDropdown.closest(".easy-dropdown, .easy-nested-dropdown").parentNode.closest(".easy-dropdown, .easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=Array.from(e.children).indexOf(this.focusedDropdown.parentNode),this.updateSelection())}else if((13===e.keyCode||9===e.keyCode)&&this.selectedIndex>=0){e.preventDefault(),n.classList.contains("item")&&(this.onSelect(t[this.selectedIndex].textContent),this.dropdown.remove(),this.removeEventListeners());const o=n.querySelector(".easy-nested-dropdown");o&&(this.focusedDropdown=o,this.selectedIndex=0,this.updateSelection())}else 27===e.keyCode&&(this.dropdown.remove(),this.removeEventListeners())}onWheel(e){const t=parseInt(this.dropdown.style.top);localStorage.getItem("Comfy.Settings.Comfy.InvertMenuScrolling")?this.dropdown.style.top=t+(e.deltaY<0?10:-10)+"px":this.dropdown.style.top=t+(e.deltaY<0?-10:10)+"px"}onClick(e){this.dropdown.contains(e.target)||e.target===this.inputEl||(this.dropdown.remove(),this.removeEventListeners())}updateSelection(){Array.from(this.focusedDropdown.children).forEach(((e,t)=>{t===this.selectedIndex?e.classList.add("selected"):e.classList.remove("selected")}))}}function Gh(e){const t=e.min||0,n=e.max||0,o=e.step||1;if(0===o)return[];const i=[];let r=t;for(;r<=n;){if(Number.isInteger(o))i.push(Math.round(r)+"; ");else{let e=r.toFixed(3);-0==e&&(e="0.000"),/\.\d{3}$/.test(e)||(e+="0"),i.push(e+"; ")}r+=o}return n>=0&&t>=0?i:i.reverse()}let Bh={},Fh={};function Uh(e,t){String(e.id);const n=t.name,o=t.value.replace(/^(loader|preSampling):\s/,"");Fh[n]?Fh[n]!=Bh[o]&&(Fh[n]=Bh[o]):Fh={...Fh,[n]:Bh[o]}}y.registerExtension({name:"Comfy.EasyUse.XYPlot",async beforeRegisterNodeDef(e,t,n){if("easy XYPlot"===t.name){Bh=t.input.hidden.plot_dict[0];for(const e in Bh){const t=Bh[e];if(Array.isArray(t)){let n=[];for(const e of t)n.push(e+"; ");Bh[e]=n}else Bh[e]="object"==typeof t?"seed"==e?t+"; ":Gh(t):t+"; "}Bh.None=[],Bh["---------------------"]=[]}},nodeCreated(e){"easy XYPlot"===e.comfyClass&&(function(e){if(e.widgets)for(const t of e.widgets)if("x_axis"===t.name||"y_axis"===t.name){let n=t.value;Object.defineProperty(t,"value",{get:()=>n,set(o){o!==n&&(n=o,Uh(e,t))}})}}(e),function(e){if(e.widgets){const t=e.widgets.filter((e=>"customtext"===e.type&&!1!==e.dynamicPrompts||e.dynamicPrompts));for(const e of t){let t=function(e,t,o,i){return e&&(t[o]=e),t.map((e=>n(e,i))).filter((e=>""!==e)).join("")},n=function(e,t){if(e=o(e),i(e,t))return e+"; ";let n=r(e,t);return 1===n.length||2===n.length?n[0]:i(s(e),t)?s(e)+"; ":""},o=function(e){return e.replace(/(\n|;| )/g,"")},i=function(e,t){return t.includes(e+"; ")},r=function(e,t){return t.filter((t=>t.toLowerCase().includes(e.toLowerCase())))},s=function(e){return Number(e)?Number(e).toFixed(3):["0","0.","0.0","0.00","00"].includes(e)?"0.000":e};const a=function(){const n=e.name[0]+"_axis";let o=(null==Fh?void 0:Fh[n])||[];if(0===o.length)return;const i=e.inputEl.value,r=e.inputEl.selectionStart;let s=i.split("; ");const a=i.substring(0,r).split("; ").length-1,l=s[a].replace(/\n/g,"").toLowerCase(),c=o.filter((e=>e.toLowerCase().includes(l))).map((e=>e.replace(/; /g,"")));if(c.length>0)Rh(e.inputEl,c,(n=>{const i=t(n,s,a,o);e.inputEl.value=i}));else{Mh();const n=t(null,s,a,o);e.inputEl.value=n}};e.inputEl.removeEventListener("input",a),e.inputEl.addEventListener("input",a),e.inputEl.removeEventListener("mouseup",a),e.inputEl.addEventListener("mouseup",a)}}}(e))}});const zh=_s("graphStore",{state:e=>({selectors:[],selectors_styles:{},seg_selectors:[],slider_controls:[]}),actions:{setSelectors(e){this.selectors=tp(e)},setStyles(e,t){this.selectors_styles[e]||(this.selectors_styles[e]=t)},setSegSelectors(e){this.seg_selectors=tp(e)},setSliderControls(e){this.slider_controls=tp(e)}}}),Vh=["data-id"],Hh=[Zi("i",{class:"mdi mdi-trash-can"},null,-1)],Wh=Zi("i",{class:"mdi mdi-magnify"},null,-1),Yh=["placeholder"],Zh=["onMouseenter","onMouseleave"],Kh=["onClick"],Xh=["name","checked"],Qh=["src"],Jh={key:0},qh=Zi("span",{class:"comfyui-easyuse-success"},"positive:",-1),em={key:1},tm=Zi("span",{class:"comfyui-easyuse-error"},"negative:",-1),nm="comfyui-easyuse-selector",om={__name:"stylesSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selectedStyles:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["chooseStyle"],setup(e,{emit:t}){const n=e,o=zh(),{selectors_styles:i}=ws(o),r=pn([]);bi((e=>n.type),(async e=>{r.value=[],e&&await(async e=>{if(i.value[n.type])return!0;const t=await b.fetchApi(`/easyuse/prompt/styles?name=${e}`);if(200===t.status){let e=(await t.json()).map(((e,t)=>(e.index=t,e)));return await o.setStyles(n.type,e),!0}return Fp.error(V("Get styles list Failed")),!1})(e)&&a()}),{immediate:!0});const s=t,a=e=>{const t=n.selectedStyles,o=tp(i.value[n.type]);r.value=o.sort(((e,t)=>e.index-t.index)).sort(((e,n)=>t.includes(n.name)-t.includes(e.name)))},l=pn(""),c=e=>e.toLowerCase(),u=Xt({}),d=e=>{u.src="",u.name="",u.positive="",u.negative=""},p=async e=>{const t=await b.fetchApi(`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`);if(200===t.status){const o=await t.text();if(o.startsWith("http"))return o;return`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`}},f=e=>{e.target.src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QNLaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuMSAoMjAyMzA5MDUubS4yMzE2IDk3OWM4NmQpICAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjA3NEU1QzNCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjA3NEU1QzRCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGMDc0RTVDMUI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGMDc0RTVDMkI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHB8fHx8fHx8fHx8BBwcHDQwNGBAQGBoVERUaHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fH//AABEIAIAAgAMBEQACEQEDEQH/xACLAAEAAgMBAQEAAAAAAAAAAAAABAUCAwYBBwgBAQADAQEBAAAAAAAAAAAAAAABAgMEBQYQAAEEAgECAwUHAwUAAAAAAAEAAgMEEQUhEgYxEwdBYSIyFFFxgVJyIxWRoTOxwdFiJBEBAAICAQQBBAIDAAAAAAAAAAECEQMxIUESBBOB0SIyUXGCIwX/2gAMAwEAAhEDEQA/AP1SgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDXJYgj+d4afsVopM8KWvEcy8it1pXdMcjXO/Lnn+im2u0cwV2VniW1UXEBAQEBAQEBAQEBAQRNlc+mgyDh7zhv+5WunX5Sw37fCHM2dh48r06ank7N6rn2Ja7qa4hw5BBwQV010uK+/DsO29v/J68SOI86Jxjl95HIP4gryPc0fHfHaXu+j7Py68zzHSVquV2iAgICAgICAgICDyTr6HdHz4PTnwypjnqic46OauNbY6mGX99p+L8w9xaeV6OufHt0eXtr59M9VFb194E9LmuH3kf6rv17avO2ets7YVcuuuk/uOa3PgBlxP4BdMbq9nLPqbJ5xDbSM9azFXpyujuSO+Bo5kcf0NPyj25We2YtEzaPxdfr6519Kz+UvqEIlELBKQZQ0eYRwC7HOPxXzVsZ6cPpK5x15ZKEiAgICAgICAgICCNc1tG40CzA2XHg4j4h9zhyFpr22p+s4Z7NNL/ALRlTX+1dVFBJOJrcTI2lxZHYcBx+sldWv3bzOMVn6fZy39OkRnNo+v3aoOx9JOxks8tqwHDPS+1IW8+IzGWZVrf9DZHSMR/j9yvo656zMz9V1rdLqdYwsoVIqwd87mNAc79Tvmd+JXJt332ftMy6temlP1jCasmggICAgICAgICAgwlmiib1SPDB7zhWrWZ4VtaI5QXb2l5ojYHvLjjIGB/dbR61sZlhPtVziFb3PYdd0luCvAZbXludVZ1huZQPgyTx4/atvWj4rxaZ6d/6Ye1/t1zSI6zx/bzti5YqaOpBeg8u41n/oa14cA4ccH7lPs1jZebVn8eyPUtOrXFbR+XdYx9xa90pjeXROaSCXDj+oysZ9S+Mx1bR7uvOJ6LGOWKVgfG8PafAtOQueazHLqraJjMMlCRAQEBAQEBAQRLNp4HTFx/2/4WtKR3Y32T2Udl8j3knk/aeSu6kREPPvaZlpY3DmyY8DyrzPZWv8tkvmFv7bg12RyR1DGeeMj2KnjE9JaeUx1hi1sgaet/U7JIOMcE8Dj7FMREcK2zPKMasr5XO6fmOVt5xEOadVplYU45IAOhxa72kLm2TFuXXqrNeF1WtlwDZeHfmHguO+vHDupszylLJsICAgICAg8cMjCQiYR5IVpFmc1Q5qLXHPgfbhbV2MLaYlqNQAYA4V/kV+PDA1fcp81fjYurtYMu4CmLZRNYhtZWBAI8CqzdaKN8df3LObtIokxwe5ZzZrFUloIGFnLWHqhIgICAgICAgxMbSpyjDAwAq3kr4MTWCnzR4MX02PGHDISNmETqieWba7QABwB4KJumKNgjaFXK0VZYChYQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEHzvuv1G7k1W9s6/Xamtaq15oaonmnsCR008HntaI4K8/s4HOeEGXZXqTud7uqtG7r6kNa5HdMU9aaw9zZde+FkrHsnr1+M2MZBPIKDRe9cO2K2mjs/V0m7X61lWzq32W+ZFEbfkSSO4B+GL9zw4QWm99TqFVmjsaSu7fUtxeNM2aTmSMBbHI9zWHqHVJlnDTxjPKCJL6sea502t1D7Ouhr0rNqxNM2CSNuwnkgjAi6ZOotdEc/Egibf1j/j+7JNL9DWdWg84TWn2ywtdFKyMZb5Tg0nLyG55x48IJ3bXqe/ea/a26dFtyTXtldDUqyOdNL5VqaDHS5gwXRxMe3xz1Y9iDKP1Sa7uefUnR7TyYqUVoEU5jY6pJZIz1RY4ZiMYd7TkexBA749Wr2gtCKlrIpGs17NjK29LLWmPmMsyiFkbIZsPEdKQu6y0eAQWdD1E2L93W1tzRyCDY3paev2NaxVlhIjidMfMb5vmse1kbi9pZ7MeKDt0BAQEBAQfEPU+lFY2++q2K1uSSezTnrReVsTTmiZVYHOd9LVuQyubIwANkbxz4FA7FsQ0NrrLNXX7N0eo1+3darGDYPjb5j6prxVRajjDetsRAjj4yM4CDre2uxO7q2hqtm7nua6w9rp5tfXgoSxwyTOMr42PlrPe4Nc8jJJQRDb3Oz1fYFrcV7As0mu3u7nbWkBZ9LSfG5nlxs/yySWRiNozwcBBx9EXadGTXz62+LG41+jZS6adhzS6vfnlkEjgzEZax7T8ePFBu3nbPdUXqJZsw6S5cqbCW1YdIY2lxhhfEGMjfHtoG9HxucwPEZy4/A7kMC87aq2Kmv7mdvxuqGmklFjUU4G2Yp21rdyW00t+kJkFl88pY9vDgwNDvEoK9np73FBcHdkrt2+rZd5FjQx7O0b8WvbzDKZhN1SSse573QdeAHkN+Ichj3p2rBvZq9vUnY2tcNQPqpZYZpJ44GxXqzHdVlzZZpib73mLHViI85c1BZ6OpsIe/6/XSuntevdsz6+8+pI0/yM1dtWVr2Z644P8rmyuj6S53jxkh9aQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBB/9k="};return(t,o)=>($i(),Ui("div",{class:Me(nm+` ${nm}-styles`),"data-id":e.id,onMouseleave:d},[r.value.length>0&&e.show?($i(),Ui(Ni,{key:0},[Zi("div",{class:Me(nm+"__header")},[Zi("div",{class:Me(nm+"__header_button"),onClick:o[0]||(o[0]=e=>(s("chooseStyle",[]),void(l.value="")))},Hh,2),Zi("div",{class:Me(nm+"__header_search")},[Wh,Hn(Zi("textarea",{class:"search","onUpdate:modelValue":o[1]||(o[1]=e=>l.value=e),dir:"ltr",rows:1,placeholder:hn(V)("Type here to search styles ...")},null,8,Yh),[[Zr,l.value]])],2)],2),Zi("div",{class:Me(nm+"__content"),onMouseleave:a},[($i(!0),Ui(Ni,null,bo(r.value,((t,o)=>($i(),Ui("div",{class:Me(nm+"-item"),key:o,onMouseenter:e=>(async e=>{if(!e.imageSrc){if(e.imageLoading)return;e.imageLoading=!0;const t=await p(e.imgName).finally((()=>e.imageLoading=!1));e.imageSrc=t}u.name="zh-CN"==z&&e.name_cn?e.name_cn:e.name,u.positive=e.prompt,u.negative=e.negative_prompt,u.src=e.imageSrc})(t),onMouseleave:Qr((e=>d()),["stop"])},[Zi("span",{class:Me([nm+"-item__tag",{hide:!(e.selectedStyles.includes(t.name)||-1!=c(t.name).indexOf(c(l.value))||t.name_cn&&-1!=c(t.name_cn).indexOf(c(l.value)))}]),onClick:e=>(e=>{let t=n.selectedStyles;t.includes(e.name)?t=t.filter((t=>t!==e.name)):t.push(e.name),s("chooseStyle",t)})(t)},[Zi("input",{type:"checkbox",name:t.name,checked:e.selectedStyles.includes(t.name)},null,8,Xh),Zi("span",null,Be("zh-CN"==hn(z)&&t.name_cn?t.name_cn:t.name),1)],10,Kh)],42,Zh)))),128))],34),(null==u?void 0:u.src)?($i(),Ui("div",{key:0,class:Me(nm+"-preview")},[Zi("img",{src:u.src,ref:"image",alt:"preview",onError:f},null,40,Qh),Zi("div",{class:Me(nm+"-preview__text")},[Zi("b",null,Be(u.name),1),Zi("div",{class:Me(nm+"-preview__prompt")},[u.positive?($i(),Ui("h6",Jh,[qh,Zi("span",null,Be(u.positive),1)])):Ji("",!0),u.negative?($i(),Ui("h6",em,[tm,Zi("span",null,Be(u.negative),1)])):Ji("",!0)],2)],2)],2)):Ji("",!0)],64)):Ji("",!0)],42,Vh))}},im=["data-id"],rm=["onClick"],sm=["name","checked"],am="comfyui-easyuse-selector",lm={__name:"segSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selected:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:t}){const n=e,o=pn([]);bi((e=>n.type),(async e=>{switch(e){case"selfie_multiclass_256x256":o.value=["Background","Hair","Body","Face","Clothes","Others"];break;case"human_parsing_lip":o.value=["Background","Hat","Hair","Glove","Sunglasses","Upper-clothes","Dress","Coat","Socks","Pants","Jumpsuits","Scarf","Skirt","Face","Left-arm","Right-arm","Left-leg","Right-leg","Left-shoe","Right-shoe"]}}),{immediate:!0});const i=t;return(t,r)=>{var s;return $i(),Ui("div",{class:Me(am+` ${am}-seg`),"data-id":e.id},[(null==(s=o.value)?void 0:s.length)>0&&e.show?($i(!0),Ui(Ni,{key:0},bo(o.value,((t,o)=>($i(),Ui("div",{class:Me(am+"-item"),key:o},[Zi("span",{class:Me(am+"-item__tag"),onClick:e=>(e=>{let t=tp(n.selected);t.includes(e)?t=t.filter((t=>t!==e)):t.push(e),i("select",t)})(t)},[Zi("input",{type:"checkbox",name:t,checked:e.selected.includes(t)},null,8,sm),Zi("span",null,Be(hn(V)(t)),1)],10,rm)],2)))),128)):Ji("",!0)],10,im)}}},cm=["data-id"],um=["onMousedown","onDblclick"],dm="comfyui-easyuse-slider",pm="ipadapter layer weights",fm={__name:"sliderControl",props:{id:{type:String|Number,default:""},mode:{type:String,default:""},type:{type:String,default:""},values:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["changeValues","showSlider"],setup(e,{emit:t}){const n=e,o=t,i=(e,t,n)=>(e-t)/(n-t)*100,r=(e,t,o=void 0)=>{if(n.mode===pm){let n={3:2.5,6:1}[t]||0;return{default:12==e?n:0,min:-1,max:3,step:.05,value:void 0!==o?o:12==e?n:0,top:void 0!==o?100-i(o,-1,3)+"%":null,height:void 0!==o?i(o,-1,3)+"%":null}}};bi((e=>n.mode),(async(e,t)=>{var i;if(e!==t&&e===pm)if(!t&&(null==(i=n.values)?void 0:i.length)>0){const e=n.values.map((e=>{const t=e.split(":");return r(n.values.length,t[0],parseFloat(t[1]))}));await o("changeValues",e)}else{let e="sd1"==n.type?16:12,t=Array.from({length:e},((t,n)=>r(e,n)));await o("changeValues",t)}o("showSlider")}),{immediate:!0}),bi((e=>n.type),((e,t)=>{if(e!=t&&n.mode==pm){let e="sd1"==n.type?16:12,t=Array.from({length:e},((t,n)=>r(e,n)));o("changeValues",t)}}));const s=pn(null),a=pn(null);return oo((()=>{document.onmouseup=e=>document.onmousemove=null})),(t,r)=>{var l;return $i(),Ui("div",{class:Me(dm),"data-id":e.id},[(null==(l=e.values)?void 0:l.length)>0&&e.show?($i(!0),Ui(Ni,{key:0},bo(e.values,((t,r)=>($i(),Ui("div",{class:Me([dm+"-item",{positive:3==r&&"sdxl"==e.type&&e.mode==pm},{negative:6==r&&"sdxl"==e.type&&e.mode==pm}]),key:r},[Zi("div",{class:Me(dm+"-item-input")},Be(t.value),3),Zi("div",{class:Me(dm+"-item-scroll"),ref_for:!0,ref_key:"scroll",ref:s},[Zi("div",{class:Me(dm+"-item-bar"),ref_for:!0,ref_key:"bar",ref:a,style:Ie({top:t.top||100-i(t.default,t.min,t.max)+"%"}),onMousedown:e=>((e,t,i)=>{let r=e||window.event,l=s.value[i],c=a.value[i],u=tp(n.values),d=r.clientY-c.offsetTop;document.onmousemove=e=>{let n=(e||window.event).clientY-d;n<0?n=0:n>l.offsetHeight-c.offsetHeight&&(n=l.offsetHeight-c.offsetHeight);let r=(t.max-t.min)/t.step,s=(l.offsetHeight-c.offsetHeight)/r;n=Math.round(n/s)*s;const a=Math.floor(n/(l.offsetHeight-c.offsetHeight)*100)+"%",p=Math.floor((l.offsetHeight-c.offsetHeight-n)/(l.offsetHeight-c.offsetHeight)*100)+"%",f=parseFloat(parseFloat(t.max-(t.max-t.min)*(n/(l.offsetHeight-c.offsetHeight))).toFixed(2));u[i]={...u[i],top:a,height:p,value:f},o("changeValues",u),window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}})(e,t,r),onDblclick:e=>((e,t,i)=>{let r=tp(n.values);r[i]={...r[i],top:null,height:null,value:t.default},o("changeValues",r)})(0,t,r)},null,46,um),Zi("div",{class:Me(dm+"-item-area"),style:Ie({height:t.height||i(t.default,t.min,t.max)+"%"})},null,6)],2),Zi("div",{class:Me(dm+"-item-label")},[Zi("span",null,Be(t.label),1)],2)],2)))),128)):Ji("",!0)],8,cm)}}},hm={__name:"index",setup(e){const t=zh(),{selectors:n,seg_selectors:o,slider_controls:i}=ws(t),r=pn({}),s=async e=>{var o,i,s,a,l,c;await W(1);const u=wp(e,"styles"),d=(null==(o=e.properties.values)?void 0:o.length)>0?e.properties.values:[];let p=tp(n.value);p.push({id:e.id,type:u.value,value:d,show:!1});const f=p.length-1;await t.setSelectors(p);let h=null==(a=null==(s=null==(i=r.value[e.id])?void 0:i._)?void 0:s.vnode)?void 0:a.el;if(!h)return;let m=e.addDOMWidget("select_styles","btn",h);e.properties.values||e.setProperty("values",[]),p[f].show=!0,await t.setSelectors(p);let g=u.value;Object.defineProperty(u,"value",{set:n=>{g=n,p[f].type=n,e.properties.values=[],p[f].value=[],t.setSelectors(p)},get:e=>g}),Object.defineProperty(m,"value",{set:e=>{setTimeout((n=>{p[f].value=e.split(","),t.setSelectors(p)}),150)},get:t=>{var o,i;return e.properties.values=(null==(i=null==(o=n.value)?void 0:o[f])?void 0:i.value)||[],e.properties.values.join(",")}}),((null==(l=e.size)?void 0:l[0])<150||(null==(c=e.size)?void 0:c[1])<150)&&e.setSize([425,500]);const v=e.onRemoved;e.onRemoved=function(){if(v&&(null==v||v.apply(this,arguments)),void 0!==n.value.findIndex((t=>t.id==e.id))){let e=tp(n.value);e.splice(f,1),t.setSelectors(e)}return v}},a=pn({}),l=async e=>{var n,i,r,s;await W(1);const l=wp(e,"method"),c=(null==(n=e.properties.values)?void 0:n.length)>0?e.properties.values:[];let u=tp(o.value);u.push({id:e.id,type:l.value,value:c,show:!1});const d=u.length-1;await t.setSegSelectors(u);let p=null==(s=null==(r=null==(i=a.value[e.id])?void 0:i._)?void 0:r.vnode)?void 0:s.el;if(!p)return;let f=e.addDOMWidget("mask_components","btn",p);e.properties.values||e.setProperty("values",[]),u[d].show=!0,await t.setSegSelectors(u);let h=l.value;Object.defineProperty(l,"value",{set:n=>{h=n,u[d].type=n,e.properties.values=[],u[d].value=[],Sp(e,wp(e,"confidence"),"selfie_multiclass_256x256"===h),e.setSize([300,"selfie_multiclass_256x256"===h?260:500]),t.setSegSelectors(u)},get:e=>h}),Object.defineProperty(f,"value",{set:e=>{setTimeout((n=>{u[d].value=e.split(","),t.setSegSelectors(u)}),150)},get:t=>{var n;return e.properties.values=(null==(n=o.value)?void 0:n[d].value)||[],e.properties.values.join(",")}}),Sp(e,wp(e,"confidence"),"selfie_multiclass_256x256"===h),e.setSize([300,"selfie_multiclass_256x256"===h?260:500]);const m=e.onRemoved;e.onRemoved=function(){if(m&&(null==m||m.apply(this,arguments)),void 0!==o.value.findIndex((t=>t.id==e.id))){let e=tp(o.value);e.splice(d,1),t.setSegSelectors(e)}return m}},c=pn({}),u=async e=>{var n,o,r,s;await W(1);const a=wp(e,"mode"),l=wp(e,"model_type"),u=(null==(n=e.properties.values)?void 0:n.length)>0?e.properties.values:[];let d=tp(i.value);d.push({id:e.id,type:l.value,mode:a.value,value:u,show:!1});const p=d.length-1;await t.setSliderControls(d);let f=null==(s=null==(r=null==(o=c.value[e.id])?void 0:o._)?void 0:r.vnode)?void 0:s.el;if(!f)return;let h=e.addDOMWidget("values","btn",f);e.properties.values||e.setProperty("values",[]),Object.defineProperty(h,"value",{set:function(){},get:t=>{var n;const o=(null==(n=i.value)?void 0:n[p].value)||[];return e.properties.values=o.map(((e,t)=>`${t}:${e.value}`)),e.properties.values.join(",")}}),e.setSize("sdxl"==l.value?[375,320]:[455,320]),l.callback=n=>{d=tp(i.value),d[p].type!=n&&(e.setSize("sdxl"==n?[375,320]:[455,320]),d[p].value=[],d[p].type=n,t.setSliderControls(d))};const m=e.onRemoved;e.onRemoved=function(){if(m&&(null==m||m.apply(this,arguments)),void 0!==i.value.findIndex((t=>t.id==e.id))){let e=tp(i.value);e.splice(p,1),t.setSliderControls(e)}return m}};return oo((e=>{y.registerExtension({name:"Comfy.EasyUse.Components",async beforeRegisterNodeDef(e,t){const n=e.prototype.onNodeCreated;"easy stylesSelector"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await s(this),n}),"easy humanSegmentation"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await l(this),n}),"easy sliderControl"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await u(this),n})}})})),(e,s)=>($i(),Ui(Ni,null,[($i(!0),Ui(Ni,null,bo(hn(n),((e,o)=>($i(),zi(om,{ref_for:!0,ref:t=>{t&&(r.value[e.id]=t)},type:e.type,key:o,id:e.id,show:e.show,selectedStyles:e.value,onChooseStyle:e=>((e,o)=>{let i=tp(n.value);i[o].value=e,t.setSelectors(i)})(e,o)},null,8,["type","id","show","selectedStyles","onChooseStyle"])))),128)),($i(!0),Ui(Ni,null,bo(hn(o),((e,n)=>($i(),zi(lm,{ref_for:!0,ref:t=>{t&&(a.value[e.id]=t)},type:e.type,key:n,id:e.id,show:e.show,selected:e.value,onSelect:e=>((e,n)=>{let i=tp(o.value);i[n].value=e,t.setSegSelectors(i)})(e,n)},null,8,["type","id","show","selected","onSelect"])))),128)),($i(!0),Ui(Ni,null,bo(hn(i),((e,n)=>($i(),zi(fm,{ref_for:!0,ref:t=>{t&&(c.value[e.id]=t)},type:e.type,key:n,id:e.id,show:e.show,mode:e.mode,values:e.value,onChangeValues:e=>((e,n)=>{let o=tp(i.value);o[n].value=e,t.setSliderControls(o)})(e,n),onShowSlider:e=>(e=>{let n=tp(i.value);n[e].show=!0,t.setSliderControls(n)})(n)},null,8,["type","id","show","mode","values","onChangeValues","onShowSlider"])))),128))],64))}};var mm=Object.defineProperty,gm=Object.getOwnPropertySymbols,vm=Object.prototype.hasOwnProperty,ym=Object.prototype.propertyIsEnumerable,bm=(e,t,n)=>t in e?mm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function _m(e){return null==e||""===e||Array.isArray(e)&&0===e.length||!(e instanceof Date)&&"object"==typeof e&&0===Object.keys(e).length}function wm(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Sm(e){return!_m(e)}function xm(e,t=!0){return e instanceof Object&&e.constructor===Object&&(t||0!==Object.keys(e).length)}function km(e,...t){return wm(e)?e(...t):e}function Cm(e,t=!0){return"string"==typeof e&&(t||""!==e)}function Am(e){return Cm(e)?e.replace(/(-|_)/g,"").toLowerCase():e}function Em(e,t="",n={}){const o=Am(t).split("."),i=o.shift();return i?xm(e)?Em(km(e[Object.keys(e).find((e=>Am(e)===i))||""],n),o.join("."),n):void 0:km(e,n)}function Om(e,t=!0){return Array.isArray(e)&&(t||0!==e.length)}function Lm(e){return Sm(e)&&!isNaN(e)}function Tm(e,t){if(t){const n=t.test(e);return t.lastIndex=0,n}return!1}function Im(...e){const t=(e={},n={})=>{const o=((e,t)=>{for(var n in t||(t={}))vm.call(t,n)&&bm(e,n,t[n]);if(gm)for(var n of gm(t))ym.call(t,n)&&bm(e,n,t[n]);return e})({},e);return Object.keys(n).forEach((i=>{xm(n[i])&&i in e&&xm(e[i])?o[i]=t(e[i],n[i]):o[i]=n[i]})),o};return e.reduce(((e,n,o)=>0===o?n:t(e,n)),{})}function Nm(e){return e?e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":"):e}function Pm(e){return Cm(e)?e.replace(/(_)/g,"-").replace(/[A-Z]/g,((e,t)=>0===t?e:"-"+e.toLowerCase())).toLowerCase():e}function Dm(e){return Cm(e)?e.replace(/[A-Z]/g,((e,t)=>0===t?e:"."+e.toLowerCase())).toLowerCase():e}function jm(){const e=new Map;return{on(t,n){let o=e.get(t);return o?o.push(n):o=[n],e.set(t,o),this},off(t,n){let o=e.get(t);return o&&o.splice(o.indexOf(n)>>>0,1),this},emit(t,n){let o=e.get(t);o&&o.slice().map((e=>{e(n)}))},clear(){e.clear()}}}var Mm=Object.defineProperty,Rm=Object.defineProperties,$m=Object.getOwnPropertyDescriptors,Gm=Object.getOwnPropertySymbols,Bm=Object.prototype.hasOwnProperty,Fm=Object.prototype.propertyIsEnumerable,Um=(e,t,n)=>t in e?Mm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zm=(e,t)=>{for(var n in t||(t={}))Bm.call(t,n)&&Um(e,n,t[n]);if(Gm)for(var n of Gm(t))Fm.call(t,n)&&Um(e,n,t[n]);return e},Vm=(e,t)=>Rm(e,$m(t)),Hm=(e,t)=>{var n={};for(var o in e)Bm.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&Gm)for(var o of Gm(e))t.indexOf(o)<0&&Fm.call(e,o)&&(n[o]=e[o]);return n},Wm=jm();function Ym(e,t){Om(e)?e.push(...t||[]):xm(e)&&Object.assign(e,t)}function Zm(e,t=""){if(!["opacity","z-index","line-height","font-weight","flex","flex-grow","flex-shrink","order"].some((e=>t.endsWith(e)))){return`${e}`.trim().split(" ").map((e=>Lm(e)?`${e}px`:e)).join(" ")}return e}function Km(e="",t=""){return function(e){return e.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}(`${Cm(e,!1)&&Cm(t,!1)?`${e}-`:e}${t}`)}function Xm(e="",t=""){return`--${Km(e,t)}`}function Qm(e,t="",n="",o=[],i){if(Cm(e)){const r=/{([^}]*)}/g,s=e.trim();if(Tm(s,r)){const e=s.replaceAll(r,(e=>{const t=e.replace(/{|}/g,"").split(".").filter((e=>!o.some((t=>Tm(e,t)))));return`var(${Xm(n,Pm(t.join("-")))}${Sm(i)?`, ${i}`:""})`})),t=/(\d+\s+[\+\-\*\/]\s+\d+)/g,a=/var\([^)]+\)/g;return Tm(e.replace(a,"0"),t)?`calc(${e})`:e}return Zm(s,t)}if(Lm(e))return Zm(e,t)}function Jm(e,t){return e?`${e}{${t}}`:""}var qm=(...e)=>eg(og.getTheme(),...e),eg=(e={},t,n,o="variable")=>{if(t){const{variable:i,options:r}=og.defaults||{},{prefix:s,transform:a}=(null==e?void 0:e.options)||r||{},l=Tm(t,/{([^}]*)}/g)?t:`{${t}}`;return"value"===o||"strict"===a?og.getTokenValue(t):Qm(l,void 0,s,[i.excludedKeyRegex],n)}return""};function tg(e,t={}){const n=og.defaults.variable,{prefix:o=n.prefix,selector:i=n.selector,excludedKeyRegex:r=n.excludedKeyRegex}=t,s=(e,t="")=>Object.entries(e).reduce(((e,[n,i])=>{const a=Tm(n,r)?Km(t):Km(t,Pm(n)),l=function(e){return xm(e)&&e.hasOwnProperty("value")&&e.hasOwnProperty("type")?e.value:e}(i);if(xm(l)){const{variables:t,tokens:n}=s(l,a);Ym(e.tokens,n),Ym(e.variables,t)}else e.tokens.push((o?a.replace(`${o}-`,""):a).replaceAll("-",".")),function(e,t,n){Cm(t,!1)&&e.push(`${t}:${n};`)}(e.variables,Xm(a),Qm(l,a,o,[r]));return e}),{variables:[],tokens:[]}),{variables:a,tokens:l}=s(e,o);return{value:a,tokens:l,declarations:a.join(""),css:Jm(i,a.join(""))}}var ng={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(e){return{type:"class",selector:e,matched:this.pattern.test(e.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(e){return{type:"attr",selector:`:root${e}`,matched:this.pattern.test(e.trim())}}},media:{pattern:/^@media (.*)$/,resolve(e){return{type:"media",selector:`${e}{:root{[CSS]}}`,matched:this.pattern.test(e.trim())}}},system:{pattern:/^system$/,resolve(e){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(e.trim())}}},custom:{resolve:e=>({type:"custom",selector:e,matched:!0})}},resolve(e){const t=Object.keys(this.rules).filter((e=>"custom"!==e)).map((e=>this.rules[e]));return[e].flat().map((e=>{var n;return null!=(n=t.map((t=>t.resolve(e))).find((e=>e.matched)))?n:this.rules.custom.resolve(e)}))}},_toVariables:(e,t)=>tg(e,{prefix:null==t?void 0:t.prefix}),getCommon({name:e="",theme:t={},params:n,set:o,defaults:i}){var r,s,a,l;const{preset:c,options:u}=t;let d,p,f,h;if(Sm(c)){const{primitive:t,semantic:n}=c,m=n||{},{colorScheme:g}=m,v=Hm(m,["colorScheme"]),y=g||{},{dark:b}=y,_=Hm(y,["dark"]),w=Sm(t)?this._toVariables({primitive:t},u):{},S=Sm(v)?this._toVariables({semantic:v},u):{},x=Sm(_)?this._toVariables({light:_},u):{},k=Sm(b)?this._toVariables({dark:b},u):{},[C,A]=[null!=(r=w.declarations)?r:"",w.tokens],[E,O]=[null!=(s=S.declarations)?s:"",S.tokens||[]],[L,T]=[null!=(a=x.declarations)?a:"",x.tokens||[]],[I,N]=[null!=(l=k.declarations)?l:"",k.tokens||[]];d=this.transformCSS(e,C,"light","variable",u,o,i),p=A;f=`${this.transformCSS(e,`${E}${L}color-scheme:light`,"light","variable",u,o,i)}${this.transformCSS(e,`${I}color-scheme:dark`,"dark","variable",u,o,i)}`,h=[...new Set([...O,...T,...N])]}return{primitive:{css:d,tokens:p},semantic:{css:f,tokens:h}}},getPreset({name:e="",preset:t={},options:n,params:o,set:i,defaults:r,selector:s}){var a,l,c;const u=e.replace("-directive",""),d=t,{colorScheme:p}=d,f=Hm(d,["colorScheme"]),h=p||{},{dark:m}=h,g=Hm(h,["dark"]),v=Sm(f)?this._toVariables({[u]:f},n):{},y=Sm(g)?this._toVariables({[u]:g},n):{},b=Sm(m)?this._toVariables({[u]:m},n):{},[_,w]=[null!=(a=v.declarations)?a:"",v.tokens||[]],[S,x]=[null!=(l=y.declarations)?l:"",y.tokens||[]],[k,C]=[null!=(c=b.declarations)?c:"",b.tokens||[]],A=[...new Set([...w,...x,...C])];return{css:`${this.transformCSS(u,`${_}${S}`,"light","variable",n,i,r,s)}${this.transformCSS(u,k,"dark","variable",n,i,r,s)}`,tokens:A}},getPresetC({name:e="",theme:t={},params:n,set:o,defaults:i}){var r;const{preset:s,options:a}=t,l=null==(r=null==s?void 0:s.components)?void 0:r[e];return this.getPreset({name:e,preset:l,options:a,params:n,set:o,defaults:i})},getPresetD({name:e="",theme:t={},params:n,set:o,defaults:i}){var r;const s=e.replace("-directive",""),{preset:a,options:l}=t,c=null==(r=null==a?void 0:a.directives)?void 0:r[s];return this.getPreset({name:s,preset:c,options:l,params:n,set:o,defaults:i})},getColorSchemeOption(e,t){var n;return this.regex.resolve(null!=(n=e.darkModeSelector)?n:t.options.darkModeSelector)},getLayerOrder(e,t={},n,o){const{cssLayer:i}=t;if(i){return`@layer ${km(i.order||"primeui",n)}`}return""},getCommonStyleSheet({name:e="",theme:t={},params:n,props:o={},set:i,defaults:r}){const s=this.getCommon({name:e,theme:t,params:n,set:i,defaults:r}),a=Object.entries(o).reduce(((e,[t,n])=>e.push(`${t}="${n}"`)&&e),[]).join(" ");return Object.entries(s||{}).reduce(((e,[t,n])=>{if(null==n?void 0:n.css){const o=Nm(null==n?void 0:n.css),i=`${t}-variables`;e.push(``)}return e}),[]).join("")},getStyleSheet({name:e="",theme:t={},params:n,props:o={},set:i,defaults:r}){var s;const a={name:e,theme:t,params:n,set:i,defaults:r},l=null==(s=e.includes("-directive")?this.getPresetD(a):this.getPresetC(a))?void 0:s.css,c=Object.entries(o).reduce(((e,[t,n])=>e.push(`${t}="${n}"`)&&e),[]).join(" ");return l?``:""},createTokens(e={},t,n="",o="",i={}){return Object.entries(e).forEach((([e,r])=>{const s=Tm(e,t.variable.excludedKeyRegex)?n:n?`${n}.${Dm(e)}`:Dm(e),a=o?`${o}.${e}`:e;xm(r)?this.createTokens(r,t,s,a,i):(i[s]||(i[s]={paths:[],computed(e,t={}){if(e){const n=this.paths.find((t=>t.scheme===e))||this.paths.find((e=>"none"===e.scheme));return null==n?void 0:n.computed(e,t.binding)}return this.paths.map((e=>e.computed(e.scheme,t[e.scheme])))}}),i[s].paths.push({path:a,value:r,scheme:a.includes("colorScheme.light")?"light":a.includes("colorScheme.dark")?"dark":"none",computed(e,t={}){const n=/{([^}]*)}/g;let o=r;if(t.name=this.path,t.binding||(t.binding={}),Tm(r,n)){const s=r.trim().replaceAll(n,(n=>{var o,r;const s=n.replace(/{|}/g,"");return null==(r=null==(o=i[s])?void 0:o.computed(e,t))?void 0:r.value})),a=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,l=/var\([^)]+\)/g;o=Tm(s.replace(l,"0"),a)?`calc(${s})`:s}return _m(t.binding)&&delete t.binding,{colorScheme:e,path:this.path,paths:t,value:o.includes("undefined")?void 0:o}}}))})),i},getTokenValue(e,t,n){var o;const i=t.split(".").filter((e=>!Tm(e.toLowerCase(),n.variable.excludedKeyRegex))).join(".");const r=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,s=[null==(o=e[i])?void 0:o.computed(r)].flat().filter((e=>e));return 1===s.length?s[0].value:s.reduce(((e={},t)=>{const n=t,{colorScheme:o}=n,i=Hm(n,["colorScheme"]);return e[o]=i,e}),void 0)},transformCSS(e,t,n,o,i={},r,s,a){if(Sm(t)){const{cssLayer:l}=i;if("style"!==o){const e=this.getColorSchemeOption(i,s),o=a?Jm(a,t):t;t="dark"===n?e.reduce(((e,{selector:t})=>(Sm(t)&&(e+=t.includes("[CSS]")?t.replace("[CSS]",o):Jm(t,o)),e)),""):Jm(null!=a?a:":root",t)}if(l){const n={name:"primeui",order:"primeui"};xm(l)&&(n.name=km(l.name,{name:e,type:o})),Sm(n.name)&&(t=Jm(`@layer ${n.name}`,t),null==r||r.layerNames(n.name))}return t}return""}},og={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(e={}){const{theme:t}=e;t&&(this._theme=Vm(zm({},t),{options:zm(zm({},this.defaults.options),t.options)}),this._tokens=ng.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var e;return(null==(e=this.theme)?void 0:e.preset)||{}},get options(){var e;return(null==(e=this.theme)?void 0:e.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(e){this.update({theme:e}),Wm.emit("theme:change",e)},getPreset(){return this.preset},setPreset(e){this._theme=Vm(zm({},this.theme),{preset:e}),this._tokens=ng.createTokens(e,this.defaults),this.clearLoadedStyleNames(),Wm.emit("preset:change",e),Wm.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(e){this._theme=Vm(zm({},this.theme),{options:e}),this.clearLoadedStyleNames(),Wm.emit("options:change",e),Wm.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(e){this._layerNames.add(e)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(e){return this._loadedStyleNames.has(e)},setLoadedStyleName(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(e){return ng.getTokenValue(this.tokens,e,this.defaults)},getCommon(e="",t){return ng.getCommon({name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPresetC(n)},getDirective(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPresetD(n)},getCustomPreset(e="",t,n,o){const i={name:e,preset:t,options:this.options,selector:n,params:o,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPreset(i)},getLayerOrderCSS(e=""){return ng.getLayerOrder(e,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(e="",t,n="style",o){return ng.transformCSS(e,t,o,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(e="",t,n={}){return ng.getCommonStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(e,t,n={}){return ng.getStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(e){this._loadingStyles.add(e)},onStyleUpdated(e){this._loadingStyles.add(e)},onStyleLoaded(e,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),Wm.emit(`theme:${t}:load`,e),!this._loadingStyles.size&&Wm.emit("theme:load"))}};function ig(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className))}function rg(e,t){if(e&&t){const n=t=>{ig(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)};[t].flat().filter(Boolean).forEach((e=>e.split(" ").forEach(n)))}}function sg(e,t){if(e&&t){const n=t=>{e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")};[t].flat().filter(Boolean).forEach((e=>e.split(" ").forEach(n)))}}function ag(e,t){if(e instanceof HTMLElement){return e.offsetWidth}return 0}function lg(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function cg(e,t={}){if(lg(e)){const n=(t,o)=>{var i,r;const s=(null==(i=null==e?void 0:e.$attrs)?void 0:i[t])?[null==(r=null==e?void 0:e.$attrs)?void 0:r[t]]:[];return[o].flat().reduce(((e,o)=>{if(null!=o){const i=typeof o;if("string"===i||"number"===i)e.push(o);else if("object"===i){const i=Array.isArray(o)?n(t,o):Object.entries(o).map((([e,n])=>"style"!==t||!n&&0!==n?n?e:void 0:`${e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${n}`));e=i.length?e.concat(i.filter((e=>!!e))):e}}return e}),s)};Object.entries(t).forEach((([t,o])=>{if(null!=o){const i=t.match(/^on(.+)/);i?e.addEventListener(i[1].toLowerCase(),o):"p-bind"===t?cg(e,o):(o="class"===t?[...new Set(n("class",o))].join(" ").trim():"style"===t?n("style",o).join(";").trim():o,(e.$attrs=e.$attrs||{})&&(e.$attrs[t]=o),e.setAttribute(t,o))}}))}}function ug(e,t={},...n){if(e){const o=document.createElement(e);return cg(o,t),o.append(...n),o}}function dg(e,t){return lg(e)?e.matches(t)?e:e.querySelector(t):null}function pg(e,t){if(lg(e)){const n=e.getAttribute(t);return isNaN(n)?"true"===n||"false"===n?"true"===n:n:+n}}function fg(e){if(e){let t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),t}return 0}function hg(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function mg(e,t){if(e){return e.offsetHeight}return 0}function gg(e,t=[]){const n=hg(e);return null===n?t:gg(n,t.concat([n]))}function vg(e){let t=[];if(e){let n=gg(e);const o=/(auto|scroll)/,i=e=>{try{let t=window.getComputedStyle(e,null);return o.test(t.getPropertyValue("overflow"))||o.test(t.getPropertyValue("overflowX"))||o.test(t.getPropertyValue("overflowY"))}catch(t){return!1}};for(let e of n){let n=1===e.nodeType&&e.dataset.scrollselectors;if(n){let o=n.split(",");for(let n of o){let o=dg(e,n);o&&i(o)&&t.push(o)}}9!==e.nodeType&&i(e)&&t.push(e)}}return t}function yg(e){return!(null==e||!e.nodeName||!hg(e))}function bg(e){if(e){let t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth),t}return 0}var _g={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(e){return this._loadedStyleNames.has(e)},setLoadedStyleName:function(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName:function(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};function wg(e){return(wg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function xg(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=pn(!1),o=pn(e),i=pn(null),r="undefined"!=typeof window&&window.document&&window.document.createElement?window.document:void 0,s=t.document,a=void 0===s?r:s,l=t.immediate,c=void 0===l||l,u=t.manual,d=void 0!==u&&u,p=t.name,f=void 0===p?"style_".concat(++Cg):p,h=t.id,m=void 0===h?void 0:h,g=t.media,v=void 0===g?void 0:g,y=t.nonce,b=void 0===y?void 0:y,_=t.first,w=void 0!==_&&_,S=t.onMounted,x=void 0===S?void 0:S,k=t.onUpdated,C=void 0===k?void 0:k,A=t.onLoad,E=void 0===A?void 0:A,O=t.props,L=void 0===O?{}:O,T=function(){},I=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(a){var s=xg(xg({},L),r),l=s.name||f,c=s.id||m,u=s.nonce||b;i.value=a.querySelector('style[data-primevue-style-id="'.concat(l,'"]'))||a.getElementById(c)||a.createElement("style"),i.value.isConnected||(o.value=t||e,cg(i.value,{type:"text/css",id:c,media:v,nonce:u}),w?a.head.prepend(i.value):a.head.appendChild(i.value),function(e,t="",n){lg(e)&&null!=n&&e.setAttribute(t,n)}(i.value,"data-primevue-style-id",l),cg(i.value,s),i.value.onload=function(e){return null==E?void 0:E(e,{name:l})},null==x||x(l)),n.value||(T=bi(o,(function(e){i.value.textContent=e,null==C||C(l)}),{immediate:!0}),n.value=!0)}};return c&&!d&&function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ar()?oo(e):t?e():Pn(e)}(I),{id:m,name:f,el:i,css:o,unload:function(){a&&n.value&&(T(),yg(i.value)&&a.head.removeChild(i.value),n.value=!1)},load:I,isLoaded:Qt(n)}}function Eg(e){return(Eg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Og(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,s,a=[],l=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t);else for(;!(l=(o=r.call(n)).done)&&(a.push(o.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Lg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return e})(km(e,{dt:qm}));return n?Ag(Nm(n),Ig({name:this.name},t)):{}},loadCSS:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.load(this.css,e)},loadTheme:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.load(this.theme,t,(function(n){return og.transformCSS(t.name||e.name,n)}))},getCommonTheme:function(e){return og.getCommon(this.name,e)},getComponentTheme:function(e){return og.getComponent(this.name,e)},getDirectiveTheme:function(e){return og.getDirective(this.name,e)},getPresetTheme:function(e,t,n){return og.getCustomPreset(this.name,e,t,n)},getLayerOrderThemeCSS:function(){return og.getLayerOrderCSS(this.name)},getStyleSheet:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.css){var n=km(this.css,{dt:qm}),o=Nm("".concat(n).concat(e)),i=Object.entries(t).reduce((function(e,t){var n=Og(t,2),o=n[0],i=n[1];return e.push("".concat(o,'="').concat(i,'"'))&&e}),[]).join(" ");return'")}return""},getCommonThemeStyleSheet:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return og.getCommonStyleSheet(this.name,e,t)},getThemeStyleSheet:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[og.getStyleSheet(this.name,e,t)];if(this.theme){var o="base"===this.name?"global-style":"".concat(this.name,"-style"),i=km(this.theme,{dt:qm}),r=Nm(og.transformCSS(o,i)),s=Object.entries(t).reduce((function(e,t){var n=Og(t,2),o=n[0],i=n[1];return e.push("".concat(o,'="').concat(i,'"'))&&e}),[]).join(" ");n.push('"))}return n.join("")},extend:function(e){return Ig(Ig({},this),{},{css:void 0,theme:void 0},e)}},Dg={};var jg=function(){let e=[];const t=(t,n,o=0)=>[...e].reverse().find((e=>!0))||{key:t,value:o},n=e=>e&&parseInt(e.style.zIndex,10)||0;return{get:n,set:(n,o,i)=>{o&&(o.style.zIndex=String(((n,o,i=999)=>{const r=t(n,o,i),s=r.value+(r.key===n?0:i)+1;return e.push({key:n,value:s}),s})(n,!0,i)))},clear:t=>{var o;t&&(o=n(t),e=e.filter((e=>e.value!==o)),t.style.zIndex="")},getCurrent:e=>(e=>t(e).value)(e)}}();function Mg(e){return(Mg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rg(e,t,n){return t&&function(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:function(){};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.listener=n}),[{key:"bindScrollListener",value:function(){this.scrollableParents=vg(this.element);for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:"pv_id_")}var Fg=Pg.extend({name:"common"});function Ug(e){return(Ug="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zg(e){return Zg(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wg(e)||Hg()}function Vg(e,t){return Zg(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,s,a=[],l=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=r.call(n)).done)&&(a.push(o.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Wg(e,t)||Hg()}function Hg(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Wg(e,t){if(e){if("string"==typeof e)return Yg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yg(e,t):void 0}}function Yg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:function(){};_g.clearLoadedStyleNames(),Wm.on("theme:change",e)},_getHostInstance:function(e){return e?this.$options.hostName?e.$.type.name===this.$options.hostName?e:this._getHostInstance(e.$parentInstance):e.$parentInstance:void 0},_getPropValue:function(e){var t;return this[e]||(null===(t=this._getHostInstance(this))||void 0===t?void 0:t[e])},_getOptionValue:function(e){return Em(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})},_getPTValue:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=/./g.test(n)&&!!o[n.split(".")[0]],s=this._getPropValue("ptOptions")||(null===(e=this.$primevueConfig)||void 0===e?void 0:e.ptOptions)||{},a=s.mergeSections,l=void 0===a||a,c=s.mergeProps,u=void 0!==c&&c,d=i?r?this._useGlobalPT(this._getPTClassValue,n,o):this._useDefaultPT(this._getPTClassValue,n,o):void 0,p=r?void 0:this._getPTSelf(t,this._getPTClassValue,n,Xg(Xg({},o),{},{global:d||{}})),f=this._getPTDatasets(n);return l||!l&&p?u?this._mergeProps(u,d,p,f):Xg(Xg(Xg({},d),p),f):Xg(Xg({},p),f)},_getPTSelf:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=new Array(t>1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:"",o="data-pc-",i="root"===n&&Sm(null===(e=this.pt)||void 0===e?void 0:e["data-pc-section"]);return"transition"!==n&&Xg(Xg({},"root"===n&&Xg(Qg({},"".concat(o,"name"),Am(i?null===(t=this.pt)||void 0===t?void 0:t["data-pc-section"]:this.$.type.name)),i&&Qg({},"".concat(o,"extend"),Am(this.$.type.name)))),{},Qg({},"".concat(o,"section"),Am(n)))},_getPTClassValue:function(){var e=this._getOptionValue.apply(this,arguments);return Cm(e)||Om(e)?{class:e}:e},_getPT:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2?arguments[2]:void 0,i=function(e){var i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=o?o(e):e,a=Am(n),l=Am(t.$name);return null!==(i=r?a!==l?null==s?void 0:s[a]:void 0:null==s?void 0:s[a])&&void 0!==i?i:s};return null!=e&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:i(e.originalValue),value:i(e.value)}:i(e,!0)},_usePT:function(e,t,n,o){var i=function(e){return t(e,n,o)};if(null!=e&&e.hasOwnProperty("_usept")){var r,s=e._usept||(null===(r=this.$primevueConfig)||void 0===r?void 0:r.ptOptions)||{},a=s.mergeSections,l=void 0===a||a,c=s.mergeProps,u=void 0!==c&&c,d=i(e.originalValue),p=i(e.value);if(void 0===d&&void 0===p)return;return Cm(p)?p:Cm(d)?d:l||!l&&p?u?this._mergeProps(u,d,p):Xg(Xg({},d),p):p}return i(e)},_useGlobalPT:function(e,t,n){return this._usePT(this.globalPT,e,t,n)},_useDefaultPT:function(e,t,n){return this._usePT(this.defaultPT,e,t,n)},ptm:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._getPTValue(this.pt,e,Xg(Xg({},this.$params),t))},ptmi:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nr(this.$_attrsWithoutPT,this.ptm(e,t))},ptmo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._getPTValue(e,t,Xg({instance:this},n),!1)},cx:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,e,Xg(Xg({},this.$params),t))},sx:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var n=this._getOptionValue(this.$style.inlineStyles,e,Xg(Xg({},this.$params),t));return[this._getOptionValue(Fg.inlineStyles,e,Xg(Xg({},this.$params),t)),n]}}},computed:{globalPT:function(){var e,t=this;return this._getPT(null===(e=this.$primevueConfig)||void 0===e?void 0:e.pt,void 0,(function(e){return km(e,{instance:t})}))},defaultPT:function(){var e,t=this;return this._getPT(null===(e=this.$primevueConfig)||void 0===e?void 0:e.pt,void 0,(function(e){return t._getOptionValue(e,t.$name,Xg({},t.$params))||km(e,Xg({},t.$params))}))},isUnstyled:function(){var e;return void 0!==this.unstyled?this.unstyled:null===(e=this.$primevueConfig)||void 0===e?void 0:e.unstyled},$theme:function(){var e;return null===(e=this.$primevueConfig)||void 0===e?void 0:e.theme},$style:function(){return Xg(Xg({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var e;return{nonce:null===(e=this.$primevueConfig)||void 0===e||null===(e=e.csp)||void 0===e?void 0:e.nonce}},$primevueConfig:function(){var e;return null===(e=this.$primevue)||void 0===e?void 0:e.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var e=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:e,props:null==e?void 0:e.$props,state:null==e?void 0:e.$data,attrs:null==e?void 0:e.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter((function(e){var t=Vg(e,1)[0];return null==t?void 0:t.startsWith("pt:")})).reduce((function(e,t){var n=Vg(t,2),o=n[0],i=n[1],r=zg(o.split(":")).slice(1);return null==r||r.reduce((function(e,t,n,o){return!e[t]&&(e[t]=n===o.length-1?i:{}),e[t]}),e),e}),{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter((function(e){var t=Vg(e,1)[0];return!(null!=t&&t.startsWith("pt:"))})).reduce((function(e,t){var n=Vg(t,2),o=n[0],i=n[1];return e[o]=i,e}),{})},$attrSelector:function(){return Bg("pc")}}},qg=Pg.extend({name:"baseicon",css:"\n.p-icon {\n display: inline-block;\n vertical-align: baseline;\n}\n\n.p-icon-spin {\n -webkit-animation: p-icon-spin 2s infinite linear;\n animation: p-icon-spin 2s infinite linear;\n}\n\n@-webkit-keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n@keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n"});function ev(e){return(ev="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function nv(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,o=Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=function(){var e=gv._getOptionValue.apply(gv,arguments);return Cm(e)||Om(e)?{class:e}:e},l=(null===(e=n.binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.ptOptions)||(null===(t=n.$primevueConfig)||void 0===t?void 0:t.ptOptions)||{},c=l.mergeSections,u=void 0===c||c,d=l.mergeProps,p=void 0!==d&&d,f=s?gv._useDefaultPT(n,n.defaultPT(),a,i,r):void 0,h=gv._usePT(n,gv._getPT(o,n.$name),a,i,hv(hv({},r),{},{global:f||{}})),m=gv._getPTDatasets(n,i);return u||!u&&h?p?gv._mergeProps(n,p,f,h,m):hv(hv(hv({},f),h),m):hv(hv({},h),m)},_getPTDatasets:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="data-pc-";return hv(hv({},"root"===t&&mv({},"".concat(n,"name"),Am(e.$name))),{},mv({},"".concat(n,"section"),Am(t)))},_getPT:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,o=function(e){var o,i=n?n(e):e,r=Am(t);return null!==(o=null==i?void 0:i[r])&&void 0!==o?o:i};return null!=e&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:o(e.originalValue),value:o(e.value)}:o(e)},_usePT:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=function(e){return n(e,o,i)};if(null!=t&&t.hasOwnProperty("_usept")){var s,a=t._usept||(null===(s=e.$primevueConfig)||void 0===s?void 0:s.ptOptions)||{},l=a.mergeSections,c=void 0===l||l,u=a.mergeProps,d=void 0!==u&&u,p=r(t.originalValue),f=r(t.value);if(void 0===p&&void 0===f)return;return Cm(f)?f:Cm(p)?p:c||!c&&f?d?gv._mergeProps(e,d,p,f):hv(hv({},p),f):f}return r(t)},_useDefaultPT:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return gv._usePT(e,t,n,o,i)},_loadStyles:function(e,t,n){var o,i=gv._getConfig(t,n),r={nonce:null==i||null===(o=i.csp)||void 0===o?void 0:o.nonce};gv._loadCoreStyles(e.$instance,r),gv._loadThemeStyles(e.$instance,r),gv._loadScopedThemeStyles(e.$instance,r),gv._themeChangeListener((function(){return gv._loadThemeStyles(e.$instance,r)}))},_loadCoreStyles:function(){var e,t,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;!_g.isStyleNameLoaded(null===(e=o.$style)||void 0===e?void 0:e.name)&&null!==(t=o.$style)&&void 0!==t&&t.name&&(Pg.loadCSS(i),o.isUnstyled()&&(null===(n=o.$style)||void 0===n||n.loadCSS(i)),_g.setLoadedStyleName(o.$style.name))},_loadThemeStyles:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(null==n||!n.isUnstyled()){if(!og.isStyleNameLoaded("common")){var i,r,s=(null===(i=n.$style)||void 0===i||null===(r=i.getCommonTheme)||void 0===r?void 0:r.call(i))||{},a=s.primitive,l=s.semantic;Pg.load(null==a?void 0:a.css,hv({name:"primitive-variables"},o)),Pg.load(null==l?void 0:l.css,hv({name:"semantic-variables"},o)),Pg.loadTheme(hv({name:"global-style"},o)),og.setLoadedStyleName("common")}if(!og.isStyleNameLoaded(null===(e=n.$style)||void 0===e?void 0:e.name)&&null!==(t=n.$style)&&void 0!==t&&t.name){var c,u,d,p,f=((null===(c=n.$style)||void 0===c||null===(u=c.getDirectiveTheme)||void 0===u?void 0:u.call(c))||{}).css;null===(d=n.$style)||void 0===d||d.load(f,hv({name:"".concat(n.$style.name,"-variables")},o)),null===(p=n.$style)||void 0===p||p.loadTheme(hv({name:"".concat(n.$style.name,"-style")},o)),og.setLoadedStyleName(n.$style.name)}if(!og.isStyleNameLoaded("layer-order")){var h,m,g=null===(h=n.$style)||void 0===h||null===(m=h.getLayerOrderThemeCSS)||void 0===m?void 0:m.call(h);Pg.load(g,hv({name:"layer-order",first:!0},o)),og.setLoadedStyleName("layer-order")}}},_loadScopedThemeStyles:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e.preset();if(n&&e.$attrSelector){var o,i,r,s=((null===(o=e.$style)||void 0===o||null===(i=o.getPresetTheme)||void 0===i?void 0:i.call(o,n,"[".concat(e.$attrSelector,"]")))||{}).css,a=null===(r=e.$style)||void 0===r?void 0:r.load(s,hv({name:"".concat(e.$attrSelector,"-").concat(e.$style.name)},t));e.scopedStyleEl=a.el}},_themeChangeListener:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};_g.clearLoadedStyleNames(),Wm.on("theme:change",e)},_hook:function(e,t,n,o,i,r){var s,a,l,c="on".concat(Cm(l=t,!1)?l[0].toUpperCase()+l.slice(1):l),u=gv._getConfig(o,i),d=null==n?void 0:n.$instance,p=gv._usePT(d,gv._getPT(null==o||null===(s=o.value)||void 0===s?void 0:s.pt,e),gv._getOptionValue,"hooks.".concat(c)),f=gv._useDefaultPT(d,null==u||null===(a=u.pt)||void 0===a||null===(a=a.directives)||void 0===a?void 0:a[e],gv._getOptionValue,"hooks.".concat(c)),h={el:n,binding:o,vnode:i,prevVnode:r};null==p||p(d,h),null==f||f(d,h)},_mergeProps:function(){for(var e=arguments.length>1?arguments[1]:void 0,t=arguments.length,n=new Array(t>2?t-2:0),o=2;o1&&void 0!==arguments[1]?arguments[1]:{},n=function(n,o,i,r,s){var a,l,c;o._$instances=o._$instances||{};var u=gv._getConfig(i,r),d=o._$instances[e]||{},p=_m(d)?hv(hv({},t),null==t?void 0:t.methods):{};o._$instances[e]=hv(hv({},d),{},{$name:e,$host:o,$binding:i,$modifiers:null==i?void 0:i.modifiers,$value:null==i?void 0:i.value,$el:d.$el||o||void 0,$style:hv({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},null==t?void 0:t.style),$primevueConfig:u,$attrSelector:o.$attrSelector,defaultPT:function(){return gv._getPT(null==u?void 0:u.pt,void 0,(function(t){var n;return null==t||null===(n=t.directives)||void 0===n?void 0:n[e]}))},isUnstyled:function(){var e,t;return void 0!==(null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.unstyled)?null===(t=o.$instance)||void 0===t||null===(t=t.$binding)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.unstyled:null==u?void 0:u.unstyled},theme:function(){var e;return null===(e=o.$instance)||void 0===e||null===(e=e.$primevueConfig)||void 0===e?void 0:e.theme},preset:function(){var e;return null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.dt},ptm:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gv._getPTValue(o.$instance,null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.pt,t,hv({},n))},ptmo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return gv._getPTValue(o.$instance,e,t,n,!1)},cx:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null!==(e=o.$instance)&&void 0!==e&&e.isUnstyled()?void 0:gv._getOptionValue(null===(t=o.$instance)||void 0===t||null===(t=t.$style)||void 0===t?void 0:t.classes,n,hv({},i))},sx:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?gv._getOptionValue(null===(e=o.$instance)||void 0===e||null===(e=e.$style)||void 0===e?void 0:e.inlineStyles,t,hv({},n)):void 0}},p),o.$instance=o._$instances[e],null===(a=(l=o.$instance)[n])||void 0===a||a.call(l,o,i,r,s),o["$".concat(e)]=o.$instance,gv._hook(e,n,o,i,r,s),o.$pd||(o.$pd={}),o.$pd[e]=hv(hv({},null===(c=o.$pd)||void 0===c?void 0:c[e]),{},{name:e,instance:o.$instance})};return{created:function(e,t,o,i){n("created",e,t,o,i)},beforeMount:function(e,t,o,i){e.$attrSelector=Bg("pd"),gv._loadStyles(e,t,o),n("beforeMount",e,t,o,i),function(e){var t,n,o,i,r,s=null===(t=e.$instance)||void 0===t?void 0:t.watch;null==s||null===(n=s.config)||void 0===n||n.call(e.$instance,null===(o=e.$instance)||void 0===o?void 0:o.$primevueConfig),cv.on("config:change",(function(t){var n,o=t.newValue,i=t.oldValue;return null==s||null===(n=s.config)||void 0===n?void 0:n.call(e.$instance,o,i)})),null==s||null===(i=s["config.ripple"])||void 0===i||i.call(e.$instance,null===(r=e.$instance)||void 0===r||null===(r=r.$primevueConfig)||void 0===r?void 0:r.ripple),cv.on("config:ripple:change",(function(t){var n,o=t.newValue,i=t.oldValue;return null==s||null===(n=s["config.ripple"])||void 0===n?void 0:n.call(e.$instance,o,i)}))}(e)},mounted:function(e,t,o,i){gv._loadStyles(e,t,o),n("mounted",e,t,o,i)},beforeUpdate:function(e,t,o,i){n("beforeUpdate",e,t,o,i)},updated:function(e,t,o,i){gv._loadStyles(e,t,o),n("updated",e,t,o,i)},beforeUnmount:function(e,t,o,i){n("beforeUnmount",e,t,o,i)},unmounted:function(e,t,o,i){var r;null===(r=e.$instance)||void 0===r||null===(r=r.scopedStyleEl)||void 0===r||null===(r=r.value)||void 0===r||r.remove(),n("unmounted",e,t,o,i)}}},extend:function(){var e=dv(gv._getMeta.apply(gv,arguments),2),t=e[0],n=e[1];return hv({extend:function(){var e=dv(gv._getMeta.apply(gv,arguments),2),t=e[0],o=e[1];return gv.extend(t,hv(hv(hv({},n),null==n?void 0:n.methods),o))}},gv._extend(t,n))}},vv=Pg.extend({name:"ripple-directive",theme:function(e){var t=e.dt;return"\n.p-ink {\n display: block;\n position: absolute;\n background: ".concat(t("ripple.background"),";\n border-radius: 100%;\n transform: scale(0);\n pointer-events: none;\n}\n\n.p-ink-active {\n animation: ripple 0.4s linear;\n}\n\n@keyframes ripple {\n 100% {\n opacity: 0;\n transform: scale(2.5);\n }\n}\n")},classes:{root:"p-ink"}});function yv(e){return(yv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bv(e){return function(e){if(Array.isArray(e))return _v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return _v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_v(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);ne.length)&&(t=e.length);for(var n=0,o=Array(t);n0||navigator.msMaxTouchPoints>0||o.hide(e),window.removeEventListener("resize",t)})),n.addEventListener("mouseleave",(function t(){o.hide(e),n.removeEventListener("mouseleave",t)})),this.bindScrollListener(e),jg.set("tooltip",n,e.$_ptooltipZIndex)}},show:function(e,t,n){var o=this;void 0!==n?this.timer=setTimeout((function(){return o.tooltipActions(e,t)}),n):this.tooltipActions(e,t)},tooltipRemoval:function(e){this.remove(e),this.unbindScrollListener(e)},hide:function(e,t){var n=this;clearTimeout(this.timer),void 0!==t?setTimeout((function(){return n.tooltipRemoval(e)}),t):this.tooltipRemoval(e)},getTooltipElement:function(e){return document.getElementById(e.$_ptooltipId)},create:function(e){var t=e.$_ptooltipModifiers,n=ug("div",{class:!this.isUnstyled()&&this.cx("arrow"),"p-bind":this.ptm("arrow",{context:t})}),o=ug("div",{class:!this.isUnstyled()&&this.cx("text"),"p-bind":this.ptm("text",{context:t})});e.$_ptooltipEscape?(o.innerHTML="",o.appendChild(document.createTextNode(e.$_ptooltipValue))):o.innerHTML=e.$_ptooltipValue;var i=ug("div",Iv(Iv({id:e.$_ptooltipIdAttr,role:"tooltip",style:{display:"inline-block",width:e.$_ptooltipFitContent?"fit-content":void 0,pointerEvents:!this.isUnstyled()&&e.$_ptooltipAutoHide&&"none"},class:[!this.isUnstyled()&&this.cx("root"),e.$_ptooltipClass]},this.$attrSelector,""),"p-bind",this.ptm("root",{context:t})),n,o);return document.body.appendChild(i),e.$_ptooltipId=i.id,this.$el=i,i},remove:function(e){if(e){var t=this.getTooltipElement(e);t&&t.parentElement&&(jg.clear(t),document.body.removeChild(t)),e.$_ptooltipId=null}},align:function(e){var t=e.$_ptooltipModifiers;t.top?(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignTop(e))):t.left?(this.alignLeft(e),this.isOutOfBounds(e)&&(this.alignRight(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignLeft(e))))):t.bottom?(this.alignBottom(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&this.alignBottom(e))):(this.alignRight(e),this.isOutOfBounds(e)&&(this.alignLeft(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignRight(e)))))},getHostOffset:function(e){var t=e.getBoundingClientRect();return{left:t.left+function(){let e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}(),top:t.top+function(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}()}},alignRight:function(e){this.preAlign(e,"right");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+ag(e),i=n.top+(mg(e)-mg(t))/2;t.style.left=o+"px",t.style.top=i+"px"},alignLeft:function(e){this.preAlign(e,"left");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left-ag(t),i=n.top+(mg(e)-mg(t))/2;t.style.left=o+"px",t.style.top=i+"px"},alignTop:function(e){this.preAlign(e,"top");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+(ag(e)-ag(t))/2,i=n.top-mg(t);t.style.left=o+"px",t.style.top=i+"px"},alignBottom:function(e){this.preAlign(e,"bottom");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+(ag(e)-ag(t))/2,i=n.top+mg(e);t.style.left=o+"px",t.style.top=i+"px"},preAlign:function(e,t){var n=this.getTooltipElement(e);n.style.left="-999px",n.style.top="-999px",sg(n,"p-tooltip-".concat(n.$_ptooltipPosition)),!this.isUnstyled()&&rg(n,"p-tooltip-".concat(t)),n.$_ptooltipPosition=t,n.setAttribute("data-p-position",t);var o=dg(n,'[data-pc-section="arrow"]');o.style.top="bottom"===t?"0":"right"===t||"left"===t||"right"!==t&&"left"!==t&&"top"!==t&&"bottom"!==t?"50%":null,o.style.bottom="top"===t?"0":null,o.style.left="right"===t||"right"!==t&&"left"!==t&&"top"!==t&&"bottom"!==t?"0":"top"===t||"bottom"===t?"50%":null,o.style.right="left"===t?"0":null},isOutOfBounds:function(e){var t=this.getTooltipElement(e),n=t.getBoundingClientRect(),o=n.top,i=n.left,r=ag(t),s=mg(t),a=function(){let e=window,t=document,n=t.documentElement,o=t.getElementsByTagName("body")[0];return{width:e.innerWidth||n.clientWidth||o.clientWidth,height:e.innerHeight||n.clientHeight||o.clientHeight}}();return i+r>a.width||i<0||o<0||o+s>a.height},getTarget:function(e){return ig(e,"p-inputwrapper")?dg(e,"input"):e},getModifiers:function(e){return e.modifiers&&Object.keys(e.modifiers).length?e.modifiers:e.arg&&"object"===Nv(e.arg)?Object.entries(e.arg).reduce((function(e,t){var n=Lv(t,2),o=n[0],i=n[1];return"event"!==o&&"position"!==o||(e[i]=!0),e}),{}):{}}}}),Dv={name:"Card",extends:{name:"BaseCard",extends:Jg,style:Pg.extend({name:"card",theme:function(e){var t=e.dt;return"\n.p-card {\n background: ".concat(t("card.background"),";\n color: ").concat(t("card.color"),";\n box-shadow: ").concat(t("card.shadow"),";\n border-radius: ").concat(t("card.border.radius"),";\n display: flex;\n flex-direction: column;\n}\n\n.p-card-caption {\n display: flex;\n flex-direction: column;\n gap: ").concat(t("card.caption.gap"),";\n}\n\n.p-card-body {\n padding: ").concat(t("card.body.padding"),";\n display: flex;\n flex-direction: column;\n gap: ").concat(t("card.body.gap"),";\n}\n\n.p-card-title {\n font-size: ").concat(t("card.title.font.size"),";\n font-weight: ").concat(t("card.title.font.weight"),";\n}\n\n.p-card-subtitle {\n color: ").concat(t("card.subtitle.color"),";\n}\n")},classes:{root:"p-card p-component",header:"p-card-header",body:"p-card-body",caption:"p-card-caption",title:"p-card-title",subtitle:"p-card-subtitle",content:"p-card-content",footer:"p-card-footer"}}),provide:function(){return{$pcCard:this,$parentInstance:this}}},inheritAttrs:!1};Dv.render=function(e,t,n,o,i,r){return $i(),Ui("div",nr({class:e.cx("root")},e.ptmi("root")),[e.$slots.header?($i(),Ui("div",nr({key:0,class:e.cx("header")},e.ptm("header")),[_o(e.$slots,"header")],16)):Ji("",!0),Zi("div",nr({class:e.cx("body")},e.ptm("body")),[e.$slots.title||e.$slots.subtitle?($i(),Ui("div",nr({key:0,class:e.cx("caption")},e.ptm("caption")),[e.$slots.title?($i(),Ui("div",nr({key:0,class:e.cx("title")},e.ptm("title")),[_o(e.$slots,"title")],16)):Ji("",!0),e.$slots.subtitle?($i(),Ui("div",nr({key:1,class:e.cx("subtitle")},e.ptm("subtitle")),[_o(e.$slots,"subtitle")],16)):Ji("",!0)],16)):Ji("",!0),Zi("div",nr({class:e.cx("content")},e.ptm("content")),[_o(e.$slots,"content")],16),e.$slots.footer?($i(),Ui("div",nr({key:1,class:e.cx("footer")},e.ptm("footer")),[_o(e.$slots,"footer")],16)):Ji("",!0)],16)],16)};const jv={class:"no-result-placeholder"},Mv={class:"no-result-placeholder-content"},Rv={key:0},$v={__name:"noResultsPlaceholder",props:{icon:{type:String,default:"",required:!1},iconSize:{type:String,default:"3rem",required:!1},title:{type:String,required:!0},message:{type:String,required:!1},buttonLabel:{type:String,default:"",required:!1}},emits:["action"],setup:e=>(t,n)=>($i(),Ui("div",jv,[Ki(hn(Dv),null,{content:Vn((()=>[Zi("div",Mv,[Zi("i",{class:Me(e.icon),style:Ie({"font-size":e.iconSize,"margin-bottom":".5rem"})},null,6),Zi("h3",null,Be(e.title),1),e.message?($i(),Ui("p",Rv,Be(e.message),1)):Ji("",!0),e.buttonLabel?($i(),zi(hn(Ev),{key:1,label:e.buttonLabel,onClick:n[0]||(n[0]=e=>t.$emit("action")),class:"p-button-text"},null,8,["label"])):Ji("",!0)])])),_:1})]))};var Gv=Pg.extend({name:"inputtext",theme:function(e){var t=e.dt;return"\n.p-inputtext {\n font-family: inherit;\n font-feature-settings: inherit;\n font-size: 1rem;\n color: ".concat(t("inputtext.color"),";\n background: ").concat(t("inputtext.background"),";\n padding: ").concat(t("inputtext.padding.y")," ").concat(t("inputtext.padding.x"),";\n border: 1px solid ").concat(t("inputtext.border.color"),";\n transition: background ").concat(t("inputtext.transition.duration"),", color ").concat(t("inputtext.transition.duration"),", border-color ").concat(t("inputtext.transition.duration"),", outline-color ").concat(t("inputtext.transition.duration"),", box-shadow ").concat(t("inputtext.transition.duration"),";\n appearance: none;\n border-radius: ").concat(t("inputtext.border.radius"),";\n outline-color: transparent;\n box-shadow: ").concat(t("inputtext.shadow"),";\n}\n\n.p-inputtext:enabled:hover {\n border-color: ").concat(t("inputtext.hover.border.color"),";\n}\n\n.p-inputtext:enabled:focus {\n border-color: ").concat(t("inputtext.focus.border.color"),";\n box-shadow: ").concat(t("inputtext.focus.ring.shadow"),";\n outline: ").concat(t("inputtext.focus.ring.width")," ").concat(t("inputtext.focus.ring.style")," ").concat(t("inputtext.focus.ring.color"),";\n outline-offset: ").concat(t("inputtext.focus.ring.offset"),";\n}\n\n.p-inputtext.p-invalid {\n border-color: ").concat(t("inputtext.invalid.border.color"),";\n}\n\n.p-inputtext.p-variant-filled {\n background: ").concat(t("inputtext.filled.background"),";\n}\n\n.p-inputtext.p-variant-filled:enabled:focus {\n background: ").concat(t("inputtext.filled.focus.background"),";\n}\n\n.p-inputtext:disabled {\n opacity: 1;\n background: ").concat(t("inputtext.disabled.background"),";\n color: ").concat(t("inputtext.disabled.color"),";\n}\n\n.p-inputtext::placeholder {\n color: ").concat(t("inputtext.placeholder.color"),";\n}\n\n.p-inputtext-sm {\n font-size: ").concat(t("inputtext.sm.font.size"),";\n padding: ").concat(t("inputtext.sm.padding.y")," ").concat(t("inputtext.sm.padding.x"),";\n}\n\n.p-inputtext-lg {\n font-size: ").concat(t("inputtext.lg.font.size"),";\n padding: ").concat(t("inputtext.lg.padding.y")," ").concat(t("inputtext.lg.padding.x"),";\n}\n\n.p-inputtext-fluid {\n width: 100%;\n}\n")},classes:{root:function(e){var t=e.instance,n=e.props;return["p-inputtext p-component",{"p-filled":t.filled,"p-inputtext-sm":"small"===n.size,"p-inputtext-lg":"large"===n.size,"p-invalid":n.invalid,"p-variant-filled":n.variant?"filled"===n.variant:"filled"===t.$primevue.config.inputStyle||"filled"===t.$primevue.config.inputVariant,"p-inputtext-fluid":t.hasFluid}]}}}),Bv={name:"InputText",extends:{name:"BaseInputText",extends:Jg,props:{modelValue:null,size:{type:String,default:null},invalid:{type:Boolean,default:!1},variant:{type:String,default:null},fluid:{type:Boolean,default:null}},style:Gv,provide:function(){return{$pcInputText:this,$parentInstance:this}}},inheritAttrs:!1,emits:["update:modelValue"],inject:{$pcFluid:{default:null}},methods:{getPTOptions:function(e){return("root"===e?this.ptmi:this.ptm)(e,{context:{filled:this.filled,disabled:this.$attrs.disabled||""===this.$attrs.disabled}})},onInput:function(e){this.$emit("update:modelValue",e.target.value)}},computed:{filled:function(){return null!=this.modelValue&&this.modelValue.toString().length>0},hasFluid:function(){return _m(this.fluid)?!!this.$pcFluid:this.fluid}}},Fv=["value","aria-invalid"];Bv.render=function(e,t,n,o,i,r){return $i(),Ui("input",nr({type:"text",class:e.cx("root"),value:e.modelValue,"aria-invalid":e.invalid||void 0,onInput:t[0]||(t[0]=function(){return r.onInput&&r.onInput.apply(r,arguments)})},r.getPTOptions("root")),null,16,Fv)};const Uv={class:"left flex-1"},zv={key:1,class:"edit"},Vv={key:2,class:"label"},Hv={class:"right toolbar"},Wv={key:0,class:"nodes"},Yv={__name:"group",props:{item:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup(e){const t=e,n=np(),o=pn(!1),i=pn(null),r=pn(""),s=e=>{var o,i;let r=t.item;if(!(null==(o=r.info)?void 0:o.is_edit)&&(null==(i=r.children)?void 0:i.length)>0){let e=y.canvas.graph._groups.find((e=>e.pos[0]==r.info.pos[0]&&e.pos[1]==r.info.pos[1]));e&&(e.show_nodes=!e.show_nodes,n.setGroups(y.canvas.graph._groups))}},a=async()=>{let e=t.item,i=y.canvas.graph._groups.find((t=>t.pos[0]==e.info.pos[0]&&t.pos[1]==e.info.pos[1]));i?(i.is_edit=!1,i.title=r.value,await n.setGroups(y.canvas.graph._groups),o.value=!1):o.value=!1};return(l,c)=>{var u,d,p;return $i(),Ui(Ni,null,[Zi("div",{class:Me("comfyui-easyuse-map-nodes-group"),onClick:s},[Zi("div",Uv,[e.item.children?($i(),Ui("i",{key:0,class:Me(["icon",e.item.info.show_nodes?"pi pi-folder-open":"pi pi-folder"]),style:Ie({color:e.item.info.color})},null,6)):Ji("",!0),(null==(u=e.item.info)?void 0:u.is_edit)?($i(),Ui("div",zv,[Ki(hn(Bv),{ref_key:"modifyRef",ref:i,modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=e=>r.value=e),variant:"outline",size:"small",type:"text",onBlur:a,onKeydown:[qr(a,["enter"]),qr(a,["esc"])],style:{width:"100%"}},null,8,["modelValue"])])):($i(),Ui("div",Vv,[Zi("span",{onDblclick:c[1]||(c[1]=Qr((s=>(async()=>{var e,s;if(o.value)return;let a=t.item,l=y.canvas.graph._groups.find((e=>e.pos[0]==a.info.pos[0]&&e.pos[1]==a.info.pos[1]));l&&(l.is_edit=!l.is_edit,r.value=l.is_edit?a.info.title:"",await n.setGroups(y.canvas.graph._groups),o.value=!0,null==(s=null==(e=i.value)?void 0:e[0])||s.$el.focus())})(e.item)),["stop"]))},Be(e.item.info.title),33)]))]),Zi("div",Hv,[(null==(d=e.item.children)?void 0:d.length)>0?($i(),zi(hn(Ev),{key:0,size:"small",icon:e.item.children.find((e=>e.mode==hn(j).ALWAYS))?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:c[2]||(c[2]=Qr((e=>l.$emit("changeMode")),["stop"])),onMousedown:c[3]||(c[3]=Qr((e=>l.$emit("mousedown")),["stop"])),onMouseup:c[4]||(c[4]=Qr((e=>l.$emit("mouseup")),["stop"]))},null,8,["icon"])):Ji("",!0)])]),(null==(p=e.item.children)?void 0:p.length)>0&&e.item.info.show_nodes?($i(),Ui("div",Wv,[_o(l.$slots,"default")])):Ji("",!0)],64)}}},Zv={key:1,class:"label error"},Kv={class:"right toolbar"},Xv={__name:"node",props:{node:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup:e=>(t,n)=>($i(),Ui("div",{class:Me(["comfyui-easyuse-map-nodes-node",{never:void 0!==e.node.mode&&e.node.mode==hn(j).NEVER},{bypass:void 0!==e.node.mode&&e.node.mode==hn(j).BYPASS}])},[void 0!==e.node.title?($i(),Ui("span",{key:0,class:"label",onDblclick:n[0]||(n[0]=Qr((t=>hn(Lp)(e.node.id)),["stop"]))},Be(e.node.title),33)):($i(),Ui("span",Zv,Be(e.node.type),1)),Zi("div",Kv,[Ki(hn(Ev),{size:"small",icon:e.node.mode==hn(j).ALWAYS?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:n[1]||(n[1]=Qr((e=>t.$emit("changeMode")),["stop"])),onMousedown:n[2]||(n[2]=Qr((e=>t.$emit("mousedown")),["stop"])),onMouseup:n[3]||(n[3]=Qr((e=>t.$emit("mouseup")),["stop"]))},null,8,["icon"])])],2))},Qv={class:"title"},Jv={class:"toolbar"},qv={key:0},ey={key:1,class:"no_result",style:{height:"100%"}},ty="comfyui-easyuse-map-nodes",ny={__name:"nodesMap",setup(e){const t=np(),{groups_nodes:n,groups:o}=ws(t),i=pn(!1),r=e=>{i.value=!i.value,y.canvas.graph._groups.forEach((e=>{e.show_nodes=i.value})),t.setGroups(y.canvas.graph._groups)};let s,a=0,l=0,c=!1;const u=(e,n=!1)=>{if(c)return void(c=!1);const o=e.children.find((e=>e.mode==j.ALWAYS)),i=e.children.map((e=>e.id));y.canvas.graph._nodes.forEach((e=>{i.includes(e.id)&&(e.mode=o?n?j.NEVER:j.BYPASS:j.ALWAYS,e.graph.change())})),t.setNodes(y.canvas.graph._nodes)},d=(e,n=!1)=>{if(c)return void(c=!1);const o=e.mode==j.ALWAYS,i=y.canvas.graph._nodes.find((t=>t.id==e.id));i&&(i.mode=o?n?j.NEVER:j.BYPASS:j.ALWAYS,i.graph.change(),t.setNodes(y.canvas.graph._nodes))},p=(e,t="group")=>{a=(new Date).getTime(),clearTimeout(s),s=setTimeout((n=>{"group"==t?u(e,!0):d(e,!0)}),500)},f=e=>{l=(new Date).getTime(),l-a>500&&(c=!0),clearTimeout(s)};return(e,t)=>{var s,a;return $i(),Ui("div",{class:Me(ty)},[Zi("div",{class:Me(ty+"__header")},[Zi("div",Qv,Be(hn(V)("Nodes Map",!0)),1),Zi("div",Jv,[(null==(s=hn(o))?void 0:s.length)>0?Hn(($i(),zi(hn(Ev),{key:0,icon:i.value?"pi pi-angle-double-down":"pi pi-angle-double-up",text:"",rounded:"",severity:"secondary",onClick:r,size:"small"},null,8,["icon"])),[[hn(Pv),i.value?hn(V)("Collapse All"):hn(V)("Expand All"),void 0,{right:!0}]]):Ji("",!0)])],2),Zi("div",{class:Me(ty+"__content")},[(null==(a=hn(n))?void 0:a.length)>0?($i(),Ui("ol",qv,[($i(!0),Ui(Ni,null,bo(hn(n),((e,t)=>($i(),Ui("li",{key:t},[void 0!==e.children?($i(),zi(Yv,{key:0,item:e,onChangeMode:t=>u(e),onMousedown:t=>p(e,"group"),onMouseup:f},{default:Vn((()=>[($i(!0),Ui(Ni,null,bo(e.children,((e,t)=>($i(),zi(Xv,{key:t,node:e,onChangeMode:t=>d(e),onMousedown:t=>p(e,"node"),onMouseup:f},null,8,["node","onChangeMode","onMousedown"])))),128))])),_:2},1032,["item","onChangeMode","onMousedown"])):($i(),zi(Xv,{key:1,node:e.info,onChangeMode:t=>d(e.info),onMousedown:t=>p(e.info,"node"),onMouseup:f},null,8,["node","onChangeMode","onMousedown"]))])))),128))])):($i(),Ui("div",ey,[Ki($v,{icon:"pi pi-sitemap",title:hn(V)("No Nodes",!0),message:hn(V)("No nodes found in the map",!0)},null,8,["title","message"])]))],2)])}}},oy={__name:"index",setup(e){const t=np();return oo((e=>{t.watchGraph()})),ao((e=>{})),(e,t)=>($i(),Ui("div",{class:Me("comfyui-easyuse-map")},[Ki(ny)]))}},iy={__name:"App",setup(e){const t=e=>{y.extensionManager.registerSidebarTab({id:M,icon:"pi pi-sitemap",title:V("Nodes Map",!0),tooltip:V("Nodes Map",!0),type:"custom",render:e=>{e.style.height="100%",((...e)=>{ns().render(...e)})(function(e,t,n){const o=arguments.length;return 2===o?ue(t)&&!ie(t)?Vi(t)?Ki(e,null,[t]):Ki(e,t):Ki(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):3===o&&Vi(n)&&(n=[n]),Ki(e,t,n))}(oy,{}),e)}})};return oo((e=>{try{t()}catch(n){}})),(e,t)=>($i(),zi(hm))}};var ry="equals",sy="notEquals";function ay(e){return(ay="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function cy(e){for(var t=1;t{const t=ns().createApp(...e),{mount:n}=t;return t.mount=e=>{const o=function(e){if(le(e)){return document.querySelector(e)}return e}(e);if(!o)return;const i=t._component;ae(i)||i.render||i.template||(i.template=o.innerHTML),o.innerHTML="";const r=n(o,!1,function(e){if(e instanceof SVGElement)return"svg";if("function"==typeof MathMLElement&&e instanceof MathMLElement)return"mathml"}(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t})(iy);yy.use(my),yy.use(function(){const e=We(!0),t=e.run((()=>pn({})));let n=[],o=[];const i=rn({install(e){is(i),i._a=e,e.provide(rs,i),e.config.globalProperties.$pinia=i,o.forEach((e=>n.push(e))),o=[]},use(e){return this._a?n.push(e):o.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}()),yy.mount("#"+vy.id); From daaa44eddfbb468b4fb8809a9006d217d8f743e5 Mon Sep 17 00:00:00 2001 From: yolain Date: Thu, 15 Aug 2024 21:40:49 +0800 Subject: [PATCH 2/4] Fix DualCFG didn't display cfg and cfg_negative on preSamplingCustom --- web_version/v2/easyuse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_version/v2/easyuse.js b/web_version/v2/easyuse.js index ddb9647..4ad07ba 100644 --- a/web_version/v2/easyuse.js +++ b/web_version/v2/easyuse.js @@ -27,4 +27,4 @@ let ze,Ve;class He{constructor(e=!1){this.detached=e,this._active=!0,this.effect * (c) 2024 Eduardo San Martin Morote * @license MIT */ -let os;const is=e=>os=e,rs=Symbol();function ss(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var as,ls;(ls=as||(as={})).direct="direct",ls.patchObject="patch object",ls.patchFunction="patch function";const cs=()=>{};function us(e,t,n,o=cs){e.push(t);const i=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),o())};var r;return!n&&Ye()&&(r=i,ze&&ze.cleanups.push(r)),i}function ds(e,...t){e.slice().forEach((e=>{e(...t)}))}const ps=e=>e(),fs=Symbol(),hs=Symbol();function ms(e,t){e instanceof Map&&t instanceof Map?t.forEach(((t,n)=>e.set(n,t))):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const o=t[n],i=e[n];ss(i)&&ss(o)&&e.hasOwnProperty(n)&&!dn(o)&&!qt(o)?e[n]=ms(i,o):e[n]=o}return e}const gs=Symbol();const{assign:vs}=Object;function ys(e,t,n,o){const{state:i,actions:r,getters:s}=t,a=n.state.value[e];let l;return l=bs(e,(function(){a||(n.state.value[e]=i?i():{});const t=function(e){const t=ie(e)?new Array(e.length):{};for(const n in e)t[n]=_n(e,n);return t}(n.state.value[e]);return vs(t,r,Object.keys(s||{}).reduce(((t,o)=>(t[o]=rn(_r((()=>{is(n);const t=n._s.get(e);return s[o].call(t,t)}))),t)),{}))}),t,n,o,!0),l}function bs(e,t,n={},o,i,r){let s;const a=vs({actions:{}},n),l={deep:!0};let c,u,d,p=[],f=[];const h=o.state.value[e];let m;function g(t){let n;c=u=!1,"function"==typeof t?(t(o.state.value[e]),n={type:as.patchFunction,storeId:e,events:d}):(ms(o.state.value[e],t),n={type:as.patchObject,payload:t,storeId:e,events:d});const i=m=Symbol();Pn().then((()=>{m===i&&(c=!0)})),u=!0,ds(p,n,o.state.value[e])}r||h||(o.state.value[e]={}),pn({});const v=r?function(){const{state:e}=n,t=e?e():{};this.$patch((e=>{vs(e,t)}))}:cs;const y=(t,n="")=>{if(fs in t)return t[hs]=n,t;const i=function(){is(o);const n=Array.from(arguments),r=[],s=[];let a;ds(f,{args:n,name:i[hs],store:b,after:function(e){r.push(e)},onError:function(e){s.push(e)}});try{a=t.apply(this&&this.$id===e?this:b,n)}catch(l){throw ds(s,l),l}return a instanceof Promise?a.then((e=>(ds(r,e),e))).catch((e=>(ds(s,e),Promise.reject(e)))):(ds(r,a),a)};return i[fs]=!0,i[hs]=n,i},b=Xt({_p:o,$id:e,$onAction:us.bind(null,f),$patch:g,$reset:v,$subscribe(t,n={}){const i=us(p,t,n.detached,(()=>r())),r=s.run((()=>bi((()=>o.state.value[e]),(o=>{("sync"===n.flush?u:c)&&t({storeId:e,type:as.direct,events:d},o)}),vs({},l,n))));return i},$dispose:function(){s.stop(),p=[],f=[],o._s.delete(e)}});o._s.set(e,b);const _=(o._a&&o._a.runWithContext||ps)((()=>o._e.run((()=>(s=We()).run((()=>t({action:y})))))));for(const x in _){const t=_[x];if(dn(t)&&(!dn(S=t)||!S.effect)||qt(t))r||(!h||ss(w=t)&&w.hasOwnProperty(gs)||(dn(t)?t.value=h[x]:ms(t,h[x])),o.state.value[e][x]=t);else if("function"==typeof t){const e=y(t,x);_[x]=e,a.actions[x]=t}}var w,S;return vs(b,_),vs(on(b),_),Object.defineProperty(b,"$state",{get:()=>o.state.value[e],set:e=>{g((t=>{vs(t,e)}))}}),o._p.forEach((e=>{vs(b,s.run((()=>e({store:b,app:o._a,pinia:o,options:a}))))})),h&&r&&n.hydrate&&n.hydrate(b.$state,h),c=!0,u=!0,b}function _s(e,t,n){let o,i;const r="function"==typeof t;function s(e,n){(e=e||(!!(sr||Fn||Uo)?zo(rs,null):null))&&is(e),(e=os)._s.has(o)||(r?bs(o,t,i,e):ys(o,i,e));return e._s.get(o)}return"string"==typeof e?(o=e,i=r?n:t):(i=e,o=e.id),s.$id=o,s}function ws(e){{e=on(e);const t={};for(const n in e){const o=e[n];(dn(o)||qt(o))&&(t[n]=bn(e,n))}return t}}var Ss="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ks=function(){this.__data__=[],this.size=0};var Cs=function(e,t){return e===t||e!=e&&t!=t},As=Cs;var Es=function(e,t){for(var n=e.length;n--;)if(As(e[n][0],t))return n;return-1},Os=Es,Ls=Array.prototype.splice;var Ts=Es;var Is=Es;var Ns=Es;var Ps=ks,Ds=function(e){var t=this.__data__,n=Os(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ls.call(t,n,1),--this.size,!0)},js=function(e){var t=this.__data__,n=Ts(t,e);return n<0?void 0:t[n][1]},Ms=function(e){return Is(this.__data__,e)>-1},Rs=function(e,t){var n=this.__data__,o=Ns(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this};function $s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},ec=sa,tc=ql,nc=Il,oc={};oc["[object Float32Array]"]=oc["[object Float64Array]"]=oc["[object Int8Array]"]=oc["[object Int16Array]"]=oc["[object Int32Array]"]=oc["[object Uint8Array]"]=oc["[object Uint8ClampedArray]"]=oc["[object Uint16Array]"]=oc["[object Uint32Array]"]=!0,oc["[object Arguments]"]=oc["[object Array]"]=oc["[object ArrayBuffer]"]=oc["[object Boolean]"]=oc["[object DataView]"]=oc["[object Date]"]=oc["[object Error]"]=oc["[object Function]"]=oc["[object Map]"]=oc["[object Number]"]=oc["[object Object]"]=oc["[object RegExp]"]=oc["[object Set]"]=oc["[object String]"]=oc["[object WeakMap]"]=!1;var ic=function(e){return nc(e)&&tc(e.length)&&!!oc[ec(e)]};var rc=function(e){return function(t){return e(t)}},sc={exports:{}};!function(e,t){var n=Hs,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,r=i&&i.exports===o&&n.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||r&&r.binding&&r.binding("util")}catch(t){}}();e.exports=s}(sc,sc.exports);var ac=sc.exports,lc=ic,cc=rc,uc=ac&&ac.isTypedArray,dc=uc?cc(uc):lc,pc=Tl,fc=Yl,hc=Zl,mc=Xl,gc=Jl,vc=dc,yc=Object.prototype.hasOwnProperty;var bc=function(e,t){var n=hc(e),o=!n&&fc(e),i=!n&&!o&&mc(e),r=!n&&!o&&!i&&vc(e),s=n||o||i||r,a=s?pc(e.length,String):[],l=a.length;for(var c in e)!t&&!yc.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||gc(c,l))||a.push(c);return a},_c=Object.prototype;var wc=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_c)};var Sc=function(e,t){return function(n){return e(t(n))}},xc=Sc(Object.keys,Object),kc=wc,Cc=xc,Ac=Object.prototype.hasOwnProperty;var Ec=da,Oc=ql;var Lc=function(e){return null!=e&&Oc(e.length)&&!Ec(e)},Tc=bc,Ic=function(e){if(!kc(e))return Cc(e);var t=[];for(var n in Object(e))Ac.call(e,n)&&"constructor"!=n&&t.push(n);return t},Nc=Lc;var Pc=function(e){return Nc(e)?Tc(e):Ic(e)},Dc=Ll,jc=Pc;var Mc=function(e,t){return e&&Dc(t,jc(t),e)};var Rc=aa,$c=wc,Gc=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Bc=Object.prototype.hasOwnProperty;var Fc=bc,Uc=function(e){if(!Rc(e))return Gc(e);var t=$c(e),n=[];for(var o in e)("constructor"!=o||!t&&Bc.call(e,o))&&n.push(o);return n},zc=Lc;var Vc=function(e){return zc(e)?Fc(e,!0):Uc(e)},Hc=Ll,Wc=Vc;var Yc=function(e,t){return e&&Hc(t,Wc(t),e)},Zc={exports:{}};!function(e,t){var n=Zs,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,r=i&&i.exports===o?n.Buffer:void 0,s=r?r.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,o=s?s(n):new e.constructor(n);return e.copy(o),o}}(Zc,Zc.exports);var Kc=Zc.exports;var Xc=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n({groups:[],nodes:[]}),getters:{groups_nodes(){var e;let t=[],n=[];if((null==(e=this.nodes)?void 0:e.length)>0){this.nodes.map((e=>{let o=e.pos,i=!1;for(let n=0;nr.pos[0]&&o[0]r.pos[1]&&o[1]e.pos[0]-t.pos[0])).sort(((e,t)=>e.pos[1]-t.pos[1])))},setNodes(e){this.nodes=tp(e)},update(){y.extensionManager.activeSidebarTab===M&&setTimeout((e=>{this.setGroups(y.canvas.graph._groups),this.setNodes(y.canvas.graph._nodes)}),1)},watchGraph(){let e=this;this.update();const t=y.graph.onNodeAdded;y.graph.onNodeAdded=function(n){e.update();const o=n.onRemoved;return n.onRemoved=function(){return e.update(),null==o?void 0:o.apply(this,arguments)},null==t?void 0:t.apply(this,arguments)},y.canvas.onNodeMoved=function(t){e.update()};const n=LGraphCanvas.onNodeAlign;LGraphCanvas.onNodeAlign=function(t){return e.update(),null==n?void 0:n.apply(this,arguments)};const o=LGraphCanvas.onGroupAdd;LGraphCanvas.onGroupAdd=function(){return e.update(),null==o?void 0:o.apply(this,arguments)};const i=LGraphCanvas.onGroupAlign;LGraphCanvas.onGroupAlign=function(t){return e.update(),null==i?void 0:i.apply(this,arguments)};const r=LGraphCanvas.onMenuNodeRemove;LGraphCanvas.onMenuNodeRemove=function(t){return e.update(),null==r?void 0:r.apply(this,arguments)}}}});let op=null;const ip=["custom_obsidian","custom_obsidian_dark","custom_milk_white"],rp={"easy positive":"green","easy negative":"red","easy promptList":"cyan","easy promptLine":"cyan","easy promptConcat":"cyan","easy promptReplace":"cyan","easy textSwitch":"pale_blue"};let sp=LGraphCanvas.node_colors,ap=null,lp=null,cp=null,up=null;for(let by in H)dp=H[by],y.ui.settings.addSetting(dp);var dp;function pp(e,t=!1){let n="after",o="before";t&&([o,n]=[n,o]),e.label=(e.label??e.name).replace(o,n),e.name=e.label}function fp(e,t,n,o,i,r,s){t.strokeStyle=o,t.fillStyle=i;let a=LiteGraph.NODE_TITLE_HEIGHT,l=this.ds.scale<.5,c=e._shape||e.constructor.shape||LiteGraph.ROUND_SHAPE,u=e.constructor.title_mode,d=!0;u==LiteGraph.TRANSPARENT_TITLE||u==LiteGraph.NO_TITLE?d=!1:u==LiteGraph.AUTOHIDE_TITLE&&mouse_over&&(d=!0);let p=new Float32Array(4);p=[0,d?-a:0,n[0]+1,d?n[1]+a:n[1]];let f=t.globalAlpha;if(t.lineWidth=1,t.beginPath(),c==LiteGraph.BOX_SHAPE||l?t.fillRect(p[0],p[1],p[2],p[3]):c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CARD_SHAPE?t.roundRect(p[0],p[1],p[2],p[3],c==LiteGraph.CARD_SHAPE?[this.round_radius,this.round_radius,0,0]:[this.round_radius]):c==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*n[0],.5*n[1],.5*n[0],0,2*Math.PI),t.strokeStyle=LiteGraph.WIDGET_OUTLINE_COLOR,t.stroke(),t.strokeStyle=o,t.fill(),!e.flags.collapsed&&d&&(t.shadowColor="transparent",t.fillStyle="rgba(0,0,0,0.2)",t.fillRect(0,-1,p[2],2)),t.shadowColor="transparent",e.onDrawBackground&&e.onDrawBackground(t,this,this.canvas,this.graph_mouse),d||u==LiteGraph.TRANSPARENT_TITLE){const i="dark"==function(e){let t=e.replace("#","");return n=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16),.299*n+.587*o+.114*i>127.5?"light":"dark";var n,o,i}((null==e?void 0:e.color)||"#ffffff");if(e.onDrawTitleBar)e.onDrawTitleBar(t,a,n,this.ds.scale,o);else if(u!=LiteGraph.TRANSPARENT_TITLE&&(e.constructor.title_color||this.render_title_colored)){let i=e.constructor.title_color||o;if(e.flags.collapsed&&(t.shadowColor=LiteGraph.DEFAULT_SHADOW_COLOR),this.use_gradients){let e=LGraphCanvas.gradients[i];e||(e=LGraphCanvas.gradients[i]=t.createLinearGradient(0,0,400,0),e.addColorStop(0,i),e.addColorStop(1,"#000")),t.fillStyle=e}else t.fillStyle=i;t.beginPath(),c==LiteGraph.BOX_SHAPE||l?t.rect(0,-a,n[0]+1,a):c!=LiteGraph.ROUND_SHAPE&&c!=LiteGraph.CARD_SHAPE||t.roundRect(0,-a,n[0]+1,a,e.flags.collapsed?[this.round_radius]:[this.round_radius,this.round_radius,0,0]),t.fill(),t.shadowColor="transparent"}let s=!1;LiteGraph.node_box_coloured_by_mode&&LiteGraph.NODE_MODES_COLORS[e.mode]&&(s=LiteGraph.NODE_MODES_COLORS[e.mode]),LiteGraph.node_box_coloured_when_on&&(s=e.action_triggered?"#FFF":e.execute_triggered?"#AAA":s);let d=10;if(e.onDrawTitleBox)e.onDrawTitleBox(t,a,n,this.ds.scale);else if(c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CIRCLE_SHAPE||c==LiteGraph.CARD_SHAPE){const n=i?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR,o=i?"#eeeeee":e.boxcolor||s||LiteGraph.NODE_DEFAULT_BOXCOLOR;t.fillStyle=r?n:o,t.beginPath(),t.fillRect(10,0-1.05*d-1,1.1*d,.125*d),t.fillRect(10,0-1.45*d-1,1.1*d,.125*d),t.fillRect(10,0-1.85*d-1,1.1*d,.125*d)}else t.fillStyle=e.boxcolor||s||LiteGraph.NODE_DEFAULT_BOXCOLOR,t.fillRect(.5*(a-d),-.5*(a+d),d,d);if(t.globalAlpha=f,e.onDrawTitleText&&e.onDrawTitleText(t,a,n,this.ds.scale,this.title_text_font,r),!l){t.font=this.title_text_font;let n=String(e.getTitle());n&&(t.fillStyle=r?i?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR:i?"#ffffff":e.constructor.title_text_color||this.node_title_color,e.flags.collapsed?(t.textAlign="left",t.measureText(n),t.fillText(n.substr(0,20),a,LiteGraph.NODE_TITLE_TEXT_Y-a),t.textAlign="left"):(t.textAlign="left",t.fillText(n,a,LiteGraph.NODE_TITLE_TEXT_Y-a)))}if(!e.flags.collapsed&&e.subgraph&&!e.skip_subgraph_button){let n=LiteGraph.NODE_TITLE_HEIGHT,o=e.size[0]-n,i=LiteGraph.isInsideRectangle(this.graph_mouse[0]-e.pos[0],this.graph_mouse[1]-e.pos[1],o+2,2-n,n-4,n-4);t.fillStyle=i?"#888":"#555",c==LiteGraph.BOX_SHAPE||l?t.fillRect(o+2,2-n,n-4,n-4):(t.beginPath(),t.roundRect(o+2,2-n,n-4,n-4,[4]),t.fill()),t.fillStyle="#333",t.beginPath(),t.moveTo(o+.2*n,.6*-n),t.lineTo(o+.8*n,.6*-n),t.lineTo(o+.5*n,.3*-n),t.fill()}e.onDrawTitle&&e.onDrawTitle(t)}if(r){e.onBounding&&e.onBounding(p),u==LiteGraph.TRANSPARENT_TITLE&&(p[1]-=a,p[3]+=a),t.lineWidth=2,t.globalAlpha=.8,t.beginPath();let i=0,r=0,s=1;c==LiteGraph.BOX_SHAPE?t.rect(i+p[0],i+p[1],r+p[2],r+p[3]):c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CARD_SHAPE&&e.flags.collapsed?t.roundRect(i+p[0],i+p[1],r+p[2],r+p[3],[this.round_radius*s]):c==LiteGraph.CARD_SHAPE?t.roundRect(i+p[0],i+p[1],r+p[2],r+p[3],[this.round_radius*s,s,this.round_radius*s,s]):c==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*n[0],.5*n[1],.5*n[0]+6,0,2*Math.PI),t.strokeStyle=LiteGraph.NODE_BOX_OUTLINE_COLOR,t.stroke(),t.strokeStyle=o,t.globalAlpha=1}e.execute_triggered>0&&e.execute_triggered--,e.action_triggered>0&&e.action_triggered--}function hp(e,t,n,o){if(!e.widgets||!e.widgets.length)return 0;let i=e.size[0],r=e.widgets;t+=2;let s=LiteGraph.NODE_WIDGET_HEIGHT,a=this.ds.scale>.5;n.save(),n.globalAlpha=this.editor_alpha;let l=LiteGraph.WIDGET_OUTLINE_COLOR,c=LiteGraph.WIDGET_BGCOLOR,u=LiteGraph.WIDGET_TEXT_COLOR,d=LiteGraph.WIDGET_SECONDARY_TEXT_COLOR,p=12;for(let f=0;f1&&(i=1),n.fillStyle=h.options.hasOwnProperty("slider_color")?h.options.slider_color:o==h?l:I,n.beginPath(),n.roundRect(p,m,i*(g-24),s,[.25*s]),n.fill(),h.marker){let e=(h.marker-h.options.min)/t;e<0&&(e=0),e>1&&(e=1),n.fillStyle=h.options.hasOwnProperty("marker_color")?h.options.marker_color:"#AA9",n.roundRect(p+e*(g-24),m,2,s,[.25*s])}if(a){n.textAlign="center",n.fillStyle=u;let e=(h.label||h.name)+": "+Number(h.value).toFixed(null!=h.options.precision?h.options.precision:3).toString();n.fillText(e,.5*g,m+.7*s)}break;case"number":case"combo":if(n.textAlign="left",n.strokeStyle=l,n.fillStyle=c,n.beginPath(),a?n.roundRect(p,m,g-24,s,[.25*s]):n.rect(p,m,g-24,s),n.fill(),a){h.disabled||n.stroke(),n.fillStyle=u,h.disabled||(n.beginPath(),n.moveTo(24,m+6.5),n.lineTo(18,m+.5*s),n.lineTo(24,m+s-6.5),n.fill(),n.beginPath(),n.moveTo(g-p-12,m+6.5),n.lineTo(g-p-6,m+.5*s),n.lineTo(g-p-12,m+s-6.5),n.fill()),n.fillStyle=d,n.font="10px Inter",n.fillText(h.label||h.name,29,m+.7*s),n.fillStyle=u,n.textAlign="right";let e=6;if("number"==h.type)n.font="10px Inter",n.fillText(Number(h.value).toFixed(void 0!==h.options.precision?h.options.precision:3),g-24-e,m+.7*s);else{let t=h.value;if(h.options.values){let e=h.options.values;e.constructor===Function&&(e=e()),e&&e.constructor!==Array&&(t=e[h.value])}n.fillText(t,g-24-e,m+.7*s)}}break;case"string":case"text":if(n.textAlign="left",n.strokeStyle=l,n.fillStyle=c,n.beginPath(),a?n.roundRect(p,m,g-24,s,[.25*s]):n.rect(p,m,g-24,s),n.fill(),a){h.disabled||n.stroke(),n.save(),n.beginPath(),n.rect(p,m,g-24,s),n.clip(),n.fillStyle=d;const e=h.label||h.name;n.font="10px Inter",null!=e&&n.fillText(e,24,m+.7*s),n.fillStyle=u,n.textAlign="right",n.fillText(String(h.value).substr(0,30),g-24,m+.7*s),n.restore()}break;default:h.draw&&h.draw(n,e,g,m,s)}t+=(h.computeSize?h.computeSize(g)[1]:s)+4,n.globalAlpha=this.editor_alpha}n.restore(),n.textAlign="left"}function mp(e,t,n,o,i){return new LiteGraph.ContextMenu(LiteGraph.NODE_MODES,{event:n,callback:function(e){if(!i)return;var t=Object.values(LiteGraph.NODE_MODES).indexOf(e),n=function(e){t>=0&&LiteGraph.NODE_MODES[t]?e.changeMode(t):e.changeMode(LiteGraph.ALWAYS),op||(op=np()),op.update()},o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)n(i);else for(var r in o.selected_nodes)n(o.selected_nodes[r])},parentMenu:o,node:i}),!1}function gp(e,t,n,o,i){if(!i)throw"no node for color";var r=[];for(var s in r.push({value:null,content:"No color"}),LGraphCanvas.node_colors){var a=LGraphCanvas.node_colors[s];e={value:s,content:""+s+""};r.push(e)}return new LiteGraph.ContextMenu(r,{event:n,callback:function(e){if(!i)return;var t=e.value?LGraphCanvas.node_colors[e.value]:null,n=function(e){t?e.constructor===LiteGraph.LGraphGroup?e.color=t.groupcolor:(e.color=t.color,e.bgcolor=t.bgcolor):(delete e.color,delete e.bgcolor),op||(op=np()),op.update()},o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)n(i);else for(var r in o.selected_nodes)n(o.selected_nodes[r]);i.setDirtyCanvas(!0,!0)},parentMenu:o,node:i}),!1}function vp(e,t,n,o,i){var r=e.property||"title",s=i[r],a=document.createElement("div");a.is_modified=!1,a.className="graphdialog",a.innerHTML="",a.close=function(){a.parentNode&&a.parentNode.removeChild(a)},a.querySelector(".name").innerText=r;var l=a.querySelector(".value");l&&(l.value=s,l.addEventListener("blur",(function(e){this.focus()})),l.addEventListener("keydown",(function(e){if(a.is_modified=!0,27==e.keyCode)a.close();else if(13==e.keyCode)h();else if(13!=e.keyCode&&"textarea"!=e.target.localName)return;e.preventDefault(),e.stopPropagation()})));var c=LGraphCanvas.active_canvas.canvas,u=c.getBoundingClientRect(),d=-20,p=-20;u&&(d-=u.left,p-=u.top),event?(a.style.left=event.clientX+d+"px",a.style.top=event.clientY+p+"px"):(a.style.left=.5*c.width+d+"px",a.style.top=.5*c.height+p+"px"),a.querySelector("button").addEventListener("click",h),c.parentNode.appendChild(a),l&&l.focus();var f=null;function h(){l&&function(t){"Number"==e.type?t=Number(t):"Boolean"==e.type&&(t=Boolean(t));i[r]=t,a.parentNode&&a.parentNode.removeChild(a);i.setDirtyCanvas(!0,!0),op||(op=np());op.update()}(l.value)}a.addEventListener("mouseleave",(function(e){LiteGraph.dialog_close_on_mouse_leave&&!a.is_modified&&LiteGraph.dialog_close_on_mouse_leave&&(f=setTimeout(a.close,LiteGraph.dialog_close_on_mouse_leave_delay))})),a.addEventListener("mouseenter",(function(e){LiteGraph.dialog_close_on_mouse_leave&&f&&clearTimeout(f)}))}y.registerExtension({name:"Comfy.EasyUse.UI",init(){var e,t;const n="Comfy.CustomColorPalettes",o="Comfy.Settings.Comfy.CustomColorPalettes";if(lp||(lp=A(n,o)),cp||(cp=A("Comfy.ColorPalette","Comfy.Settings.Comfy.ColorPalette")||"dark"),(!(null==(e=null==lp?void 0:lp.obsidian)?void 0:e.version)||lp.obsidian.version<$.ColorPalette.version)&&(lp.obsidian=$.ColorPalette,lp.obsidian_dark=G.ColorPalette,E(n,lp,o)),(!(null==(t=null==lp?void 0:lp.milk_white)?void 0:t.version)||lp.milk_white.version{(null==e?void 0:e.value)&&(null==e?void 0:e.oldValue)&&(await W(1),Object.assign(y.canvas.default_connection_color_byType,N),Object.assign(LGraphCanvas.link_type_colors,N)),"custom_milk_white"==e.value&&document.body.classList.remove(T)})),setTimeout((e=>bp(A("Comfy.UseNewMenu")||"Disabled")),1)},async nodeCreated(e){var t;if(rp.hasOwnProperty(e.comfyClass)){const t=rp[e.comfyClass],n=sp[t];if(!n)return;n.color&&(e.color=n.color),n.bgcolor&&(e.bgcolor=n.bgcolor)}if(ap||(ap=A("Comfy.WidgetControlMode")),"before"==ap){const n="before"==ap;if((null==(t=e.widgets)?void 0:t.length)>0)for(const t of e.widgets)if(["control_before_generate","control_after_generate"].includes(t.name)&&(await pp(t,n),t.linkedWidgets))for(const e of t.linkedWidgets)await pp(e,n)}}});const yp=null==(h=y.ui.settings.settingsLookup)?void 0:h["Comfy.UseNewMenu"];yp&&(yp.onChange=e=>bp(e));const bp=e=>{var t;const n=(null==(t=document.getElementById("crystools-root"))?void 0:t.children)||null;if((null==n?void 0:n.length)>0){if(!up)for(let e=0;ee.widgets.find((e=>e.name===t)),Sp=(e,t,n=!1,o="")=>{var i;if(!t||((e,t)=>!!e.inputs&&e.inputs.some((e=>e.name===t)))(e,t.name))return;_p[t.name]||(_p[t.name]={origType:t.type,origComputeSize:t.computeSize});const r=e.size;t.type=n?_p[t.name].origType:"easyHidden"+o,t.computeSize=n?_p[t.name].origComputeSize:()=>[0,-4],null==(i=t.linkedWidgets)||i.forEach((o=>Sp(e,o,":"+t.name,n)));const s=n?Math.max(e.computeSize()[1],r[1]):e.size[1];e.setSize([e.size[0],s])},xp=(e,t=0)=>{var n,o;if(e)return(null==(n=e.widgets)?void 0:n[t])?e.widgets[t].value:e.widgets_values?null==(o=e.widgets_values)?void 0:o[t]:void 0},kp=e=>e.setSize([e.size[0],e.computeSize()[1]]),Cp=(e,t)=>graph.getNodeById(e),Ap=e=>{var t;try{return Object.values(null==(t=null==graph?void 0:graph.list_of_graphcanvas[0])?void 0:t.selected_nodes)}catch(n){return[]}};function Ep(e,t,n){return e+(o=n,(.5-.5*Math.cos(Math.PI*o))*(t-e));var o}const Op=(e,t=!0)=>{var n,o;const i=(null==(o=null==(n=e.graph)?void 0:n.list_of_graphcanvas)?void 0:o[0])||null;if(!i)return;const[r,s]=e.pos,[a,l]=e.size;(([e,t],n)=>{const o=n.ds,i=document.body.clientWidth,r=document.body.clientHeight,s=o.scale,a=.5*i/s-e,l=.5*r/s-t,c=Date.now()+250,u=o.offset[0],d=o.offset[1],p=()=>{const e=c-Date.now();if(!(Date.now(){const t=Cp(e);t&&Op(t)},Tp=(e,t=(()=>graph.links??[])())=>t[e],Ip=e=>e.toLowerCase().replace(/_./g,(e=>e.replace("_","").toUpperCase())),Np=e=>"easy getNode"===e.type,Pp=e=>"easy setNode"===e.type,Dp=e=>Np(e)||Pp(e),jp=(e=(()=>graph._nodes??[])())=>e.filter((e=>Dp(e))),Mp=(e,t,n=0)=>{e.widgets_values||(e.widgets_values=[]),e.widgets_values[n]=t,e.widgets[n].value=t},Rp=e=>graph.add(e),$p=e=>graph.remove(e),Gp=(e,t=0)=>{var n,o;if("Reroute"!==e.type)return[e,t];const i=e,r=null==(o=null==(n=i.inputs)?void 0:n[0])?void 0:o.link;if(!r)return[i,t];const s=Tp(r);if(!s)return[i,t];const a=Cp(s.origin_id);return a?(setTimeout((()=>{$p(i)})),Gp(a,s.origin_slot)):[i,t]},Bp=e=>{var t,n,o;if("Reroute"!==e.type)return e;const i=e,r=null==(n=null==(t=i.outputs)?void 0:t[0])?void 0:n.links;if(!r)return i;const s=r[0];if(!s)return i;const a=Tp(s);if(!a)return i;const l=Cp(a.target_id);return l?(1===(null==(o=i.outputs[0].links)?void 0:o.length)&&setTimeout((()=>{$p(i)})),Bp(l)):i};const Fp=new class{constructor(){v(this,"element",_(`div.${L}toast`)),v(this,"children",HTMLElement),v(this,"container",document.body),this.container.appendChild(this.element)}async show(e){let t=_(`div.${L}toast-container`,[_("div",[_("span",[...e.icon?[_("i",{className:e.icon})]:[],_("span",e.content)])])]);t.setAttribute("toast-id",e.id),this.element.replaceChildren(t),this.container.appendChild(this.element),await W(64),t.style.marginTop=`-${t.offsetHeight}px`,await W(64),t.classList.add("show"),e.duration&&(await W(e.duration),this.hide(e.id))}async hide(e){const t=document.querySelector(`.${L}toast > [toast-id="${e}"]`);(null==t?void 0:t.classList.contains("show"))&&(t.classList.remove("show"),await W(750)),t&&t.remove()}async clearAllMessages(){let e=document.querySelector(`.${L}container`);e&&(e.innerHTML="")}async info(e,t=3e3,n=[]){this.show({id:"toast-info",icon:`mdi mdi-information ${L}theme`,content:e,duration:t})}async success(e,t=3e3){this.show({id:"toast-success",icon:`mdi mdi-check-circle ${L}success`,content:e,duration:t})}async error(e,t=3e3){this.show({id:"toast-error",icon:`mdi mdi-close-circle ${L}error`,content:e,duration:t})}async warn(e,t=3e3){this.show({id:"toast-warn",icon:`mdi mdi-alert-circle ${L}warning`,content:e,duration:t})}async showLoading(e,t=0){this.show({id:"toast-loading",icon:"mdi mdi-rotate-right loading",content:e,duration:t})}async hideLoading(){this.hide("toast-loading")}},Up=["rescale_after_model","rescale","lora_name","upscale_method","image_output","add_noise","info","sampler_name","ckpt_B_name","ckpt_C_name","save_model","refiner_ckpt_name","num_loras","num_controlnet","mode","toggle","resolution","ratio","target_parameter","input_count","replace_count","downscale_mode","range_mode","text_combine_mode","input_mode","lora_count","ckpt_count","conditioning_mode","preset","use_tiled","use_batch","num_embeds","easing_mode","guider","scheduler","inpaint_mode","t5_type","rem_mode"],zp=["LIGHT - SD1.5 only (low strength)","STANDARD (medium strength)","VIT-G (medium strength)","PLUS (high strength)","PLUS FACE (portraits)","FULL FACE - SD1.5 only (portraits stronger)"],Vp=["FACEID","FACEID PLUS - SD1.5 only","FACEID PLUS V2","FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"],Hp=["easy seed","easy latentNoisy","easy wildcards","easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingSdTurbo","easy preSamplingCascade","easy preSamplingDynamicCFG","easy preSamplingLayerDiffusion","easy fullkSampler","easy fullCascadeKSampler"],Wp=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy hyditLoader","easy pixArtLoader"],Yp=["easy imageSize","easy imageSizeBySide","easy imageSizeByLongerSide","easy imageSizeShow","easy imageRatio","easy imagePixelPerfect"];function Zp(e,t){const n=e.comfyClass,o=t.value;switch(t.name){case"range_mode":Sp(e,wp(e,"step"),"step"==o),Sp(e,wp(e,"num_steps"),"num_steps"==o),kp(e);break;case"text_combine_mode":Sp(e,wp(e,"replace_text"),"replace"==o);break;case"lora_name":["lora_model_strength","lora_clip_strength"].map((t=>Sp(e,wp(e,t),"None"!==o)));break;case"resolution":"自定义 x 自定义"===o&&(t.value="width x height (custom)"),["empty_latent_width","empty_latent_height"].map((t=>Sp(e,wp(e,t),"width x height (custom)"===o)));break;case"ratio":["empty_latent_width","empty_latent_height"].map((t=>Sp(e,wp(e,t),"custom"===o)));break;case"num_loras":var i=o+1,r=wp(e,"mode").value;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));for(let t=i;t<21;t++)["lora_"+t+"_name","lora_"+t+"_strength","lora_"+t+"_model_strength","lora_"+t+"_clip_strength"].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"num_controlnet":i=o+1,r=wp(e,"mode").value;for(let t=0;tSp(e,wp(e,t),!0))),["start_percent_"+t,"end_percent_"+t].map((t=>Sp(e,wp(e,t),"simple"!==r)));for(let t=i;t<21;t++)["controlnet_"+t,"controlnet_"+t+"_strength","scale_soft_weight_"+t,"start_percent_"+t,"end_percent_"+t].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"mode":switch(null==e?void 0:e.comfyClass){case"easy loraStack":i=wp(e,"num_loras").value+1,r=o;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));kp(e);break;case"easy controlnetStack":i=wp(e,"num_controlnet").value+1,r=o;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));kp(e);break;case"easy icLightApply":r=o;["lighting","remove_bg"].map((t=>Sp(e,wp(e,t),"Foreground"===r))),Sp(e,wp(e,"source"),"Foreground"!==r),kp(e)}break;case"toggle":t.type="toggle",t.options={on:"Enabled",off:"Disabled"};break;case"t5_type":["clip_name","padding"].map((t=>Sp(e,wp(e,t),"sd3"==o))),["t5_name","device","dtype"].map((t=>Sp(e,wp(e,t),"t5v11"==o))),kp(e);break;case"preset":if(zp.includes(o)){let t=wp(e,"use_tiled");Sp(e,wp(e,"lora_strength")),Sp(e,wp(e,"provider")),Sp(e,wp(e,"weight_faceidv2")),Sp(e,wp(e,"weight_kolors")),Sp(e,wp(e,"use_tiled"),!0),Sp(e,wp(e,"sharpening"),t&&t.value)}else Vp.includes(o)&&(Sp(e,wp(e,"weight_faceidv2"),!!["FACEID PLUS V2","FACEID PLUS KOLORS"].includes(o)),Sp(e,wp(e,"weight_kolors"),!!["FACEID PLUS KOLORS"].includes(t.value)),["FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"].includes(o)?Sp(e,wp(e,"lora_strength"),!1):Sp(e,wp(e,"lora_strength"),!0),Sp(e,wp(e,"provider"),!0),Sp(e,wp(e,"use_tiled")),Sp(e,wp(e,"sharpening")));kp(e);break;case"use_tiled":Sp(e,wp(e,"sharpening"),!!o),kp(e);break;case"num_embeds":i=o+1;for(let t=0;tSp(e,wp(e,t),!1)));break;case"brushnet_random":case"brushnet_segmentation":["dtype","scale","start_at","end_at"].map((t=>Sp(e,wp(e,t),!0))),["fitting","function"].map((t=>Sp(e,wp(e,t),!1)));break;case"powerpaint":["dtype","fitting","function","scale","start_at","end_at"].map((t=>Sp(e,wp(e,t),!0)))}kp(e);break;case"image_output":Sp(e,wp(e,"link_id"),!!["Sender","Sender&Save"].includes(o)),Sp(e,wp(e,"decode_vae_name"),!!["Hide","Hide&Save"].includes(o)),["save_prefix","output_path","embed_workflow","number_padding","overwrite_existing"].map((t=>Sp(e,wp(e,t),!!["Save","Hide&Save","Sender&Save"].includes(o))));break;case"add_noise":var s=wp(e,"control_before_generate"),a=wp(e,"control_after_generate")||s;"disable"===o?(Sp(e,wp(e,"seed")),a&&(a.last_value=a.value,a.value="fixed",Sp(e,a))):(Sp(e,wp(e,"seed"),!0),a&&((null==a?void 0:a.last_value)&&(a.value=a.last_value),Sp(e,a,!0))),kp(e);break;case"guider":switch(o){case"Basic":["cfg","cfg_negative"].map((t=>Sp(e,wp(e,t))));break;case"CFG":Sp(e,wp(e,"cfg"),!0),Sp(e,wp(e,"cfg_negative"));break;case"IP2P+DualCFG":case"DualCFG":["cfg","cfg_negative"].map((t=>Sp(e,wp(e,t))),!0)}kp(e);break;case"scheduler":["karrasADV","exponentialADV","polyExponential"].includes(o)?(["sigma_max","sigma_min"].map((t=>Sp(e,wp(e,t),!0))),["denoise","beta_d","beta_min","eps_s","coeff"].map((t=>Sp(e,wp(e,t))),!1),Sp(e,wp(e,"rho"),"exponentialADV"!=o)):"vp"==o?(["sigma_max","sigma_min","denoise","rho","coeff"].map((t=>Sp(e,wp(e,t)))),["beta_d","beta_min","eps_s"].map((t=>Sp(e,wp(e,t),!0)))):(["sigma_max","sigma_min","beta_d","beta_min","eps_s","rho"].map((t=>Sp(e,wp(e,t)))),Sp(e,wp(e,"coeff"),"gits"==o),Sp(e,wp(e,"denoise"),!0)),kp(e);break;case"conditioning_mode":["replace","concat","combine"].includes(o)?["average_strength","old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t)))):"average"==o?(Sp(e,wp(e,"average_strength"),!0),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t),!1)))):"timestep"==o&&(["average_strength"].map((t=>Sp(e,wp(e,t),!1))),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t)))));break;case"rescale":wp(e,"rescale_after_model").value,Sp(e,wp(e,"width"),"to Width/Height"===o),Sp(e,wp(e,"height"),"to Width/Height"===o),Sp(e,wp(e,"percent"),"by percentage"===o),Sp(e,wp(e,"longer_side"),"to longer side - maintain aspect"===o),kp(e);break;case"upscale_method":["factor","crop"].map((t=>Sp(e,wp(e,t),"None"!==o)));break;case"target_parameter":switch(n){case"easy XYInputs: Steps":["first_step","last_step"].map((t=>Sp(e,wp(e,t),"steps"==o))),["first_start_step","last_start_step"].map((t=>Sp(e,wp(e,t),"start_at_step"==o))),["first_end_step","last_end_step"].map((t=>Sp(e,wp(e,t),"end_at_step"==o)));break;case"easy XYInputs: Sampler/Scheduler":let t=wp(e,"input_count").value+1;for(let n=0;nSp(e,wp(e,t),"strength"==o))),["first_start_percent","last_start_percent"].map((t=>Sp(e,wp(e,t),"start_percent"==o))),["first_end_percent","last_end_percent"].map((t=>Sp(e,wp(e,t),"end_percent"==o))),["strength","start_percent","end_percent"].map((t=>Sp(e,wp(e,t),o!=t))),kp(e)}case"replace_count":i=o+1;for(let t=0;tSp(e,wp(e,t),!l)));for(let t=i;t<11;t++)["lora_name_"+t,"model_str_"+t,"clip_str_"+t].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"ckpt_count":i=o+1;var c=-1!=wp(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=wp(e,"input_mode").value.indexOf("VAE");for(let t=0;tSp(e,wp(e,t),!1)));kp(e);break;case"input_count":i=o+1;var d=wp(e,"target_parameter").value;for(let t=0;tSp(e,wp(e,n),!t)));["model_strength","clip_strength"].map((n=>Sp(e,wp(e,n),!t)));break;case"easy XYInputs: Checkpoint":i=wp(e,"ckpt_count").value+1,c=-1!=wp(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=wp(e,"input_mode").value.indexOf("VAE");for(let n=0;ne.name===t));if(-1!==e){for(let t=e;t{var e;const t=this.computeSize();t[0]"info"===e.name));if(-1!==e&&this.widgets[e]){this.widgets[e].value=t}}requestAnimationFrame((()=>{var e;const t=this.computeSize();t[0]"prompt"==e.name));this.addWidget("button","get values from COMBO link","",(()=>{var t,o;const i=(null==(o=null==(t=this.outputs[1])?void 0:t.links)?void 0:o.length)>0?this.outputs[1].links[0]:null,r=n.graph._nodes.find((e=>{var t;return null==(t=e.inputs)?void 0:t.find((e=>e.link==i))}));if(i&&r){const t=r.inputs.find((e=>e.link==i)).widget.name,n=r.widgets.find((e=>e.name==t));let o=(null==n?void 0:n.options.values)||null;o&&(o=o.join("\n"),e.value=o)}else Fp.error(V("No COMBO link"),3e3)}),{serialize:!1})}),Wp.includes(t.name)){let t=function(e){var t="";for(let n=0;ne.name===t+"_prompt")),o="comfy-multiline-input wildcard_"+t+"_"+this.id.toString();if(-1==n&&e){const n=document.createElement("textarea");n.className=o,n.placeholder="Wildcard Prompt ("+t+")";const i=this.addDOMWidget(t+"_prompt","customtext",n,{getValue:e=>n.value,setValue(e){n.value=e},serialize:!1});i.inputEl=n,i.inputEl.readOnly=!0,n.addEventListener("input",(()=>{var e;null==(e=i.callback)||e.call(i,i.value)})),i.value=e}else if(this.widgets[n])if(e){this.widgets[n].value=e}else{this.widgets.splice(n,1);const e=document.getElementsByClassName(o);e&&e[0]&&e[0].remove()}}};e.prototype.onExecuted=function(e){null==a||a.apply(this,arguments);const o=t(e.positive),i=t(e.negative);n.call(this,o,"positive"),n.call(this,i,"negative")}}if(["easy sv3dLoader"].includes(t.name)){let t=function(e,t,n){switch(e){case"azimuth":return n.readOnly=!0,n.style.opacity=.6,"0:(0.0,0.0)"+(t>1?`\n${t-1}:(360.0,0.0)`:"");case"elevation":return n.readOnly=!0,n.style.opacity=.6,"0:(-90.0,0.0)"+(t>1?`\n${t-1}:(90.0,0.0)`:"");case"custom":return n.readOnly=!1,n.style.opacity=1,"0:(0.0,0.0)\n9:(180.0,0.0)\n20:(360.0,0.0)"}};e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>"easing_mode"==e.name)),n=this.widgets.find((e=>"batch_size"==e.name)),o=this.widgets.find((e=>"scheduler"==e.name));setTimeout((i=>{o.value||(o.value=t(e.value,n.value,o.inputEl))}),1),e.callback=e=>{o.value=t(e,n.value,o.inputEl)},n.callback=n=>{o.value=t(e.value,n,o.inputEl)}}}if(Hp.includes(o)&&(e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),o=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));if("easy seed"==t.name){const t=this.addWidget("button","🎲 Manual Random Seed",null,(t=>{"fixed"!=o.value&&(o.value="fixed"),e.value=Math.floor(Math.random()*P),n.queuePrompt(0,1)}),{serialize:!1});e.linkedWidgets=[t,o]}},e.prototype.onAdded=async function(){i&&i.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),t=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));setTimeout((n=>{"control_before_generate"==t.name&&0===e.value&&(e.value=Math.floor(Math.random()*P))}),1)}),"easy convertAnything"==o&&(e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>"output_type"==e.name)),t=t=>{this.outputs[0].type=e.value.toUpperCase(),this.outputs[0].name=e.value,this.outputs[0].label=e.value};setTimeout((e=>t()),10),e.callback=e=>t()}),"easy imageInsetCrop"==o){let t=function(e){const t=e.widgets[0];for(let n=1;n<=4;n++)"Pixels"===t.value?(e.widgets[n].options.step=80,e.widgets[n].options.max=8192):(e.widgets[n].options.step=10,e.widgets[n].options.max=99)};e.prototype.onAdded=async function(e){const n=this.widgets[0];let o=n.callback;n.callback=(...e)=>{t(this),o&&o.apply(n,[...e])},setTimeout((e=>{t(this)}),1)}}},nodeCreated(e){if(e.comfyClass.startsWith("easy ")){if(e.widgets)for(const n of e.widgets){if(!Up.includes(n.name))continue;let t=n.value;Zp(e,n),Object.defineProperty(n,"value",{get:e=>t,set(o){o!==t&&(t=o,Zp(e,n))}})}const t=e.comfyClass;if("easy preDetailerFix"==t){const t=e.widgets.find((e=>"customtext"===e.type));if(!t)return;t.dynamicPrompts=!1,t.inputEl.placeholder="wildcard spec: if kept empty, this option will be ignored",t.serializeValue=()=>t.value}if("easy wildcards"==t){const t=e.widgets.find((e=>"text"==e.name));let n=1;Object.defineProperty(e.widgets[n],"value",{set:e=>{if((new Error).stack.includes("inner_value_change")&&"Select the LoRA to add to the text"!=e){let n=e;n.endsWith(".safetensors")&&(n=n.slice(0,-12)),t.value+=``}},get:e=>"Select the LoRA to add to the text"}),Object.defineProperty(e.widgets[n+1],"value",{set:e=>{(new Error).stack.includes("inner_value_change")&&"Select the Wildcard to add to the text"!=e&&(""!=t.value&&(t.value+=", "),t.value+=e)},get:e=>"Select the Wildcard to add to the text"}),e.widgets[n].serializeValue=e=>"Select the LoRA to add to the text",e.widgets[n+1].serializeValue=e=>"Select the Wildcard to add to the text"}if(Yp.includes(t)){const t=document.createElement("textarea");t.className="comfy-multiline-input",t.readOnly=!0;const n=e.addDOMWidget("info","customtext",t,{getValue:e=>t.value,setValue:e=>t.value=e,serialize:!1});n.inputEl=t,t.addEventListener("input",(()=>{var e;null==(e=n.callback)||e.call(n,n.value)}))}}}}),y.registerExtension({name:"easy bookmark",registerCustomNodes(){class e{constructor(){v(this,"type","easy bookmark"),v(this,"title","🔖"),v(this,"slot_start_y",-20),v(this,"___collapsed_width",0),v(this,"isVirtualNode",!0),v(this,"serialize_widgets",!0),v(this,"keypressBound",null),this.addWidget("text","shortcut_key","1",(e=>{""!==(e=e.trim()[0]||"1")&&(this.title="🔖 "+e)}),{y:8}),this.addWidget("number","zoom",1,(e=>{}),{y:8+LiteGraph.NODE_WIDGET_HEIGHT+4,max:2,min:.5,precision:2}),this.keypressBound=this.onKeypress.bind(this)}get _collapsed_width(){return this.___collapsed_width}set _collapsed_width(e){const t=y.canvas,n=t.canvas.getContext("2d");if(n){const e=n.font;n.font=t.title_text_font,this.___collapsed_width=40+n.measureText(this.title).width,n.font=e}}onAdded(){setTimeout((e=>{const t=this.widgets[0].value;t&&(this.title="🔖 "+t)}),1),window.addEventListener("keydown",this.keypressBound)}onRemoved(){window.removeEventListener("keydown",this.keypressBound)}onKeypress(e){const t=e.target;["input","textarea"].includes(t.localName)||this.widgets[0]&&e.key.toLocaleLowerCase()===this.widgets[0].value.toLocaleLowerCase()&&this.canvasToBookmark()}canvasToBookmark(){var e,t;const n=y.canvas;(null==(e=null==n?void 0:n.ds)?void 0:e.offset)&&(n.ds.offset[0]=16-this.pos[0],n.ds.offset[1]=40-this.pos[1]),null!=(null==(t=null==n?void 0:n.ds)?void 0:t.scale)&&(n.ds.scale=Number(this.widgets[1].value||1)),n.setDirty(!0,!0)}}LiteGraph.registerNodeType("easy bookmark",Object.assign(e,{title:"Bookmark 🔖"})),e.category="EasyUse/Util"}}),y.registerExtension({name:"Comfy.EasyUse.ChainNode",init(){y.canvas._mousemove_callback=e=>{if(!A("EasyUse.Nodes.ChainGetSet",null,!0))return;((e,t=!1,n={})=>{var o,i,r,s,a;if(0===e.length)return;const l=n.inputX||160,c=n.ouputX||60;if(e.filter((e=>Dp(e))).length>1)return;for(const d of e){let s=0,a=0;const u=n.inputY||10,p=n.outputY||30,f=[];if(d.graph){for(const e of d.inputs??[]){const t=e.link;if(!t)continue;const{origin_id:n,target_slot:o}=Tp(t),i=Cp(n);if(!i)continue;if(!Dp(i))continue;const r=d.getConnectionPos(!0,o);i.pos=[r[0]-l,r[1]+15+s*u],s+=1,f.push(i),i.flags.collapsed=!0}for(const e of d.outputs??[])if(e.links&&d.graph)for(const t of e.links){const{target_id:e}=Tp(t),n=Cp(e);if(!n)continue;if(!Dp(n))continue;const i=null==(o=n.outputs)?void 0:o.links;if((null==i?void 0:i.length)>1)return;const r=d.getConnectionPos(!1,0);n.pos=[r[0]+c,r[1]+15+a*p],a+=1,f.push(n),n.flags.collapsed=!0}if(t&&1===e.length){const e=[d,...f];(null==(r=null==(i=d.graph)?void 0:i.list_of_graphcanvas)?void 0:r[0]).selectNodes(e)}}}const u=e[0];if(!u)return;(null==(a=null==(s=u.graph)?void 0:s.list_of_graphcanvas)?void 0:a[0]).setDirty(!0,!0)})(Ap())};const e=LGraphCanvas.prototype.showLinkMenu;LGraphCanvas.prototype.showLinkMenu=function(t,n){return n.shiftKey?(((e,t=!1)=>{var n,o,i,r,s,a,l,c,u,d;const{type:p}=e;if("*"===p)return;let{origin_id:f,target_id:h,origin_slot:m,target_slot:g}=e,v=Cp(f),y=Cp(h);if(!v||!y)return!1;if("Reroute"===v.type){let e=0;[v,e]=Gp(v),f=null==v?void 0:v.id,m=e,void 0!==m&&-1!==m||(m=0)}if("Reroute"===y.type&&(y=Bp(y),h=null==y?void 0:y.id,g=null==y?void 0:y.inputs.findIndex((e=>e.type===p)),void 0!==g&&-1!==g||(g=0)),void 0===f||void 0===h||!v||!y)return!1;if(t&&(Dp(v)||Dp(y)))return!1;let b=Ip((null==(n=y.getInputInfo(g))?void 0:n.name)??p.toLowerCase());b||(b=Ip((null==(i=null==(o=null==v?void 0:v.outputs)?void 0:o[m])?void 0:i.name)??(null==(s=null==(r=null==v?void 0:v.outputs)?void 0:r[m])?void 0:s.type.toString())??b+`_from_${f}_to_${h}`));let _,w=!1,S=!1;if(Dp(v))b=xp(v),S=!0;else{const e=null==(l=null==(a=v.outputs)?void 0:a[m])?void 0:l.links;if(e)for(const t of e){const e=Cp((null==(c=Tp(t))?void 0:c.target_id)??-1);e&&Dp(e)&&Pp(e)&&(b=xp(e),S=!0)}if(!S){for(const e of jp()){if(b!==xp(e)||!Pp(e))continue;const t=null==(u=e.inputs[0])?void 0:u.link;(null==(d=Tp(t))?void 0:d.origin_id)===v.id?S=!0:w=!0}w&&(b+=`_from_${f}_to_${h}`)}}if(!S){_=LiteGraph.createNode("easy setNode"),_.is_auto_link=!0;const e=v.getConnectionPos(!1,m);_.pos=[e[0]+20,e[1]],_.inputs[0].name=b,_.inputs[0].type=p,_.inputs[0].widget=y.inputs[g].widget,Mp(_,b),Rp(_),_.flags.collapsed=!0;let t=[];v.widgets?t=Object.values(v.widgets).map((e=>e.value)):v.widgets_values&&(t=JSON.parse(JSON.stringify(v.widgets_values))),v.connect(m,_,0),v.widgets_values=t,"PrimitiveNode"===v.type&&setTimeout((()=>{if(v){v.connect(m,_,0);for(const[e,n]of t.entries())Mp(v,n,e);null!==_&&_.setSize(_.computeSize())}}))}const x=LiteGraph.createNode("easy getNode"),k=y.getConnectionPos(!0,g);x.pos=[k[0]-150,k[1]],x.outputs[0].name=b,x.outputs[0].type=p,x.outputs[0].widget=y.inputs[g].widget,Rp(x),Mp(x,b),null===x||(x.flags.collapsed=!0,x.setSize(x.computeSize()),x.connect(0,y,g))})(t),!1):(e.apply(this,[t,n]),!1)}}});let Kp=[];function Xp(e,t,n,o,i){var r=LGraphCanvas.active_canvas,s=r.getCanvasWindow(),a=r.graph;if(a)return function e(t,o){var l=LiteGraph.getNodeTypesCategories(r.filter||a.filter).filter((function(e){return e.startsWith(t)})),c=[];l.map((function(n){if(n){var o=new RegExp("^("+t+")"),i=n.replace(o,"").split("/")[0],r=""===t?i+"/":t+i+"/",s=i;-1!=s.indexOf("::")&&(s=s.split("::")[1]),-1===c.findIndex((function(e){return e.value===r}))&&c.push({value:r,content:s,has_submenu:!0,callback:function(t,n,o,i){e(t.value,i)}})}})),LiteGraph.getNodeTypesInCategory(t.slice(0,-1),r.filter||a.filter).map((function(e){if(!e.skip_list){var t={value:e.type,content:e.title,has_submenu:!1,callback:function(e,t,n,o){var s=o.getFirstEvent();r.graph.beforeChange();var a=LiteGraph.createNode(e.value);a&&(a.pos=r.convertEventToCanvasOffset(s),r.graph.add(a)),i&&i(a),r.graph.afterChange()}};c.push(t)}}));const u=A("EasyUse.ContextMenu.NodesSort",null,!0);""===t&&u&&(c=function(e){let t=[],n=[];return e.forEach((e=>{(null==e?void 0:e.value)&&D.includes(e.value.split("/")[0])?t.push(e):n.push(e)})),[{title:V("ComfyUI Basic"),is_category_title:!0},...t,{title:V("Others A~Z"),is_category_title:!0},...n.sort(((e,t)=>e.content.localeCompare(t.content)))]}(c)),new LiteGraph.ContextMenu(c,{event:n,parentMenu:o},s)}("",o),!1}function Qp(e,t,n){var o=this;n=n||{};var i=document.createElement("div");i.className="litemenu-entry submenu";var r=!1;function s(e){var t=this.value,i=!0;(o.current_submenu&&o.current_submenu.close(e),n.callback)&&(!0===n.callback.call(this,t,n,e,o,n.node)&&(i=!1));if(t){if(t.callback&&!n.ignore_item_callbacks&&!0!==t.disabled)!0===t.callback.call(this,t,n,e,o,n.extra)&&(i=!1);if(t.submenu){if(!t.submenu.options)throw"ContextMenu submenu needs options";new o.constructor(t.submenu.options,{callback:t.submenu.callback,event:e,parentMenu:o,ignore_item_callbacks:t.submenu.ignore_item_callbacks,title:t.submenu.title,extra:t.submenu.extra,autoopen:n.autoopen}),i=!1}}i&&!o.lock&&o.close()}return null===t?i.classList.add("separator"):t.is_category_title?(i.classList.remove("litemenu-entry"),i.classList.remove("submenu"),i.classList.add("litemenu-title"),i.innerHTML=t.title):(i.innerHTML=t&&t.title?t.title:e,i.value=t,t&&(t.disabled&&(r=!0,i.classList.add("disabled")),(t.submenu||t.has_submenu)&&i.classList.add("has_submenu")),"function"==typeof t?(i.dataset.value=e,i.onclick_callback=t):i.dataset.value=t,t.className&&(i.className+=" "+t.className)),this.root.appendChild(i),r||i.addEventListener("click",s),!r&&n.autoopen&&LiteGraph.pointerListenerAdd(i,"enter",(function(e){var t=this.value;if(!t||!t.has_submenu)return;s.call(this,e)})),i}function Jp(e){return e.substring(0,e.lastIndexOf("."))}function qp(e){return e.substring(e.lastIndexOf(".")+1)}y.registerExtension({name:"Comfy.EasyUse.ContextMenu",async setup(){LGraphCanvas.onMenuAdd=Xp;const e=await b.fetchApi("/easyuse/models/thumbnail");if(200===e.status){let t=await e.json();Kp=t}else Fp.error(V("Too many thumbnails, have closed the display"));const t=LiteGraph.ContextMenu;LiteGraph.ContextMenu=function(e,n){var o,i;if(n.parentMenu);else if(n.extra)null==(o=n.extra.constructor)||o.name;else if(n.scale){if(A("EasyUse.ContextMenu.SubDirectories",null,!0)){const o=function(e,t){const n=e,o=[...n],i={},r=[],s=[],a=["ckpt","pt","bin","pth","safetensors"];if((null==e?void 0:e.length)>0){const t=qp(e[e.length-1]);if(!a.includes(t))return null}for(const l of n){const e=l.indexOf("/")>-1?"/":"\\",t=l.split(e);if(t.length>1){const n=t.shift();i[n]=i[n]||[],i[n].push(t.join(e))}else"CHOOSE"===l||l.startsWith("DISABLE ")?r.push(l):s.push(l)}if(Object.values(i).length>0){const e=t.callback;t.callback=null;const n=(t,n)=>{["None","无","無","なし"].includes(t.content)?e("None",n):e(o.find((e=>e.endsWith(t.content)),n))},l=(e,t="")=>{const o=t?t+"\\"+Jp(e):Jp(e),i=qp(e),r=(new Date).getTime();let s,l="";if(a.includes(i))for(let n=0;n{let n=[],o=[];const r=e.map((e=>{const r={},s=e.indexOf("/")>-1?"/":"\\",a=e.split(s);if(a.length>1){const e=a.shift();r[e]=r[e]||[],r[e].push(a.join(s))}if(Object.values(i).length>0){let t=Object.keys(r)[0];t&&r[t]?n.push({key:t,value:r[t][0]}):o.push(l(e,t))}return l(e,t)}));if(n.length>0){let e={};return n.forEach((t=>{e[t.key]=e[t.key]||[],e[t.key].push(t.value)})),[...Object.entries(e).map((e=>({content:e[0],has_submenu:!0,callback:()=>{},submenu:{options:u(e[1],e[0])}}))),...o]}return r};for(const[t,o]of Object.entries(i))c.push({content:t,has_submenu:!0,callback:()=>{},submenu:{options:u(o,t)}});return c.push(...s.map((e=>l(e,"")))),r.length>0&&c.push(...r.map((e=>l(e,"")))),c}return null}(e,n);if(o)return t.call(this,o,n)}}else n.hasOwnProperty("extra")&&(e.unshift(null),i=window.location.host,["192.168.","10.","127.",/^172\.((1[6-9]|2[0-9]|3[0-1])\.)/].some((e=>"string"==typeof e?i.startsWith(e):e.test(i)))&&e.unshift({content:`${V("Reboot ComfyUI")}`,callback:e=>async function(){if(confirm(V("Are you sure you'd like to reboot the server?")))try{b.fetchApi("/easyuse/reboot")}catch(e){}}()}),e.unshift({content:`${V("Cleanup Of GPU Usage")}`,callback:e=>async function(){try{const{Running:e,Pending:t}=await b.getQueue();if(e.length>0||t.length>0)return void Fp.error(V("Clean Failed")+":"+V("Please stop all running tasks before cleaning GPU"));200==(await b.fetchApi("/easyuse/cleangpu",{method:"POST"})).status?Fp.success(V("Clean SuccessFully")):Fp.error(V("Clean Failed"))}catch(e){}}()}));return t.apply(this,[...arguments])},LiteGraph.ContextMenu.prototype=t.prototype,LiteGraph.ContextMenu.prototype.addItem=Qp}});class ef extends w{constructor(){super(),this.element.classList.add("easyuse-model-metadata")}show(e){super.show(_("div",Object.keys(e).map((t=>_("div",[_("label",{textContent:t}),_("span",{textContent:e[t]})])))))}}class tf extends w{constructor(e){super(),this.name=e,this.element.classList.add("easyuse-model-info")}get customNotes(){return this.metadata["easyuse.notes"]}set customNotes(e){this.metadata["easyuse.notes"]=e}get hash(){return this.metadata["easyuse.sha256"]}async show(e,t){this.type=e;const n=b.fetchApi("/easyuse/metadata/"+encodeURIComponent(`${e}/${t}`));this.info=_("div",{style:{flex:"auto"}}),this.imgCurrent=0,this.imgList=_("div.easyuse-preview-list",{style:{display:"none"}}),this.imgWrapper=_("div.easyuse-preview",[_("div.easyuse-preview-group",[this.imgList])]),this.main=_("main",{style:{display:"flex"}},[this.imgWrapper,this.info]),this.content=_("div.easyuse-model-content",[_("div.easyuse-model-header",[_("h2",{textContent:this.name})]),this.main]);const o=_("div",{textContent:"ℹ️ Loading...",parent:this.content});super.show(this.content),this.metadata=await(await n).json(),this.viewMetadata.style.cursor=this.viewMetadata.style.opacity="",this.viewMetadata.removeAttribute("disabled"),o.remove(),this.addInfo()}createButtons(){const e=super.createButtons();return this.viewMetadata=_("button",{type:"button",textContent:"View raw metadata",disabled:"disabled",style:{opacity:.5,cursor:"not-allowed"},onclick:e=>{this.metadata&&(new ef).show(this.metadata)}}),e.unshift(this.viewMetadata),e}parseNote(){if(!this.customNotes)return[];let e=[];const t=new RegExp("(\\bhttps?:\\/\\/[^\\s]+)","g");let n,o=0;do{let i;n=t.exec(this.customNotes);let r=0;n?(i=n.index,r=n.index+n[0].length):i=this.customNotes.length;let s=this.customNotes.substring(o,i);s&&(s=s.replaceAll("\n","
"),e.push(_("span",{innerHTML:s}))),n&&e.push(_("a",{href:n[0],textContent:n[0],target:"_blank"})),o=r}while(n);return e}addInfoEntry(e,t){return _("p",{parent:this.info},["string"==typeof e?_("label",{textContent:e+": "}):e,"string"==typeof t?_("span",{textContent:t}):t])}async getCivitaiDetails(){const e=await fetch("https://civitai.com/api/v1/model-versions/by-hash/"+this.hash);if(200===e.status)return await e.json();throw 404===e.status?new Error("Model not found"):new Error(`Error loading info (${e.status}) ${e.statusText}`)}addCivitaiInfo(){const e=this.getCivitaiDetails(),t=_("span",{textContent:"ℹ️ Loading..."});return this.addInfoEntry(_("label",[_("img",{style:{width:"18px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),_("span",{textContent:"Civitai: "})]),t),e.then((e=>{var t,n;this.imgWrapper.style.display="block";let o=this.element.querySelector(".easyuse-model-header");o&&o.replaceChildren(_("h2",{textContent:this.name}),_("div.easyuse-model-header-remark",[_("h5",{textContent:V("Updated At:")+O(new Date(e.updatedAt),"yyyy/MM/dd")}),_("h5",{textContent:V("Created At:")+O(new Date(e.updatedAt),"yyyy/MM/dd")})]));let i=null,r=this.parseNote.call(this),s=V("✏️ Edit"),a=_("div.easyuse-model-detail-textarea",[_("p",(null==r?void 0:r.length)>0?r:{textContent:V("No notes")})]);if(r&&0!=r.length?a.classList.remove("empty"):a.classList.add("empty"),this.info.replaceChildren(_("div.easyuse-model-detail",[_("div.easyuse-model-detail-head.flex-b",[_("span",V("Notes")),_("a",{textContent:s,href:"#",style:{fontSize:"12px",float:"right",color:"var(--warning-color)",textDecoration:"none"},onclick:async e=>{if(e.preventDefault(),i){if(i.value!=this.customNotes){toast.showLoading(V("Saving Notes...")),this.customNotes=i.value;const e=await b.fetchApi("/easyuse/metadata/notes/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:this.customNotes});if(toast.hideLoading(),200!==e.status)return toast.error(V("Saving Failed")),void alert(`Error saving notes (${e.status}) ${e.statusText}`);toast.success(V("Saving Succeed")),r=this.parseNote.call(this),a.replaceChildren(_("p",(null==r?void 0:r.length)>0?r:{textContent:V("No notes")})),i.value?a.classList.remove("empty"):a.classList.add("empty")}else a.replaceChildren(_("p",{textContent:V("No notes")})),a.classList.add("empty");e.target.textContent=s,i.remove(),i=null}else e.target.textContent="💾 Save",i=_("textarea",{placeholder:V("Type your notes here"),style:{width:"100%",minWidth:"200px",minHeight:"50px",height:"100px"},textContent:this.customNotes}),a.replaceChildren(i),i.focus()}})]),a]),_("div.easyuse-model-detail",[_("div.easyuse-model-detail-head",{textContent:V("Details")}),_("div.easyuse-model-detail-body",[_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Type")}),_("div.easyuse-model-detail-item-value",{textContent:e.model.type})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("BaseModel")}),_("div.easyuse-model-detail-item-value",{textContent:e.baseModel})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Download")}),_("div.easyuse-model-detail-item-value",{textContent:(null==(t=e.stats)?void 0:t.downloadCount)||0})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Trained Words")}),_("div.easyuse-model-detail-item-value",{textContent:(null==e?void 0:e.trainedWords.join(","))||"-"})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Source")}),_("div.easyuse-model-detail-item-value",[_("label",[_("img",{style:{width:"14px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),_("a",{href:"https://civitai.com/models/"+e.modelId,textContent:"View "+e.model.name,target:"_blank"})])])])])])),null==(n=e.images)?void 0:n.length){this.imgCurrent=0,this.isSaving=!1,e.images.map((e=>e.url&&this.imgList.appendChild(_("div.easyuse-preview-slide",[_("div.easyuse-preview-slide-content",[_("img",{src:e.url}),_("div.save",{textContent:"Save as preview",onclick:async()=>{if(this.isSaving)return;this.isSaving=!0,toast.showLoading(V("Saving Preview..."));const t=await(await fetch(e.url)).blob(),n="temp_preview."+new URL(e.url).pathname.split(".")[1],o=new FormData;o.append("image",new File([t],n)),o.append("overwrite","true"),o.append("type","temp");if(200!==(await b.fetchApi("/upload/image",{method:"POST",body:o})).status)return this.isSaving=!1,toast.error(V("Saving Failed")),toast.hideLoading(),void alert(`Error saving preview (${req.status}) ${req.statusText}`);await b.fetchApi("/easyuse/save/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:JSON.stringify({filename:n,type:"temp"}),headers:{"content-type":"application/json"}}).then((e=>{toast.success(V("Saving Succeed")),toast.hideLoading()})),this.isSaving=!1,app.refreshComboInNodes()}})])]))));let t=this;this.imgDistance=(-660*this.imgCurrent).toString(),this.imgList.style.display="",this.imgList.style.transform="translate3d("+this.imgDistance+"px, 0px, 0px)",this.slides=this.imgList.querySelectorAll(".easyuse-preview-slide"),this.slideLeftButton=_("button.left",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{e.images.length<=2||(t.imgList.classList.remove("no-transition"),0==t.imgCurrent?(t.imgCurrent=e.images.length/2-1,this.slides[this.slides.length-1].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d(660px, 0px, 0px)",setTimeout((e=>{this.slides[this.slides.length-1].style.transform="translate3d(0px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)):(t.imgCurrent=t.imgCurrent-1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"))}}),this.slideRightButton=_("button.right",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{if(!(e.images.length<=2))if(t.imgList.classList.remove("no-transition"),t.imgCurrent>=e.images.length/2-1){t.imgCurrent=0;const n=e.images.length/2;this.slides[0].style.transform="translate3d("+(660*n).toString()+"px, 0px, 0px)",this.slides[1].style.transform="translate3d("+(660*n).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d("+(-660*n).toString()+"px, 0px, 0px)",setTimeout((e=>{this.slides[0].style.transform="translate3d(0px, 0px, 0px)",this.slides[1].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)}else t.imgCurrent=t.imgCurrent+1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"}})}return e.description&&_("div",{parent:this.content,innerHTML:e.description,style:{marginTop:"10px"}}),e})).catch((e=>{this.imgWrapper.style.display="none",t.textContent="⚠️ "+e.message})).finally((e=>{}))}}class nf extends tf{async addInfo(){await this.addCivitaiInfo()}}class of extends tf{getTagFrequency(){if(!this.metadata.ss_tag_frequency)return[];const e=JSON.parse(this.metadata.ss_tag_frequency),t={};for(const n in e){const o=e[n];for(const e in o)e in t?t[e]+=o[e]:t[e]=o[e]}return Object.entries(t).sort(((e,t)=>t[1]-e[1]))}getResolutions(){let e=[];if(this.metadata.ss_bucket_info){const t=JSON.parse(this.metadata.ss_bucket_info);if(null==t?void 0:t.buckets)for(const{resolution:n,count:o}of Object.values(t.buckets))e.push([o,`${n.join("x")} * ${o}`])}e=e.sort(((e,t)=>t[0]-e[0])).map((e=>e[1]));let t=this.metadata.ss_resolution;if(t){const n=t.split(","),o=n[0].replace("(",""),i=n[1].replace(")","");e.push(`${o.trim()}x${i.trim()} (Base res)`)}else(t=this.metadata["modelspec.resolution"])&&e.push(t+" (Base res");return e.length||e.push("⚠️ Unknown"),e}getTagList(e){return e.map((e=>_("li.easyuse-model-tag",{dataset:{tag:e[0]},$:e=>{e.onclick=()=>{e.classList.toggle("easyuse-model-tag--selected")}}},[_("p",{textContent:e[0]}),_("span",{textContent:e[1]})])))}addTags(){let e,t=this.getTagFrequency();if(null==t?void 0:t.length){const n=t.length;let o;n>500&&(t=t.slice(0,500),e=_("p",[_("span",{textContent:"⚠️ Only showing first 500 tags "}),_("a",{href:"#",textContent:`Show all ${n}`,onclick:()=>{o.replaceChildren(...this.getTagList(this.getTagFrequency())),e.remove()}})])),o=_("ol.easyuse-model-tags-list",this.getTagList(t)),this.tags=_("div",[o])}else this.tags=_("p",{textContent:"⚠️ No tag frequency metadata found"});this.content.append(this.tags),e&&this.content.append(e)}async addInfo(){const e=this.addCivitaiInfo();this.addTags();const t=await e;t&&_("div",{parent:this.content,innerHTML:t.description,style:{maxHeight:"250px",overflow:"auto"}})}createButtons(){const e=super.createButtons();function t(e,t){const n=_("textarea",{parent:document.body,style:{position:"fixed"},textContent:t.map((e=>e.dataset.tag)).join(", ")});n.select();try{document.execCommand("copy"),e.target.dataset.text||(e.target.dataset.text=e.target.textContent),e.target.textContent="Copied "+t.length+" tags",setTimeout((()=>{e.target.textContent=e.target.dataset.text}),1e3)}catch(o){prompt("Copy to clipboard: Ctrl+C, Enter",text)}finally{document.body.removeChild(n)}}return e.unshift(_("button",{type:"button",textContent:"Copy Selected",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag--selected")])}}),_("button",{type:"button",textContent:"Copy All",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag")])}})),e}}const rf=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy kolorsLoader","easy hunyuanDiTLoader","easy pixArtLoader"],sf=["easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingLayerDiffusion","easy fullkSampler"],af=["KSamplerSelect","SamplerEulerAncestral","SamplerEulerAncestralCFG++","SamplerLMS","SamplerDPMPP_3M_SDE","SamplerDPMPP_2M_SDE","SamplerDPMPP_SDE","SamplerDPMAdaptative","SamplerLCMUpscale","SamplerTCD","SamplerTCD EulerA"],lf=["BasicScheduler","KarrasScheduler","ExponentialScheduler","PolyexponentialScheduler","VPScheduler","BetaSamplingScheduler","SDTurboScheduler","SplitSigmas","SplitSigmasDenoise","FlipSigmas","AlignYourStepsScheduler","GITSScheduler"],cf=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerLayerDiffusion"],uf=["easy controlnetLoader","easy controlnetLoaderADV","easy controlnetLoader++","easy instantIDApply","easy instantIDApplyADV"],df=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition","easy ipadapterApplyFromParams","easy pulIDApply","easy pulIDApplyADV"],pf=["easy positive","easy wildcards"],ff=["easy loadImageBase64","LoadImage","LoadImageMask"],hf=["easy applyBrushNet","easy applyPowerPaint","easy applyInpaint"],mf={positive_prompt:{text:"positive",positive:"text"},loaders:{ckpt_name:"ckpt_name",vae_name:"vae_name",clip_skip:"clip_skip",lora_name:"lora_name",resolution:"resolution",empty_latent_width:"empty_latent_width",empty_latent_height:"empty_latent_height",positive:"positive",negative:"negative",batch_size:"batch_size",a1111_prompt_style:"a1111_prompt_style"},preSampling:{steps:"steps",cfg:"cfg",cfg_scale_min:"cfg",sampler_name:"sampler_name",scheduler:"scheduler",denoise:"denoise",seed_num:"seed_num",seed:"seed"},kSampler:{image_output:"image_output",save_prefix:"save_prefix",link_id:"link_id"},controlnet:{control_net_name:"control_net_name",strength:["strength","cn_strength"],scale_soft_weights:["scale_soft_weights","cn_soft_weights"],cn_strength:["strength","cn_strength"],cn_soft_weights:["scale_soft_weights","cn_soft_weights"]},ipadapter:{preset:"preset",lora_strength:"lora_strength",provider:"provider",weight:"weight",weight_faceidv2:"weight_faceidv2",start_at:"start_at",end_at:"end_at",cache_mode:"cache_mode",use_tiled:"use_tiled",insightface:"insightface",pulid_file:"pulid_file"},load_image:{image:"image",base64_data:"base64_data",channel:"channel"},inpaint:{dtype:"dtype",fitting:"fitting",function:"function",scale:"scale",start_at:"start_at",end_at:"end_at"},sampler:{},sigmas:{}},gf={loaders:{optional_lora_stack:"optional_lora_stack",positive:"positive",negative:"negative"},preSampling:{pipe:"pipe",image_to_latent:"image_to_latent",latent:"latent"},kSampler:{pipe:"pipe",model:"model"},controlnet:{pipe:"pipe",image:"image",image_kps:"image_kps",control_net:"control_net",positive:"positive",negative:"negative",mask:"mask"},positive_prompt:{},ipadapter:{model:"model",image:"image",image_style:"image",attn_mask:"attn_mask",optional_ipadapter:"optional_ipadapter"},inpaint:{pipe:"pipe",image:"image",mask:"mask"},sampler:{},sigmas:{}},vf={loaders:{pipe:"pipe",model:"model",vae:"vae",clip:null,positive:null,negative:null,latent:null},preSampling:{pipe:"pipe"},kSampler:{pipe:"pipe",image:"image"},controlnet:{pipe:"pipe",positive:"positive",negative:"negative"},positive_prompt:{text:"positive",positive:"text"},load_image:{IMAGE:"IMAGE",MASK:"MASK"},ipadapter:{model:"model",tiles:"tiles",masks:"masks",ipadapter:"ipadapter"},inpaint:{pipe:"pipe"},sampler:{SAMPLER:"SAMPLER"},sigmas:{SIGMAS:"SIGMAS"}};function yf(e,t,n){return function(){!function(e,t,n){const o=LiteGraph.createNode(t);if(o){if(y.graph.add(o),o.pos=e.pos.slice(),o.size=e.size.slice(),e.widgets.forEach((e=>{if(mf[n][e.name]){const i=mf[n][e.name];if(i){const n=(t=i,o.widgets.find((e=>"object"==typeof t?t.includes(e.name):e.name===t)));n&&(n.value=e.value,"seed_num"==e.name&&(n.linkedWidgets[0].value=e.linkedWidgets[0].value),"converted-widget"==e.type&&Cf(o,n,e))}}var t})),e.inputs&&e.inputs.forEach(((t,i)=>{if(t&&t.link&&gf[n][t.name]){const i=gf[n][t.name];if(null===i)return;const r=o.findInputSlot(i);if(-1!==r){const n=e.graph.links[t.link];if(n){const t=e.graph.getNodeById(n.origin_id);t&&t.connect(n.origin_slot,o,r)}}}})),e.outputs&&e.outputs.forEach(((t,i)=>{if(t&&t.links&&vf[n]&&vf[n][t.name]){const i=vf[n][t.name];if(null===i)return;const r=o.findOutputSlot(i);-1!==r&&t.links.forEach((t=>{const n=e.graph.links[t];if(n){const t=e.graph.getNodeById(n.target_id);t&&o.connect(r,t,n.target_slot)}}))}})),y.graph.remove(e),"easy fullkSampler"==o.type){const e=o.outputs[0].links;if(e&&e[0]){const t=y.graph._nodes.find((t=>t.inputs&&t.inputs[0]&&t.inputs[0].link==e[0]));t&&y.graph.remove(t)}}else if(sf.includes(o.type)){const e=o.outputs[0].links;if(!e||!e[0]){const e=LiteGraph.createNode("easy kSampler");y.graph.add(e),e.pos=o.pos.slice(),e.pos[0]=e.pos[0]+o.size[0]+20;const t=o.findInputSlot("pipe");-1!==t&&o&&o.connect(0,e,t)}}o.setSize([o.size[0],o.computeSize()[1]])}}(e,t,n)}}const bf=(e,t)=>{const n=e.prototype.getExtraMenuOptions;e.prototype.getExtraMenuOptions=function(){const e=n.apply(this,arguments);return t.apply(this,arguments),e}},_f=(e,t,n,o,i=!0)=>{bf(o,(function(o,r){r.unshift({content:e,has_submenu:i,callback:(e,o,i,r,s)=>wf(e,o,i,r,s,t,n)}),"loaders"==t&&(r.unshift({content:V("💎 View Lora Info..."),callback:(e,t,n,o,i)=>{let r=i.widgets.find((e=>"lora_name"==e.name)).value;r&&"None"!=r&&new of(r).show("loras",r)}}),r.unshift({content:V("💎 View Checkpoint Info..."),callback:(e,t,n,o,i)=>{let r=i.widgets[0].value;r&&"None"!=r&&new nf(r).show("checkpoints",r)}}))}))},wf=(e,t,n,o,i,r,s)=>{const a=[];return s.map((e=>{i.type!==e&&a.push({content:`${e}`,callback:yf(i,e,r)})})),new LiteGraph.ContextMenu(a,{event:n,callback:null,parentMenu:o,node:i}),!1},Sf="converted-widget",xf=Symbol();function kf(e,t,n=""){if(t.origType=t.type,t.origComputeSize=t.computeSize,t.origSerializeValue=t.serializeValue,t.computeSize=()=>[0,-4],t.type=Sf+n,t.serializeValue=()=>{if(!e.inputs)return;let n=e.inputs.find((e=>{var n;return(null==(n=e.widget)?void 0:n.name)===t.name}));return n&&n.link?t.origSerializeValue?t.origSerializeValue():t.value:void 0},t.linkedWidgets)for(const o of t.linkedWidgets)kf(e,o,":"+t.name)}function Cf(e,t,n){kf(e,t);const{type:o}=function(e){let t=e[0];t instanceof Array&&(t="COMBO");return{type:t}}(n),i=e.size;t.options&&t.options.forceInput||e.addInput(t.name,o,{widget:{name:t.name,[xf]:()=>n}});for(const r of e.widgets)r.last_y+=LiteGraph.NODE_SLOT_HEIGHT;e.setSize([Math.max(i[0],e.size[0]),Math.max(i[1],e.size[1])])}const Af=function(e){var t,n,o,i;const r=e.constructor.type,s=e.properties.origVals||{},a=s.title||e.title,l=s.color||e.color,c=s.bgcolor||e.bgcolor,u=e,d={size:[...e.size],color:l,bgcolor:c,pos:[...e.pos]};let p=[],f=[];if(e.inputs)for(const y of e.inputs)if(y.link){const t=y.name,n=e.findInputSlot(t),o=e.getInputNode(n),i=e.getInputLink(n);p.push([i.origin_slot,o,t])}if(e.outputs)for(const y of e.outputs)if(y.links){const e=y.name;for(const t of y.links){const n=graph.links[t],o=graph._nodes_by_id[n.target_id];f.push([e,o,n.target_slot])}}y.graph.remove(e);const h=y.graph.add(LiteGraph.createNode(r,a,d));function m(){if(u.widgets)for(let e of u.widgets)if("converted-widget"===e.type){const t=h.widgets.find((t=>t.name===e.name));for(let n of u.inputs)n.name===e.name&&Cf(h,t,n.widget)}for(let e of p){const[t,n,o]=e;n.connect(t,h.id,o)}for(let e of f){const[t,n,o]=e;h.connect(t,n,o)}}let g=u.widgets_values;if(!g&&(null==(t=h.widgets)?void 0:t.length)>0)return h.widgets.forEach(((e,t)=>{const n=u.widgets[t];e.name===n.name&&e.type===n.type&&(e.value=n.value)})),void m();const v=(null==g?void 0:g.length)<=(null==(n=h.widgets)?void 0:n.length);let b=v?0:g.length-1;function _(e,t){var n,o,i,r,s,a;if(!0===e||!1===e){if((null==(n=t.options)?void 0:n.on)&&(null==(o=t.options)?void 0:o.off))return{value:e,pass:!0}}else if("number"==typeof e){if((null==(i=t.options)?void 0:i.min)<=e&&e<=(null==(r=t.options)?void 0:r.max))return{value:e,pass:!0}}else{if(null==(a=null==(s=t.options)?void 0:s.values)?void 0:a.includes(e))return{value:e,pass:!0};if(t.inputEl&&"string"==typeof e)return{value:e,pass:!0}}return{value:t.value,pass:!1}}const w=e=>{var t;const n=u.widgets[e];let o=h.widgets[e];if(o.name===n.name&&o.type===n.type){for(;v?b=0;){let{value:e,pass:t}=_(g[b],o);if(t&&null!==e){o.value=e;break}b+=v?1:-1}b++,v||(b=g.length-((null==(t=h.widgets)?void 0:t.length)-1-e))}};if(v&&(null==(o=h.widgets)?void 0:o.length)>0)for(let y=0;y0)for(let y=h.widgets.length-1;y>=0;y--)w(y);m()};y.registerExtension({name:"Comfy.EasyUse.ExtraMenu",async beforeRegisterNodeDef(e,t,n){bf(e,(function(e,n){n.unshift({content:V("🔃 Reload Node"),callback:(e,t,n,o,i)=>{let r=LGraphCanvas.active_canvas;if(!r.selected_nodes||Object.keys(r.selected_nodes).length<=1)Af(i);else for(let s in r.selected_nodes)Af(r.selected_nodes[s])}}),"easy ckptNames"==t.name&&n.unshift({content:V("💎 View Checkpoint Info..."),callback:(e,t,n,o,i)=>{i.widgets[0].value}})})),pf.includes(t.name)&&_f("↪️ Swap EasyPrompt","positive_prompt",pf,e),rf.includes(t.name)&&_f("↪️ Swap EasyLoader","loaders",rf,e),sf.includes(t.name)&&_f("↪️ Swap EasyPreSampling","preSampling",sf,e),cf.includes(t.name)&&_f("↪️ Swap EasyKSampler","preSampling",cf,e),af.includes(t.name)&&_f("↪️ Swap Custom Sampler","sampler",af,e),lf.includes(t.name)&&_f("↪️ Swap Custom Sigmas","sigmas",lf,e),uf.includes(t.name)&&_f("↪️ Swap EasyControlnet","controlnet",uf,e),df.includes(t.name)&&_f("↪️ Swap EasyAdapater","ipadapter",df,e),ff.includes(t.name)&&_f("↪️ Swap LoadImage","load_image",ff,e),hf.includes(t.name)&&_f("↪️ Swap InpaintNode","inpaint",hf,e)}});const Ef="➡️";y.registerExtension({name:"easy setNode",registerCustomNodes(){class e{constructor(){v(this,"defaultVisibility",!0),v(this,"serialize_widgets",!0),this.properties||(this.properties={previousName:""}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("text","Constant","",((e,n,o,i,r)=>{t.validateName(t.graph),""!==this.widgets[0].value&&(this.title=Ef+this.widgets[0].value),this.update(),this.properties.previousName=this.widgets[0].value}),{}),this.addInput("*","*"),this.onConnectionsChange=function(e,n,o,i,r){if(1!=e||o||(this.inputs[n].type="*",this.inputs[n].name="*",this.title="Set"),i&&t.graph&&1==e&&o){const e=t.graph._nodes.find((e=>e.id==i.origin_id)).outputs[i.origin_slot],n=e.type,o=t.is_auto_link?this.widgets[0].value:e.name;"Set"===this.title&&(this.title=Ef+o,this.widgets[0].value=o),"*"===this.widgets[0].value&&(this.widgets[0].value=o),this.validateName(t.graph),this.inputs[0].type=n,this.inputs[0].name=o,setTimeout((e=>{this.title=Ef+this.widgets[0].value}),1)}this.update()},this.validateName=function(e){let n=t.widgets[0].value;if(""!=n){let o=0,i=[];do{i=e._nodes.filter((e=>e!=this&&("easy setNode"==e.type&&e.widgets[0].value===n))),i.length>0&&(n=t.widgets[0].value+o),o++}while(i.length>0);t.widgets[0].value=n,this.update()}},this.clone=function(){const t=e.prototype.clone.apply(this);return t.inputs[0].name="*",t.inputs[0].type="*",t.properties.previousName="",t.size=t.computeSize(),t},this.onAdded=function(e){this.validateName(e)},this.update=function(){if(t.graph){this.findGetters(t.graph).forEach((e=>{e.setType(this.inputs[0].type)})),this.widgets[0].value&&this.findGetters(t.graph,!0).forEach((e=>{e.setName(this.widgets[0].value)}));t.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues()}))}},this.findGetters=function(e,t){const n=t?this.properties.previousName:this.widgets[0].value;return e._nodes.filter((e=>"easy getNode"==e.type&&e.widgets[0].value===n&&""!=n))},this.isVirtualNode=!0}onRemoved(){this.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues([this])}))}}LiteGraph.registerNodeType("easy setNode",Object.assign(e,{title:"Set"})),e.category="EasyUse/Util"}}),y.registerExtension({name:"easy getNode",registerCustomNodes(){class e{constructor(){v(this,"defaultVisibility",!0),v(this,"serialize_widgets",!0),this.properties||(this.properties={}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("combo","Constant","",(e=>{this.onRename()}),{values:()=>t.graph._nodes.filter((e=>"easy setNode"==e.type)).map((e=>e.widgets[0].value)).sort()}),this.addOutput("*","*"),this.onConnectionsChange=function(e,t,n,o,i){this.validateLinks(),2!=e||n?(this.onRename(),setTimeout((e=>{this.title="⬅️"+this.widgets[0].value}),1)):(this.outputs[t].type="*",this.outputs[t].name="*",this.title="Get")},this.setName=function(e){t.widgets[0].value=e,t.onRename(),t.serialize()},this.onRename=function(e=0){const n=this.findSetter(t.graph);if(n){const t=n.inputs[0].type,o=n.inputs[0].name;this.setType(t,o),this.outputs[e].type=t,this.outputs[e].name=o,this.title="⬅️"+n.widgets[0].value}else this.setType("*","*"),this.outputs[e].type="*",this.outputs[e].name="*"},this.clone=function(){const t=e.prototype.clone.apply(this);return t.size=t.computeSize(),t},this.validateLinks=function(){"*"!=this.outputs[0].type&&this.outputs[0].links&&this.outputs[0].links.forEach((e=>{const n=t.graph.links[e];n&&n.type!=this.outputs[0].type&&"*"!=n.type&&t.graph.removeLink(e)}))},this.setType=function(e,t){this.outputs[0].name=t,this.outputs[0].type=e,this.validateLinks()},this.findSetter=function(e){const t=this.widgets[0].value;return e._nodes.find((e=>"easy setNode"==e.type&&e.widgets[0].value===t&&""!=t))},this.isVirtualNode=!0}getInputLink(e){const t=this.findSetter(this.graph);if(t){const n=t.inputs[e];return this.graph.links[n.link]}throw new Error("No setter found for "+this.widgets[0].value+"("+this.type+")")}onAdded(e){}}LiteGraph.registerNodeType("easy getNode",Object.assign(e,{title:"Get"})),e.category="EasyUse/Util"}}),b.addEventListener("easyuse-global-seed",(function(e){let t=app.graph._nodes_by_id;for(let n in t){let o=t[n];if("easy globalSeed"==o.type){if(o.widgets){const t=o.widgets.find((e=>"value"==e.name));o.widgets.find((e=>"last_seed"==e.name)).value=t.value,t.value=e.detail.value}}else if(o.widgets){const t=o.widgets.find((e=>"seed_num"==e.name||"seed"==e.name||"noise_seed"==e.name));t&&null!=e.detail.seed_map[o.id]&&(t.value=e.detail.seed_map[o.id])}}}));const Of=b.queuePrompt;b.queuePrompt=async function(e,{output:t,workflow:n}){n.seed_widgets={};for(let o in app.graph._nodes_by_id){let e=app.graph._nodes_by_id[o].widgets;if(e)for(let t in e)"seed_num"!=e[t].name&&"seed"!=e[t].name&&"noise_seed"!=e[t].name||"converted-widget"==e[t].type||(n.seed_widgets[o]=parseInt(t))}return await Of.call(b,e,{output:t,workflow:n})};const Lf=["easy imageSave","easy fullkSampler","easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo","easy detailerFix"];y.registerExtension({name:"Comfy.EasyUse.SaveImageExtraOutput",async beforeRegisterNodeDef(e,t,n){if(Lf.includes(t.name)){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0,o=this.widgets.find((e=>"filename_prefix"===e.name||"save_prefix"===e.name));return o.serializeValue=()=>x(n,o.value),e}}else{const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0;return this.properties&&"Node name for S&R"in this.properties||this.addProperty("Node name for S&R",this.constructor.type,"string"),e}}}});const Tf=["easy wildcards","easy positive","easy negative","easy stylesSelector","easy promptConcat","easy promptReplace"],If=["easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingDynamicCFG","easy preSamplingSdTurbo","easy preSamplingLayerDiffusion"],Nf=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo"],Pf=["easy controlnetLoader","easy controlnetLoaderADV"],Df=["easy instantIDApply","easy instantIDApplyADV"],jf=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition"],Mf=["easy pipeIn","easy pipeOut","easy pipeEdit"],Rf=["easy XYPlot","easy XYPlotAdvanced"],$f=["easy setNode"],Gf=["Reroute","RescaleCFG","LoraLoaderModelOnly","LoraLoader","FreeU","FreeU_v2",...jf,...$f],Bf={"easy seed":{from:{INT:["Reroute",...If,"easy fullkSampler"]}},"easy positive":{from:{STRING:["Reroute",...Tf]}},"easy negative":{from:{STRING:["Reroute",...Tf]}},"easy wildcards":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy stylesSelector":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy promptConcat":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy promptReplace":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy fullLoader":{from:{PIPE_LINE:["Reroute",...If,"easy fullkSampler",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy a1111Loader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy comfyLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy hunyuanDiTLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy kolorsLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy pixArtLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy svdLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy zero123Loader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy sv3dLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy preSampling":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingAdvanced":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingDynamicCFG":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingCustom":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingLayerDiffusion":{from:{PIPE_LINE:["Reroute","easy kSamplerLayerDiffusion",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingNoiseIn":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy fullkSampler":{from:{PIPE_LINE:["Reroute",...Mf.reverse(),"easy preDetailerFix","easy preMaskDetailerFix",...If,...$f]}},"easy kSampler":{from:{PIPE_LINE:["Reroute",...Mf.reverse(),"easy preDetailerFix","easy preMaskDetailerFix","easy hiresFix",...If,...$f]}},"easy controlnetLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f]}},"easy controlnetLoaderADV":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f]}},"easy instantIDApply":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{COMBO:["Reroute","easy promptLine"]}},"easy instantIDApplyADV":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApply":{to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApplyADV":{to:{STRING:["Reroute","easy sliderControl",...Tf],COMBO:["Reroute","easy promptLine"]}},"easy ipadapterStyleComposition":{to:{COMBO:["Reroute","easy promptLine"]}},"easy preDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Mf,...$f]},to:{PIPE_LINE:["Reroute","easy ultralyticsDetectorPipe","easy samLoaderPipe","easy kSampler","easy fullkSampler"]}},"easy preMaskDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Mf,...$f]}},"easy samLoaderPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Mf,...$f]}},"easy ultralyticsDetectorPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Mf,...$f]}},"easy cascadeLoader":{from:{PIPE_LINE:["Reroute","easy fullCascadeKSampler","easy preSamplingCascade",...Pf,...Mf,...$f],MODEL:Gf.filter((e=>!jf.includes(e)))}},"easy fullCascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Mf,...$f]}},"easy preSamplingCascade":{from:{PIPE_LINE:["Reroute","easy cascadeKSampler",...Mf,...$f]}},"easy cascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Mf,...$f]}}};y.registerExtension({name:"Comfy.EasyUse.Suggestions",async setup(e){LGraphCanvas.prototype.createDefaultNodeForSlot=function(e){e=e||{};var t,n=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,position:[],nodeType:null,posAdd:[0,0],posSizeFix:[0,0]},e),o=n.nodeFrom&&null!==n.slotFrom,i=!o&&n.nodeTo&&null!==n.slotTo;if(!o&&!i)return!1;if(!n.nodeType)return!1;var r=o?n.nodeFrom:n.nodeTo,s=o?n.slotFrom:n.slotTo,a=r.type,l=!1;switch(typeof s){case"string":l=o?r.findOutputSlot(s,!1):r.findInputSlot(s,!1),s=o?r.outputs[s]:r.inputs[s];break;case"object":l=o?r.findOutputSlot(s.name):r.findInputSlot(s.name);break;case"number":l=s,s=o?r.outputs[s]:r.inputs[s];break;default:return!1}var c=s.type==LiteGraph.EVENT?"_event_":s.type,u=o?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in;if(u&&u[c]){s.link;let e=!1;const i=o?"from":"to";if(Bf[a]&&Bf[a][i]&&(null==(t=Bf[a][i][c])?void 0:t.length)>0){for(var d in Bf[a][i][c])if(n.nodeType==Bf[a][i][c][d]||"AUTO"==n.nodeType){e=Bf[a][i][c][d];break}}else if("object"==typeof u[c]||"array"==typeof u[c]){for(var d in u[c])if(n.nodeType==u[c][d]||"AUTO"==n.nodeType){e=u[c][d];break}}else n.nodeType!=u[c]&&"AUTO"!=n.nodeType||(e=u[c]);if(e){var p=!1;"object"==typeof e&&e.node&&(p=e,e=e.node);var f=LiteGraph.createNode(e);if(f){if(p){if(p.properties)for(var h in p.properties)f.addProperty(h,p.properties[h]);if(p.inputs)for(var h in f.inputs=[],p.inputs)f.addOutput(p.inputs[h][0],p.inputs[h][1]);if(p.outputs)for(var h in f.outputs=[],p.outputs)f.addOutput(p.outputs[h][0],p.outputs[h][1]);p.title&&(f.title=p.title),p.json&&f.configure(p.json)}return this.graph.add(f),f.pos=[n.position[0]+n.posAdd[0]+(n.posSizeFix[0]?n.posSizeFix[0]*f.size[0]:0),n.position[1]+n.posAdd[1]+(n.posSizeFix[1]?n.posSizeFix[1]*f.size[1]:0)],o?n.nodeFrom.connectByType(l,f,c):n.nodeTo.connectByTypeOutput(l,f,c),!0}}}return!1},LGraphCanvas.prototype.showConnectionMenu=function(e){e=e||{};var t,n=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,e:null},e),o=this,i=n.nodeFrom&&n.slotFrom,r=!i&&n.nodeTo&&n.slotTo;if(!i&&!r)return!1;var s=i?n.nodeFrom:n.nodeTo,a=i?n.slotFrom:n.slotTo,l=!1;switch(typeof a){case"string":l=i?s.findOutputSlot(a,!1):s.findInputSlot(a,!1),a=i?s.outputs[a]:s.inputs[a];break;case"object":l=i?s.findOutputSlot(a.name):s.findInputSlot(a.name);break;case"number":l=a,a=i?s.outputs[a]:s.inputs[a];break;default:return!1}var c=["Add Node",null];o.allow_searchbox&&(c.push("Search"),c.push(null));var u=a.type==LiteGraph.EVENT?"_event_":a.type,d=i?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in,p=s.type;if(d&&d[u]){const e=i?"from":"to";if(Bf[p]&&Bf[p][e]&&(null==(t=Bf[p][e][u])?void 0:t.length)>0)for(var f in Bf[p][e][u])c.push(Bf[p][e][u][f]);else if("object"==typeof d[u]||"array"==typeof d[u])for(var f in d[u])c.push(d[u][f]);else c.push(d[u])}var h=new LiteGraph.ContextMenu(c,{event:n.e,title:(a&&""!=a.name?a.name+(u?" | ":""):"")+(a&&u?u:""),callback:function(e,t,r){switch(e){case"Add Node":LGraphCanvas.onMenuAdd(null,null,r,h,(function(e){i?n.nodeFrom.connectByType(l,e,u):n.nodeTo.connectByTypeOutput(l,e,u)}));break;case"Search":i?o.showSearchBox(r,{node_from:n.nodeFrom,slot_from:a,type_filter_in:u}):o.showSearchBox(r,{node_to:n.nodeTo,slot_from:a,type_filter_out:u});break;default:o.createDefaultNodeForSlot(Object.assign(n,{position:[n.e.canvasX,n.e.canvasY],nodeType:e}))}}});return!1}}}),y.registerExtension({name:"Comfy.EasyUse.TimeTaken",setup(){const e=new Map;let t=0;b.addEventListener("executing",(n=>{if(!A("EasyUse.Nodes.Runtime",null,!0))return;const o=(null==n?void 0:n.node)||(null==n?void 0:n.detail)||null,i=Cp(o);i&&(i.executionDuration="");const r=e.get(t);if(e.delete(t),t&&r){const e=Date.now()-r,n=Cp(t);n&&(n.executionDuration=`${(e/1e3).toFixed(2)}${V("s")}`)}t=o,e.set(o,Date.now())}))},beforeRegisterNodeDef(e,t){const n=e.prototype.onDrawForeground;e.prototype.onDrawForeground=function(...e){const[t]=e;return function(e,t){if(!t)return;e.save(),e.fillStyle=LiteGraph.NODE_DEFAULT_BGCOLOR,function(e,t,n,o,i,r){e.beginPath(),e.moveTo(t+r,n),e.lineTo(t+o-r,n),e.arcTo(t+o,n,t+o,n+r,r),e.lineTo(t+o,n+i-r),e.arcTo(t+o,n+i,t+o-r,n+i,r),e.lineTo(t+r,n+i),e.arcTo(t,n+i,t,n+i-r,r),e.lineTo(t,n+r),e.arcTo(t,n,t+r,n,r),e.closePath()}(e,0,-LiteGraph.NODE_TITLE_HEIGHT-20,e.measureText(t).width+10,LiteGraph.NODE_TITLE_HEIGHT-10,4),e.fill(),function(e,t,n,o,i="#000",r=12,s="Inter"){e.font=`${r}px ${s}`,e.fillStyle=i,e.fillText(t,n,o)}(e,t,8,-LiteGraph.NODE_TITLE_HEIGHT-6,LiteGraph.NODE_TITLE_COLOR),e.restore()}(t,this.executionDuration||""),null==n?void 0:n.apply(this,e)}}});const Ff="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function Uf(e,t,n,o){e.addEventListener?e.addEventListener(t,n,o):e.attachEvent&&e.attachEvent("on".concat(t),n)}function zf(e,t,n,o){e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent&&e.detachEvent("on".concat(t),n)}function Vf(e,t){const n=t.slice(0,t.length-1);for(let o=0;o=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}const Wf={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Ff?173:189,"=":Ff?61:187,";":Ff?59:186,"'":222,"[":219,"]":221,"\\":220},Yf={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Zf={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Kf={16:!1,18:!1,17:!1,91:!1},Xf={};for(let by=1;by<20;by++)Wf["f".concat(by)]=111+by;let Qf=[],Jf=null,qf="all";const eh=new Map,th=e=>Wf[e.toLowerCase()]||Yf[e.toLowerCase()]||e.toUpperCase().charCodeAt(0);function nh(e){qf=e||"all"}function oh(){return qf||"all"}function ih(e){if(void 0===e)Object.keys(Xf).forEach((e=>{Array.isArray(Xf[e])&&Xf[e].forEach((e=>rh(e))),delete Xf[e]})),ch(null);else if(Array.isArray(e))e.forEach((e=>{e.key&&rh(e)}));else if("object"==typeof e)e.key&&rh(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o{let{key:t,scope:n,method:o,splitKey:i="+"}=e;Hf(t).forEach((e=>{const t=e.split(i),r=t.length,s=t[r-1],a="*"===s?"*":th(s);if(!Xf[a])return;n||(n=oh());const l=r>1?Vf(Yf,t):[],c=[];Xf[a]=Xf[a].filter((e=>{const t=(!o||e.method===o)&&e.scope===n&&function(e,t){const n=e.length>=t.length?e:t,o=e.length>=t.length?t:e;let i=!0;for(let r=0;rch(e)))}))};function sh(e,t,n,o){if(t.element!==o)return;let i;if(t.scope===n||"all"===t.scope){i=t.mods.length>0;for(const e in Kf)Object.prototype.hasOwnProperty.call(Kf,e)&&(!Kf[e]&&t.mods.indexOf(+e)>-1||Kf[e]&&-1===t.mods.indexOf(+e))&&(i=!1);(0!==t.mods.length||Kf[16]||Kf[18]||Kf[17]||Kf[91])&&!i&&"*"!==t.shortcut||(t.keys=[],t.keys=t.keys.concat(Qf),!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function ah(e,t){const n=Xf["*"];let o=e.keyCode||e.which||e.charCode;if(!lh.filter.call(this,e))return;if(93!==o&&224!==o||(o=91),-1===Qf.indexOf(o)&&229!==o&&Qf.push(o),["ctrlKey","altKey","shiftKey","metaKey"].forEach((t=>{const n=Zf[t];e[t]&&-1===Qf.indexOf(n)?Qf.push(n):!e[t]&&Qf.indexOf(n)>-1?Qf.splice(Qf.indexOf(n),1):"metaKey"===t&&e[t]&&3===Qf.length&&(e.ctrlKey||e.shiftKey||e.altKey||(Qf=Qf.slice(Qf.indexOf(n))))})),o in Kf){Kf[o]=!0;for(const e in Yf)Yf[e]===o&&(lh[e]=!0);if(!n)return}for(const a in Kf)Object.prototype.hasOwnProperty.call(Kf,a)&&(Kf[a]=e[Zf[a]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===Qf.indexOf(17)&&Qf.push(17),-1===Qf.indexOf(18)&&Qf.push(18),Kf[17]=!0,Kf[18]=!0);const i=oh();if(n)for(let a=0;a1&&(i=Vf(Yf,e)),(e="*"===(e=e[e.length-1])?"*":th(e))in Xf||(Xf[e]=[]),Xf[e].push({keyup:l,keydown:c,scope:r,mods:i,shortcut:o[a],method:n,key:o[a],splitKey:u,element:s});if(void 0!==s&&window){if(!eh.has(s)){const e=function(){return ah(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event,s)},t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event;ah(e,s),function(e){let t=e.keyCode||e.which||e.charCode;const n=Qf.indexOf(t);if(n>=0&&Qf.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&Qf.splice(0,Qf.length),93!==t&&224!==t||(t=91),t in Kf){Kf[t]=!1;for(const e in Yf)Yf[e]===t&&(lh[e]=!1)}}(e)};eh.set(s,{keydownListener:e,keyupListenr:t,capture:d}),Uf(s,"keydown",e,d),Uf(s,"keyup",t,d)}if(!Jf){const e=()=>{Qf=[]};Jf={listener:e,capture:d},Uf(window,"focus",e,d)}}}function ch(e){const t=Object.values(Xf).flat();if(t.findIndex((t=>{let{element:n}=t;return n===e}))<0){const{keydownListener:t,keyupListenr:n,capture:o}=eh.get(e)||{};t&&n&&(zf(e,"keyup",n,o),zf(e,"keydown",t,o),eh.delete(e))}if(t.length<=0||eh.size<=0){if(Object.keys(eh).forEach((e=>{const{keydownListener:t,keyupListenr:n,capture:o}=eh.get(e)||{};t&&n&&(zf(e,"keyup",n,o),zf(e,"keydown",t,o),eh.delete(e))})),eh.clear(),Object.keys(Xf).forEach((e=>delete Xf[e])),Jf){const{listener:e,capture:t}=Jf;zf(window,"focus",e,t),Jf=null}}}const uh={getPressedKeyString:function(){return Qf.map((e=>{return t=e,Object.keys(Wf).find((e=>Wf[e]===t))||(e=>Object.keys(Yf).find((t=>Yf[t]===e)))(e)||String.fromCharCode(e);var t}))},setScope:nh,getScope:oh,deleteScope:function(e,t){let n,o;e||(e=oh());for(const i in Xf)if(Object.prototype.hasOwnProperty.call(Xf,i))for(n=Xf[i],o=0;o{let{element:t}=e;return ch(t)}))}else o++;oh()===e&&nh(t||"all")},getPressedKeyCodes:function(){return Qf.slice(0)},getAllKeyCodes:function(){const e=[];return Object.keys(Xf).forEach((t=>{Xf[t].forEach((t=>{let{key:n,scope:o,mods:i,shortcut:r}=t;e.push({scope:o,shortcut:r,mods:i,keys:n.split("+").map((e=>th(e)))})}))})),e},isPressed:function(e){return"string"==typeof e&&(e=th(e)),-1!==Qf.indexOf(e)},filter:function(e){const t=e.target||e.srcElement,{tagName:n}=t;let o=!0;const i="INPUT"===n&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(i||"TEXTAREA"===n||"SELECT"===n)&&!t.readOnly)&&(o=!1),o},trigger:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(Xf).forEach((n=>{Xf[n].filter((n=>n.scope===t&&n.shortcut===e)).forEach((e=>{e&&e.method&&e.method()}))}))},unbind:ih,keyMap:Wf,modifier:Yf,modifierMap:Zf};for(const by in uh)Object.prototype.hasOwnProperty.call(uh,by)&&(lh[by]=uh[by]);if("undefined"!=typeof window){const e=window.hotkeys;lh.noConflict=t=>(t&&window.hotkeys===lh&&(window.hotkeys=e),lh),window.hotkeys=lh}let dh=null;y.registerExtension({name:"Comfy.EasyUse.HotKeys",setup(){if(void 0!==lh){lh("up,down,left,right",(function(e,t){var n,o,i,r,s,a,l,c,u,d,p,f,h,m,g;e.preventDefault();if(!A("EasyUse.Hotkeys.JumpNearestNodes",null,!0))return;const v=Ap();if(0===v.length)return;const y=v[0];switch(t.key){case"up":case"left":let e=null;if(Np(y)){const e=null==(n=y.widgets_values)?void 0:n[0],t=null==(o=y.graph)?void 0:o._nodes,i=null==t?void 0:t.find((t=>{var n;if(Pp(t)){if((null==(n=t.widgets_values)?void 0:n[0])===e)return t}return null}));i&&Op(i)}else if((null==(i=y.inputs)?void 0:i.length)>0){for(let t=0;t{var n;if(Np(t)){if((null==(n=t.widgets_values)?void 0:n[0])===e)return t}return null}));n&&Op(n)}else if((null==(d=y.outputs)?void 0:d.length)>0){for(let e=0;e0&&y.outputs[e].links[0]){t=y.outputs[e].links[0];break}if(t){const e=null==(f=y.graph)?void 0:f.links;if(e[t]){const n=null==(h=e[t])?void 0:h.target_id,o=null==(g=null==(m=y.graph)?void 0:m._nodes_by_id)?void 0:g[n];o&&Op(o)}}}}})),lh("shift+up,shift+down,shift+left,shift+right",(function(e,t){e.preventDefault();if(!A("EasyUse.Hotkeys.AlignSelectedNodes",null,!0))return;const n=Ap();if(n.length<=1)return;const o=n;switch(t.key){case"shift+up":LGraphCanvas.alignNodes(o,"top",o[0]);break;case"shift+down":LGraphCanvas.alignNodes(o,"bottom",o[0]);break;case"shift+left":LGraphCanvas.alignNodes(o,"left",o[0]);break;case"shift+right":LGraphCanvas.alignNodes(o,"right",o[0])}dh||(dh=np()),dh&&dh.update()})),lh("shift+g",(function(e,t){e.preventDefault();A("EasyUse.Hotkeys.AddGroup",null,!0)&&(fh(),dh||(dh=np()),dh&&dh.update())}));const e=[];Array.from(Array(10).keys()).forEach((t=>e.push(`alt+${t}`))),lh(e.join(","),(async function(e,t){e.preventDefault();if(!A("EasyUse.Hotkeys.NodesTemplate",null,!0))return;const n=t.key;let o=parseInt(n.split("+")[1]);const i=await b.getUserData("comfy.templates.json");let r=null;if(200==i.status)try{r=await i.json()}catch(a){Fp.error(V("Get Node Templates File Failed"))}else localStorage["Comfy.NodeTemplates"]?r=JSON.parse(localStorage["Comfy.NodeTemplates"]):Fp.warn(V("No Node Templates Found"));if(!r)return void Fp.warn(V("No Node Templates Found"));o=0===o?9:o-1;const s=r[o];if(s)try{const e=(null==s?void 0:s.name)||"Group",t=(null==s?void 0:s.data)?JSON.parse(s.data):[];ph((async()=>{await k.registerFromWorkflow(t.groupNodes,{}),localStorage.litegrapheditor_clipboard=s.data,y.canvas.pasteFromClipboard(),t.groupNodes||fh(e)}))}catch(a){Fp.error(a)}else Fp.warn(V("Node template with {key} not set").replace("{key}",n))}));const t=async function(e){if(("b"===e.key||"m"==e.key)&&(e.metaKey||e.ctrlKey)){if(0===Ap().length)return;dh||(dh=np()),dh&&dh.update()}};window.addEventListener("keydown",t,!0)}}});const ph=async e=>{const t=localStorage.litegrapheditor_clipboard;await e(),localStorage.litegrapheditor_clipboard=t},fh=e=>{const t=Ap();if(0===t.length)return;const n=t;let o=new LiteGraph.LGraphGroup;o.title=e||"Group",((e,t=[],n=20)=>{var o,i,r,s,a,l,c,u,d,p;for(var f of(i=r=s=a=-1,l=c=u=d=-1,[e._nodes,t]))for(var h in f)l=(p=f[h]).pos[0],c=p.pos[1],u=p.pos[0]+p.size[0],d=p.pos[1]+p.size[1],"Reroute"!=p.type&&(c-=LiteGraph.NODE_TITLE_HEIGHT),(null==(o=p.flags)?void 0:o.collapsed)&&(d=c+LiteGraph.NODE_TITLE_HEIGHT,(null==p?void 0:p._collapsed_width)&&(u=l+Math.round(p._collapsed_width))),(-1==i||ls)&&(s=u),(-1==a||d>a)&&(a=d);r-=Math.round(1.4*e.font_size),e.pos=[i-n,r-n],e.size=[s-i+2*n,a-r+2*n]})(o,n),y.canvas.graph.add(o)};function hh(e,t,n,o){const i=[];return e.workflow.links.forEach((e=>{n&&e[1]===t&&!i.includes(e[3])&&i.push(e[3]),o&&e[3]===t&&!i.includes(e[1])&&i.push(e[1])})),i}async function mh(e,t=!1){const n=structuredClone(await y.graphToPrompt()),o=[];if(n.workflow.nodes.forEach((e=>{o.push(e.id)})),n.workflow.links=n.workflow.links.filter((e=>o.includes(e[1])&&o.includes(e[3]))),t)for(;!y.graph._nodes_by_id[e].isChooser;)e=hh(n,e,!0,!1)[0];const i=function(e,t){const n=[],o=[t];for(;o.length>0;){const t=o.pop();n.push(t),o.push(...hh(e,t,!0,!1).filter((e=>!(n.includes(e)||o.includes(e)))))}o.push(...n.filter((e=>e!=t)));const i=[t];for(;o.length>0;){const t=o.pop();i.push(t),o.push(...hh(e,t,!1,!0).filter((e=>!(i.includes(e)||o.includes(e)))))}const r=[];return r.push(...n),r.push(...i.filter((e=>!r.includes(e)))),r}(n,e);n.workflow.nodes=n.workflow.nodes.filter((t=>(t.id===e&&t.inputs.forEach((e=>{e.link=null})),i.includes(t.id)))),n.workflow.links=n.workflow.links.filter((e=>i.includes(e[1])&&i.includes(e[3])));const r={};for(const[l,c]of Object.entries(n.output))i.includes(parseInt(l))&&(r[l]=c);const s={};for(const[l,c]of Object.entries(r[e.toString()].inputs))Array.isArray(c)||(s[l]=c);r[e.toString()].inputs=s,n.output=r;const a=y.graphToPrompt;y.graphToPrompt=()=>(y.graphToPrompt=a,n),y.queuePrompt(0)}const gh=new class{constructor(){this.current_node_id=void 0,this.class_of_current_node=null,this.current_node_is_chooser=!1}update(){var e,t;return y.runningNodeId!=this.current_node_id&&(this.current_node_id=y.runningNodeId,this.current_node_id?(this.class_of_current_node=null==(t=null==(e=y.graph)?void 0:e._nodes_by_id[y.runningNodeId.toString()])?void 0:t.comfyClass,this.current_node_is_chooser="easy imageChooser"===this.class_of_current_node):(this.class_of_current_node=void 0,this.current_node_is_chooser=!1),!0)}},vh=class e{constructor(){}static idle(){return!y.runningNodeId}static paused(){return!0}static paused_here(t){return e.here(t)}static running(){return!e.idle()}static here(e){return y.runningNodeId==e}static state(){return"Paused"}};v(vh,"cancelling",!1);let yh=vh;function bh(e,t){const n=new FormData;n.append("message",t),n.append("id",e),b.fetchApi("/easyuse/image_chooser_message",{method:"POST",body:n})}function _h(){bh(-1,"__cancel__"),yh.cancelling=!0,b.interrupt(),yh.cancelling=!1}var wh=0;function Sh(){wh+=1}const xh=["easy kSampler","easy kSamplerTiled","easy fullkSampler"];function kh(e){const t=y.graph._nodes_by_id[e.detail.id];if(t){t.selected=new Set,t.anti_selected=new Set;const n=function(e,t){var n;return e.imgs=[],t.forEach((t=>{const n=new Image;e.imgs.push(n),n.onload=()=>{y.graph.setDirtyCanvas(!0)},n.src=`/view?filename=${encodeURIComponent(t.filename)}&type=temp&subfolder=${y.getPreviewFormatParam()}`})),null==(n=e.setSizeForImage)||n.call(e),e.imgs}(t,e.detail.urls);return{node:t,image:n,isKSampler:xh.includes(t.type)}}}function Ch(e,t,n){var o;if(e.imageRects)o=e.imageRects[t];else{const t=e.imagey;o=[1,t+1,e.size[0]-2,e.size[1]-t-2]}n.strokeRect(o[0]+1,o[1]+1,o[2]-2,o[3]-2)}class Ah extends w{constructor(){super(),this.node=null,this.select_index=[],this.dialog_div=null}show(e,t){this.select_index=[],this.node=t;const n=e.map(((e,n)=>{const o=_("img",{src:e.src,onclick:e=>{this.select_index.includes(n)?(this.select_index=this.select_index.filter((e=>e!==n)),o.classList.remove("selected")):(this.select_index.push(n),o.classList.add("selected")),t.selected.has(n)?t.selected.delete(n):t.selected.add(n)}});return o}));super.show(_("div.comfyui-easyuse-chooser-dialog",[_("h5.comfyui-easyuse-chooser-dialog-title",V("Choose images to continue")),_("div.comfyui-easyuse-chooser-dialog-images",n)]))}createButtons(){const e=super.createButtons();return e[0].onclick=e=>{yh.running()&&_h(),super.close()},e.unshift(_("button",{type:"button",textContent:V("Choose Selected Images"),onclick:e=>{bh(this.node.id,[...this.node.selected,-1,...this.node.anti_selected]),yh.idle()&&(Sh(),mh(this.node.id).then((()=>{bh(this.node.id,[...this.node.selected,-1,...this.node.anti_selected])}))),super.close()}})),e}}function Eh(){const e=y.graph._nodes_by_id[this.node_id];if(e){const t=[...e.selected];(null==t?void 0:t.length)>0&&e.setProperty("values",t),bh(e.id,[...e.selected,-1,...e.anti_selected]),yh.idle()&&(Sh(),mh(e.id).then((()=>{bh(e.id,[...e.selected,-1,...e.anti_selected])})))}}function Oh(){yh.running()&&_h()}function Lh(e){Object.defineProperty(e,"clicked",{get:function(){return this._clicked},set:function(e){this._clicked=e&&""!=this.name}})}function Th(e){e.options||(e.options={}),e.options.serialize=!1}y.registerExtension({name:"Comfy.EasyUse.imageChooser",init(){window.addEventListener("beforeunload",_h,!0)},setup(e){const t=LGraphCanvas.prototype.draw;LGraphCanvas.prototype.draw=function(){gh.update()&&e.graph._nodes.forEach((e=>{e.update&&e.update()})),t.apply(this,arguments)},b.addEventListener("easyuse-image-choose",(function(e){const{node:t,image:n,isKSampler:o}=kh(e);if(o){(new Ah).show(n,t)}}));const n=b.interrupt;b.interrupt=function(){yh.cancelling||_h(),n.apply(this,arguments)},b.addEventListener("execution_start",(function(){(wh>0?(wh-=1,0):(bh(-1,"__start__"),1))&&e.graph._nodes.forEach((e=>{(e.selected||e.anti_selected)&&(e.selected.clear(),e.anti_selected.clear(),e.update())}))}))},async nodeCreated(e,t){if("easy imageChooser"==e.comfyClass){e.setProperty("values",[]),void 0===(null==e?void 0:e.imageIndex)&&Object.defineProperty(e,"imageIndex",{get:function(){return null},set:function(t){e.overIndex=t}}),void 0===(null==e?void 0:e.imagey)&&Object.defineProperty(e,"imagey",{get:function(){return null},set:function(t){return e.widgets[e.widgets.length-1].last_y+LiteGraph.NODE_WIDGET_HEIGHT}});const t=e.onMouseDown;e.onMouseDown=function(n,o,i){if(n.isPrimary){const t=function(e,t){var n,o;if((null==(n=e.imgs)?void 0:n.length)>1)for(var i=0;i0&&n0&&oe.imagey)return 0;return-1}(e,o);t>=0&&this.imageClicked(t)}return t&&t.apply(this,arguments)},e.send_button_widget=e.addWidget("button","","",Eh),e.cancel_button_widget=e.addWidget("button","","",Oh),Lh(e.cancel_button_widget),Lh(e.send_button_widget),Th(e.cancel_button_widget),Th(e.send_button_widget)}},beforeRegisterNodeDef(e,t,n){if("easy imageChooser"==(null==t?void 0:t.name)){const t=e.prototype.onDrawBackground;e.prototype.onDrawBackground=function(e){t.apply(this,arguments),function(e,t){var n,o;if(e.imgs){if(e.imageRects)for(let n=0;n{Ch(e,n,t)})),t.strokeStyle="#F88",null==(o=null==e?void 0:e.anti_selected)||o.forEach((n=>{Ch(e,n,t)}))}}(this,e)},e.prototype.imageClicked=function(t){"easy imageChooser"===(null==e?void 0:e.comfyClass)&&(this.selected.has(t)?this.selected.delete(t):this.selected.add(t),this.update())};const n=e.prototype.update;e.prototype.update=function(){var e;if(n&&n.apply(this,arguments),this.send_button_widget){this.send_button_widget.node_id=this.id;const t=(this.selected?this.selected.size:0)+(this.anti_selected?this.anti_selected.size:0),n=(null==(e=this.imgs)?void 0:e.length)||0;yh.paused_here(this.id)&&t>0?this.send_button_widget.name=t>1?"Progress selected ("+t+"/"+n+")":"Progress selected image":this.send_button_widget.name=t>0?t>1?"Progress selected ("+t+"/"+n+")":"Progress selected image as restart":""}if(this.cancel_button_widget){const e=yh.running();this.cancel_button_widget.name=e?"Cancel current run":""}this.setDirtyCanvas(!0,!0)}}}}),Number.prototype.div=function(e){return function(e,t){let n,o,i=0,r=0,s="string"==typeof e?e:e.toString(),a="string"==typeof t?t:t.toString();try{i=s.toString().split(".")[1].length}catch(l){}try{r=a.toString().split(".")[1].length}catch(l){}return n=Number(s.toString().replace(".","")),o=Number(a.toString().replace(".","")),n/o*Math.pow(10,r-i)}(this,e)};let Ih=[],Nh=0;const Ph={sd3:6.5,"sd3-turbo":4};class Dh extends w{constructor(){super(),this.lists=[],this.dialog_div=null,this.user_div=null}addItem(e,t){return _("div.easyuse-account-dialog-item",[_("input",{type:"text",placeholder:"Enter name",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Ih[t].name=e.target.value},value:Ih[e].name}),_("input.key",{type:"text",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Ih[t].key=e.target.value},placeholder:"Enter APIKEY",value:Ih[e].key}),_("button.choose",{textContent:V("Choose"),onclick:async e=>{var n,o,i;const r=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);let s=Ih[r].name,a=Ih[r].key;if(!s)return void Fp.error(V("Please enter the account name"));if(!a)return void Fp.error(V("Please enter the APIKEY"));let l=!0;for(let t=0;t{(new Dh).show(t)}},[_("div.user",[_("div.avatar",r?[_("img",{src:r})]:"😀"),_("div.info",[_("h5.name",s),_("h6.remark","Credits: "+a)])]),_("div.edit",{textContent:V("Edit")})])),Fp.success(V("Save Succeed"))}else Fp.success(V("Save Succeed"));this.close()}else Fp.error(V("Save Failed"))}}),_("button.delete",{textContent:V("Delete"),onclick:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Ih.length<=1?Fp.error(V("At least one account is required")):(Ih.splice(t,1),this.dialog_div.removeChild(e.target.parentNode))}})])}show(e){Ih.forEach(((t,n)=>{this.lists.push(this.addItem(n,e))})),this.dialog_div=_("div.easyuse-account-dialog",this.lists),super.show(_("div.easyuse-account-dialog-main",[_("div",[_("a",{href:"https://platform.stability.ai/account/keys",target:"_blank",textContent:V("Getting Your APIKEY")})]),this.dialog_div]))}createButtons(){const e=super.createButtons();return e.unshift(_("button",{type:"button",textContent:V("Save Account Info"),onclick:e=>{let t=!0;for(let n=0;n{200==e.status?Fp.success(V("Save Succeed")):Fp.error(V("Save Failed"))}))}else Fp.error(V("APIKEY is not Empty"))}})),e.unshift(_("button",{type:"button",textContent:V("Add Account"),onclick:e=>{const t="Account "+Ih.length.toString();Ih.push({name:t,key:""});const n=this.addItem(Ih.length-1);this.lists.push(n),this.dialog_div.appendChild(n)}})),e}}y.registerExtension({name:"Comfy.EasyUse.API.SD3",async beforeRegisterNodeDef(e,t,n){if("easy stableDiffusion3API"==t.name){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=async function(){var e,n,o;t&&(null==t||t.apply(this,arguments));const i=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),r=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));let s=this.widgets.find((e=>"model"==e.name));s.callback=e=>{a.value="-"+Ph[e]};const a=this.addWidget("text","cost_credit","0",(e=>{}),{serialize:!1});a.disabled=!0,setTimeout((e=>{"control_before_generate"==r.name&&0===i.value&&(i.value=Math.floor(4294967294*Math.random())),a.value="-"+Ph[s.value]}),100);let l=_("div.easyuse-account-user",[V("Loading UserInfo...")]);this.addDOMWidget("account","btn",_("div.easyuse-account",l)),b.addEventListener("stable-diffusion-api-generate-succeed",(async({detail:e})=>{var t;let n=l.querySelectorAll(".remark");if(n&&n[0]){const t=(null==e?void 0:e.model)?Ph[e.model]:0;if(t){let e=function(e,t){let n,o,i,r,s,a;s="string"==typeof e?e:e.toString(),a="string"==typeof t?t:t.toString();try{n=s.split(".")[1].length}catch(l){n=0}try{o=a.split(".")[1].length}catch(l){o=0}return i=Math.pow(10,Math.max(n,o)),r=n>=o?n:o,((e*i-t*i)/i).toFixed(r)}(parseFloat(n[0].innerText.replace(/Credits: /g,"")),t);e>0&&(n[0].innerText="Credits: "+e.toString())}}await W(1e4);const o=await b.fetchApi("/easyuse/stability/balance");if(200==o.status){const e=await o.json();if(null==e?void 0:e.balance){const o=(null==(t=e.balance)?void 0:t.credits)||0;n&&n[0]&&(n[0].innerText="Credits: "+o)}}}));const c=await b.fetchApi("/easyuse/stability/api_keys");if(200==c.status){let t=await c.json();if(Ih=t.keys,Nh=t.current,Ih.length>0&&void 0!==Nh){const t=Ih[Nh].key,i=Ih[Nh].name;if(t){const t=await b.fetchApi("/easyuse/stability/user_info");if(200==t.status){const i=await t.json();if((null==i?void 0:i.account)&&(null==i?void 0:i.balance)){const t=(null==(e=i.account)?void 0:e.profile_picture)||null,r=(null==(n=i.account)?void 0:n.email)||null,s=(null==(o=i.balance)?void 0:o.credits)||0;l.replaceChildren(_("div.easyuse-account-user-info",{onclick:e=>{(new Dh).show(l)}},[_("div.user",[_("div.avatar",t?[_("img",{src:t})]:"😀"),_("div.info",[_("h5.name",r),_("h6.remark","Credits: "+s)])]),_("div.edit",{textContent:V("Edit")})]))}}}else l.replaceChildren(_("div.easyuse-account-user-info",{onclick:e=>{(new Dh).show(l)}},[_("div.user",[_("div.avatar","😀"),_("div.info",[_("h5.name",i),_("h6.remark",V("Click to set the APIKEY first"))])]),_("div.edit",{textContent:V("Edit")})]))}}}}}});let jh=null;function Mh(){jh&&(jh.removeEventListeners(),jh.dropdown.remove(),jh=null)}function Rh(e,t,n,o=!1){Mh(),new $h(e,t,n,o)}class $h{constructor(e,t,n,o=!1){this.dropdown=document.createElement("ul"),this.dropdown.setAttribute("role","listbox"),this.dropdown.classList.add("easy-dropdown"),this.selectedIndex=-1,this.inputEl=e,this.suggestions=t,this.onSelect=n,this.isDict=o,this.focusedDropdown=this.dropdown,this.buildDropdown(),this.onKeyDownBound=this.onKeyDown.bind(this),this.onWheelBound=this.onWheel.bind(this),this.onClickBound=this.onClick.bind(this),this.addEventListeners()}buildDropdown(){this.isDict?this.buildNestedDropdown(this.suggestions,this.dropdown):this.suggestions.forEach(((e,t)=>{this.addListItem(e,t,this.dropdown)}));const e=this.inputEl.getBoundingClientRect();this.dropdown.style.top=e.top+e.height-10+"px",this.dropdown.style.left=e.left+"px",document.body.appendChild(this.dropdown),jh=this}buildNestedDropdown(e,t){let n=0;Object.keys(e).forEach((o=>{const i=e[o];if("object"==typeof i&&null!==i){const e=document.createElement("ul");e.setAttribute("role","listbox"),e.classList.add("easy-nested-dropdown");const r=document.createElement("li");r.classList.add("folder"),r.textContent=o,r.appendChild(e),r.addEventListener("mouseover",this.onMouseOver.bind(this,n,t)),t.appendChild(r),this.buildNestedDropdown(i,e),n+=1}else{const e=document.createElement("li");e.classList.add("item"),e.setAttribute("role","option"),e.textContent=o,e.addEventListener("mouseover",this.onMouseOver.bind(this,n,t)),e.addEventListener("mousedown",this.onMouseDown.bind(this,o)),t.appendChild(e),n+=1}}))}addListItem(e,t,n){const o=document.createElement("li");o.setAttribute("role","option"),o.textContent=e,o.addEventListener("mouseover",this.onMouseOver.bind(this,t)),o.addEventListener("mousedown",this.onMouseDown.bind(this,e)),n.appendChild(o)}addEventListeners(){document.addEventListener("keydown",this.onKeyDownBound),this.dropdown.addEventListener("wheel",this.onWheelBound),document.addEventListener("click",this.onClickBound)}removeEventListeners(){document.removeEventListener("keydown",this.onKeyDownBound),this.dropdown.removeEventListener("wheel",this.onWheelBound),document.removeEventListener("click",this.onClickBound)}onMouseOver(e,t){t&&(this.focusedDropdown=t),this.selectedIndex=e,this.updateSelection()}onMouseOut(){this.selectedIndex=-1,this.updateSelection()}onMouseDown(e,t){t.preventDefault(),this.onSelect(e),this.dropdown.remove(),this.removeEventListeners()}onKeyDown(e){const t=Array.from(this.focusedDropdown.children),n=t[this.selectedIndex];if(jh)if(38===e.keyCode)e.preventDefault(),this.selectedIndex=Math.max(0,this.selectedIndex-1),this.updateSelection();else if(40===e.keyCode)e.preventDefault(),this.selectedIndex=Math.min(t.length-1,this.selectedIndex+1),this.updateSelection();else if(39===e.keyCode){if(e.preventDefault(),n&&n.classList.contains("folder")){const e=n.querySelector(".easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=0,this.updateSelection())}}else if(37===e.keyCode&&this.focusedDropdown!==this.dropdown){const e=this.focusedDropdown.closest(".easy-dropdown, .easy-nested-dropdown").parentNode.closest(".easy-dropdown, .easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=Array.from(e.children).indexOf(this.focusedDropdown.parentNode),this.updateSelection())}else if((13===e.keyCode||9===e.keyCode)&&this.selectedIndex>=0){e.preventDefault(),n.classList.contains("item")&&(this.onSelect(t[this.selectedIndex].textContent),this.dropdown.remove(),this.removeEventListeners());const o=n.querySelector(".easy-nested-dropdown");o&&(this.focusedDropdown=o,this.selectedIndex=0,this.updateSelection())}else 27===e.keyCode&&(this.dropdown.remove(),this.removeEventListeners())}onWheel(e){const t=parseInt(this.dropdown.style.top);localStorage.getItem("Comfy.Settings.Comfy.InvertMenuScrolling")?this.dropdown.style.top=t+(e.deltaY<0?10:-10)+"px":this.dropdown.style.top=t+(e.deltaY<0?-10:10)+"px"}onClick(e){this.dropdown.contains(e.target)||e.target===this.inputEl||(this.dropdown.remove(),this.removeEventListeners())}updateSelection(){Array.from(this.focusedDropdown.children).forEach(((e,t)=>{t===this.selectedIndex?e.classList.add("selected"):e.classList.remove("selected")}))}}function Gh(e){const t=e.min||0,n=e.max||0,o=e.step||1;if(0===o)return[];const i=[];let r=t;for(;r<=n;){if(Number.isInteger(o))i.push(Math.round(r)+"; ");else{let e=r.toFixed(3);-0==e&&(e="0.000"),/\.\d{3}$/.test(e)||(e+="0"),i.push(e+"; ")}r+=o}return n>=0&&t>=0?i:i.reverse()}let Bh={},Fh={};function Uh(e,t){String(e.id);const n=t.name,o=t.value.replace(/^(loader|preSampling):\s/,"");Fh[n]?Fh[n]!=Bh[o]&&(Fh[n]=Bh[o]):Fh={...Fh,[n]:Bh[o]}}y.registerExtension({name:"Comfy.EasyUse.XYPlot",async beforeRegisterNodeDef(e,t,n){if("easy XYPlot"===t.name){Bh=t.input.hidden.plot_dict[0];for(const e in Bh){const t=Bh[e];if(Array.isArray(t)){let n=[];for(const e of t)n.push(e+"; ");Bh[e]=n}else Bh[e]="object"==typeof t?"seed"==e?t+"; ":Gh(t):t+"; "}Bh.None=[],Bh["---------------------"]=[]}},nodeCreated(e){"easy XYPlot"===e.comfyClass&&(function(e){if(e.widgets)for(const t of e.widgets)if("x_axis"===t.name||"y_axis"===t.name){let n=t.value;Object.defineProperty(t,"value",{get:()=>n,set(o){o!==n&&(n=o,Uh(e,t))}})}}(e),function(e){if(e.widgets){const t=e.widgets.filter((e=>"customtext"===e.type&&!1!==e.dynamicPrompts||e.dynamicPrompts));for(const e of t){let t=function(e,t,o,i){return e&&(t[o]=e),t.map((e=>n(e,i))).filter((e=>""!==e)).join("")},n=function(e,t){if(e=o(e),i(e,t))return e+"; ";let n=r(e,t);return 1===n.length||2===n.length?n[0]:i(s(e),t)?s(e)+"; ":""},o=function(e){return e.replace(/(\n|;| )/g,"")},i=function(e,t){return t.includes(e+"; ")},r=function(e,t){return t.filter((t=>t.toLowerCase().includes(e.toLowerCase())))},s=function(e){return Number(e)?Number(e).toFixed(3):["0","0.","0.0","0.00","00"].includes(e)?"0.000":e};const a=function(){const n=e.name[0]+"_axis";let o=(null==Fh?void 0:Fh[n])||[];if(0===o.length)return;const i=e.inputEl.value,r=e.inputEl.selectionStart;let s=i.split("; ");const a=i.substring(0,r).split("; ").length-1,l=s[a].replace(/\n/g,"").toLowerCase(),c=o.filter((e=>e.toLowerCase().includes(l))).map((e=>e.replace(/; /g,"")));if(c.length>0)Rh(e.inputEl,c,(n=>{const i=t(n,s,a,o);e.inputEl.value=i}));else{Mh();const n=t(null,s,a,o);e.inputEl.value=n}};e.inputEl.removeEventListener("input",a),e.inputEl.addEventListener("input",a),e.inputEl.removeEventListener("mouseup",a),e.inputEl.addEventListener("mouseup",a)}}}(e))}});const zh=_s("graphStore",{state:e=>({selectors:[],selectors_styles:{},seg_selectors:[],slider_controls:[]}),actions:{setSelectors(e){this.selectors=tp(e)},setStyles(e,t){this.selectors_styles[e]||(this.selectors_styles[e]=t)},setSegSelectors(e){this.seg_selectors=tp(e)},setSliderControls(e){this.slider_controls=tp(e)}}}),Vh=["data-id"],Hh=[Zi("i",{class:"mdi mdi-trash-can"},null,-1)],Wh=Zi("i",{class:"mdi mdi-magnify"},null,-1),Yh=["placeholder"],Zh=["onMouseenter","onMouseleave"],Kh=["onClick"],Xh=["name","checked"],Qh=["src"],Jh={key:0},qh=Zi("span",{class:"comfyui-easyuse-success"},"positive:",-1),em={key:1},tm=Zi("span",{class:"comfyui-easyuse-error"},"negative:",-1),nm="comfyui-easyuse-selector",om={__name:"stylesSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selectedStyles:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["chooseStyle"],setup(e,{emit:t}){const n=e,o=zh(),{selectors_styles:i}=ws(o),r=pn([]);bi((e=>n.type),(async e=>{r.value=[],e&&await(async e=>{if(i.value[n.type])return!0;const t=await b.fetchApi(`/easyuse/prompt/styles?name=${e}`);if(200===t.status){let e=(await t.json()).map(((e,t)=>(e.index=t,e)));return await o.setStyles(n.type,e),!0}return Fp.error(V("Get styles list Failed")),!1})(e)&&a()}),{immediate:!0});const s=t,a=e=>{const t=n.selectedStyles,o=tp(i.value[n.type]);r.value=o.sort(((e,t)=>e.index-t.index)).sort(((e,n)=>t.includes(n.name)-t.includes(e.name)))},l=pn(""),c=e=>e.toLowerCase(),u=Xt({}),d=e=>{u.src="",u.name="",u.positive="",u.negative=""},p=async e=>{const t=await b.fetchApi(`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`);if(200===t.status){const o=await t.text();if(o.startsWith("http"))return o;return`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`}},f=e=>{e.target.src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QNLaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuMSAoMjAyMzA5MDUubS4yMzE2IDk3OWM4NmQpICAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjA3NEU1QzNCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjA3NEU1QzRCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGMDc0RTVDMUI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGMDc0RTVDMkI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHB8fHx8fHx8fHx8BBwcHDQwNGBAQGBoVERUaHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fH//AABEIAIAAgAMBEQACEQEDEQH/xACLAAEAAgMBAQEAAAAAAAAAAAAABAUCAwYBBwgBAQADAQEBAAAAAAAAAAAAAAABAgMEBQYQAAEEAgECAwUHAwUAAAAAAAEAAgMEEQUhEgYxEwdBYSIyFFFxgVJyIxWRoTOxwdFiJBEBAAICAQQBBAIDAAAAAAAAAAECEQMxIUESBBOB0SIyUXGCIwX/2gAMAwEAAhEDEQA/AP1SgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDXJYgj+d4afsVopM8KWvEcy8it1pXdMcjXO/Lnn+im2u0cwV2VniW1UXEBAQEBAQEBAQEBAQRNlc+mgyDh7zhv+5WunX5Sw37fCHM2dh48r06ank7N6rn2Ja7qa4hw5BBwQV010uK+/DsO29v/J68SOI86Jxjl95HIP4gryPc0fHfHaXu+j7Py68zzHSVquV2iAgICAgICAgICDyTr6HdHz4PTnwypjnqic46OauNbY6mGX99p+L8w9xaeV6OufHt0eXtr59M9VFb194E9LmuH3kf6rv17avO2ets7YVcuuuk/uOa3PgBlxP4BdMbq9nLPqbJ5xDbSM9azFXpyujuSO+Bo5kcf0NPyj25We2YtEzaPxdfr6519Kz+UvqEIlELBKQZQ0eYRwC7HOPxXzVsZ6cPpK5x15ZKEiAgICAgICAgICCNc1tG40CzA2XHg4j4h9zhyFpr22p+s4Z7NNL/ALRlTX+1dVFBJOJrcTI2lxZHYcBx+sldWv3bzOMVn6fZy39OkRnNo+v3aoOx9JOxks8tqwHDPS+1IW8+IzGWZVrf9DZHSMR/j9yvo656zMz9V1rdLqdYwsoVIqwd87mNAc79Tvmd+JXJt332ftMy6temlP1jCasmggICAgICAgICAgwlmiib1SPDB7zhWrWZ4VtaI5QXb2l5ojYHvLjjIGB/dbR61sZlhPtVziFb3PYdd0luCvAZbXludVZ1huZQPgyTx4/atvWj4rxaZ6d/6Ye1/t1zSI6zx/bzti5YqaOpBeg8u41n/oa14cA4ccH7lPs1jZebVn8eyPUtOrXFbR+XdYx9xa90pjeXROaSCXDj+oysZ9S+Mx1bR7uvOJ6LGOWKVgfG8PafAtOQueazHLqraJjMMlCRAQEBAQEBAQRLNp4HTFx/2/4WtKR3Y32T2Udl8j3knk/aeSu6kREPPvaZlpY3DmyY8DyrzPZWv8tkvmFv7bg12RyR1DGeeMj2KnjE9JaeUx1hi1sgaet/U7JIOMcE8Dj7FMREcK2zPKMasr5XO6fmOVt5xEOadVplYU45IAOhxa72kLm2TFuXXqrNeF1WtlwDZeHfmHguO+vHDupszylLJsICAgICAg8cMjCQiYR5IVpFmc1Q5qLXHPgfbhbV2MLaYlqNQAYA4V/kV+PDA1fcp81fjYurtYMu4CmLZRNYhtZWBAI8CqzdaKN8df3LObtIokxwe5ZzZrFUloIGFnLWHqhIgICAgICAgxMbSpyjDAwAq3kr4MTWCnzR4MX02PGHDISNmETqieWba7QABwB4KJumKNgjaFXK0VZYChYQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEHzvuv1G7k1W9s6/Xamtaq15oaonmnsCR008HntaI4K8/s4HOeEGXZXqTud7uqtG7r6kNa5HdMU9aaw9zZde+FkrHsnr1+M2MZBPIKDRe9cO2K2mjs/V0m7X61lWzq32W+ZFEbfkSSO4B+GL9zw4QWm99TqFVmjsaSu7fUtxeNM2aTmSMBbHI9zWHqHVJlnDTxjPKCJL6sea502t1D7Ouhr0rNqxNM2CSNuwnkgjAi6ZOotdEc/Egibf1j/j+7JNL9DWdWg84TWn2ywtdFKyMZb5Tg0nLyG55x48IJ3bXqe/ea/a26dFtyTXtldDUqyOdNL5VqaDHS5gwXRxMe3xz1Y9iDKP1Sa7uefUnR7TyYqUVoEU5jY6pJZIz1RY4ZiMYd7TkexBA749Wr2gtCKlrIpGs17NjK29LLWmPmMsyiFkbIZsPEdKQu6y0eAQWdD1E2L93W1tzRyCDY3paev2NaxVlhIjidMfMb5vmse1kbi9pZ7MeKDt0BAQEBAQfEPU+lFY2++q2K1uSSezTnrReVsTTmiZVYHOd9LVuQyubIwANkbxz4FA7FsQ0NrrLNXX7N0eo1+3darGDYPjb5j6prxVRajjDetsRAjj4yM4CDre2uxO7q2hqtm7nua6w9rp5tfXgoSxwyTOMr42PlrPe4Nc8jJJQRDb3Oz1fYFrcV7As0mu3u7nbWkBZ9LSfG5nlxs/yySWRiNozwcBBx9EXadGTXz62+LG41+jZS6adhzS6vfnlkEjgzEZax7T8ePFBu3nbPdUXqJZsw6S5cqbCW1YdIY2lxhhfEGMjfHtoG9HxucwPEZy4/A7kMC87aq2Kmv7mdvxuqGmklFjUU4G2Yp21rdyW00t+kJkFl88pY9vDgwNDvEoK9np73FBcHdkrt2+rZd5FjQx7O0b8WvbzDKZhN1SSse573QdeAHkN+Ichj3p2rBvZq9vUnY2tcNQPqpZYZpJ44GxXqzHdVlzZZpib73mLHViI85c1BZ6OpsIe/6/XSuntevdsz6+8+pI0/yM1dtWVr2Z644P8rmyuj6S53jxkh9aQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBB/9k="};return(t,o)=>($i(),Ui("div",{class:Me(nm+` ${nm}-styles`),"data-id":e.id,onMouseleave:d},[r.value.length>0&&e.show?($i(),Ui(Ni,{key:0},[Zi("div",{class:Me(nm+"__header")},[Zi("div",{class:Me(nm+"__header_button"),onClick:o[0]||(o[0]=e=>(s("chooseStyle",[]),void(l.value="")))},Hh,2),Zi("div",{class:Me(nm+"__header_search")},[Wh,Hn(Zi("textarea",{class:"search","onUpdate:modelValue":o[1]||(o[1]=e=>l.value=e),dir:"ltr",rows:1,placeholder:hn(V)("Type here to search styles ...")},null,8,Yh),[[Zr,l.value]])],2)],2),Zi("div",{class:Me(nm+"__content"),onMouseleave:a},[($i(!0),Ui(Ni,null,bo(r.value,((t,o)=>($i(),Ui("div",{class:Me(nm+"-item"),key:o,onMouseenter:e=>(async e=>{if(!e.imageSrc){if(e.imageLoading)return;e.imageLoading=!0;const t=await p(e.imgName).finally((()=>e.imageLoading=!1));e.imageSrc=t}u.name="zh-CN"==z&&e.name_cn?e.name_cn:e.name,u.positive=e.prompt,u.negative=e.negative_prompt,u.src=e.imageSrc})(t),onMouseleave:Qr((e=>d()),["stop"])},[Zi("span",{class:Me([nm+"-item__tag",{hide:!(e.selectedStyles.includes(t.name)||-1!=c(t.name).indexOf(c(l.value))||t.name_cn&&-1!=c(t.name_cn).indexOf(c(l.value)))}]),onClick:e=>(e=>{let t=n.selectedStyles;t.includes(e.name)?t=t.filter((t=>t!==e.name)):t.push(e.name),s("chooseStyle",t)})(t)},[Zi("input",{type:"checkbox",name:t.name,checked:e.selectedStyles.includes(t.name)},null,8,Xh),Zi("span",null,Be("zh-CN"==hn(z)&&t.name_cn?t.name_cn:t.name),1)],10,Kh)],42,Zh)))),128))],34),(null==u?void 0:u.src)?($i(),Ui("div",{key:0,class:Me(nm+"-preview")},[Zi("img",{src:u.src,ref:"image",alt:"preview",onError:f},null,40,Qh),Zi("div",{class:Me(nm+"-preview__text")},[Zi("b",null,Be(u.name),1),Zi("div",{class:Me(nm+"-preview__prompt")},[u.positive?($i(),Ui("h6",Jh,[qh,Zi("span",null,Be(u.positive),1)])):Ji("",!0),u.negative?($i(),Ui("h6",em,[tm,Zi("span",null,Be(u.negative),1)])):Ji("",!0)],2)],2)],2)):Ji("",!0)],64)):Ji("",!0)],42,Vh))}},im=["data-id"],rm=["onClick"],sm=["name","checked"],am="comfyui-easyuse-selector",lm={__name:"segSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selected:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:t}){const n=e,o=pn([]);bi((e=>n.type),(async e=>{switch(e){case"selfie_multiclass_256x256":o.value=["Background","Hair","Body","Face","Clothes","Others"];break;case"human_parsing_lip":o.value=["Background","Hat","Hair","Glove","Sunglasses","Upper-clothes","Dress","Coat","Socks","Pants","Jumpsuits","Scarf","Skirt","Face","Left-arm","Right-arm","Left-leg","Right-leg","Left-shoe","Right-shoe"]}}),{immediate:!0});const i=t;return(t,r)=>{var s;return $i(),Ui("div",{class:Me(am+` ${am}-seg`),"data-id":e.id},[(null==(s=o.value)?void 0:s.length)>0&&e.show?($i(!0),Ui(Ni,{key:0},bo(o.value,((t,o)=>($i(),Ui("div",{class:Me(am+"-item"),key:o},[Zi("span",{class:Me(am+"-item__tag"),onClick:e=>(e=>{let t=tp(n.selected);t.includes(e)?t=t.filter((t=>t!==e)):t.push(e),i("select",t)})(t)},[Zi("input",{type:"checkbox",name:t,checked:e.selected.includes(t)},null,8,sm),Zi("span",null,Be(hn(V)(t)),1)],10,rm)],2)))),128)):Ji("",!0)],10,im)}}},cm=["data-id"],um=["onMousedown","onDblclick"],dm="comfyui-easyuse-slider",pm="ipadapter layer weights",fm={__name:"sliderControl",props:{id:{type:String|Number,default:""},mode:{type:String,default:""},type:{type:String,default:""},values:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["changeValues","showSlider"],setup(e,{emit:t}){const n=e,o=t,i=(e,t,n)=>(e-t)/(n-t)*100,r=(e,t,o=void 0)=>{if(n.mode===pm){let n={3:2.5,6:1}[t]||0;return{default:12==e?n:0,min:-1,max:3,step:.05,value:void 0!==o?o:12==e?n:0,top:void 0!==o?100-i(o,-1,3)+"%":null,height:void 0!==o?i(o,-1,3)+"%":null}}};bi((e=>n.mode),(async(e,t)=>{var i;if(e!==t&&e===pm)if(!t&&(null==(i=n.values)?void 0:i.length)>0){const e=n.values.map((e=>{const t=e.split(":");return r(n.values.length,t[0],parseFloat(t[1]))}));await o("changeValues",e)}else{let e="sd1"==n.type?16:12,t=Array.from({length:e},((t,n)=>r(e,n)));await o("changeValues",t)}o("showSlider")}),{immediate:!0}),bi((e=>n.type),((e,t)=>{if(e!=t&&n.mode==pm){let e="sd1"==n.type?16:12,t=Array.from({length:e},((t,n)=>r(e,n)));o("changeValues",t)}}));const s=pn(null),a=pn(null);return oo((()=>{document.onmouseup=e=>document.onmousemove=null})),(t,r)=>{var l;return $i(),Ui("div",{class:Me(dm),"data-id":e.id},[(null==(l=e.values)?void 0:l.length)>0&&e.show?($i(!0),Ui(Ni,{key:0},bo(e.values,((t,r)=>($i(),Ui("div",{class:Me([dm+"-item",{positive:3==r&&"sdxl"==e.type&&e.mode==pm},{negative:6==r&&"sdxl"==e.type&&e.mode==pm}]),key:r},[Zi("div",{class:Me(dm+"-item-input")},Be(t.value),3),Zi("div",{class:Me(dm+"-item-scroll"),ref_for:!0,ref_key:"scroll",ref:s},[Zi("div",{class:Me(dm+"-item-bar"),ref_for:!0,ref_key:"bar",ref:a,style:Ie({top:t.top||100-i(t.default,t.min,t.max)+"%"}),onMousedown:e=>((e,t,i)=>{let r=e||window.event,l=s.value[i],c=a.value[i],u=tp(n.values),d=r.clientY-c.offsetTop;document.onmousemove=e=>{let n=(e||window.event).clientY-d;n<0?n=0:n>l.offsetHeight-c.offsetHeight&&(n=l.offsetHeight-c.offsetHeight);let r=(t.max-t.min)/t.step,s=(l.offsetHeight-c.offsetHeight)/r;n=Math.round(n/s)*s;const a=Math.floor(n/(l.offsetHeight-c.offsetHeight)*100)+"%",p=Math.floor((l.offsetHeight-c.offsetHeight-n)/(l.offsetHeight-c.offsetHeight)*100)+"%",f=parseFloat(parseFloat(t.max-(t.max-t.min)*(n/(l.offsetHeight-c.offsetHeight))).toFixed(2));u[i]={...u[i],top:a,height:p,value:f},o("changeValues",u),window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}})(e,t,r),onDblclick:e=>((e,t,i)=>{let r=tp(n.values);r[i]={...r[i],top:null,height:null,value:t.default},o("changeValues",r)})(0,t,r)},null,46,um),Zi("div",{class:Me(dm+"-item-area"),style:Ie({height:t.height||i(t.default,t.min,t.max)+"%"})},null,6)],2),Zi("div",{class:Me(dm+"-item-label")},[Zi("span",null,Be(t.label),1)],2)],2)))),128)):Ji("",!0)],8,cm)}}},hm={__name:"index",setup(e){const t=zh(),{selectors:n,seg_selectors:o,slider_controls:i}=ws(t),r=pn({}),s=async e=>{var o,i,s,a,l,c;await W(1);const u=wp(e,"styles"),d=(null==(o=e.properties.values)?void 0:o.length)>0?e.properties.values:[];let p=tp(n.value);p.push({id:e.id,type:u.value,value:d,show:!1});const f=p.length-1;await t.setSelectors(p);let h=null==(a=null==(s=null==(i=r.value[e.id])?void 0:i._)?void 0:s.vnode)?void 0:a.el;if(!h)return;let m=e.addDOMWidget("select_styles","btn",h);e.properties.values||e.setProperty("values",[]),p[f].show=!0,await t.setSelectors(p);let g=u.value;Object.defineProperty(u,"value",{set:n=>{g=n,p[f].type=n,e.properties.values=[],p[f].value=[],t.setSelectors(p)},get:e=>g}),Object.defineProperty(m,"value",{set:e=>{setTimeout((n=>{p[f].value=e.split(","),t.setSelectors(p)}),150)},get:t=>{var o,i;return e.properties.values=(null==(i=null==(o=n.value)?void 0:o[f])?void 0:i.value)||[],e.properties.values.join(",")}}),((null==(l=e.size)?void 0:l[0])<150||(null==(c=e.size)?void 0:c[1])<150)&&e.setSize([425,500]);const v=e.onRemoved;e.onRemoved=function(){if(v&&(null==v||v.apply(this,arguments)),void 0!==n.value.findIndex((t=>t.id==e.id))){let e=tp(n.value);e.splice(f,1),t.setSelectors(e)}return v}},a=pn({}),l=async e=>{var n,i,r,s;await W(1);const l=wp(e,"method"),c=(null==(n=e.properties.values)?void 0:n.length)>0?e.properties.values:[];let u=tp(o.value);u.push({id:e.id,type:l.value,value:c,show:!1});const d=u.length-1;await t.setSegSelectors(u);let p=null==(s=null==(r=null==(i=a.value[e.id])?void 0:i._)?void 0:r.vnode)?void 0:s.el;if(!p)return;let f=e.addDOMWidget("mask_components","btn",p);e.properties.values||e.setProperty("values",[]),u[d].show=!0,await t.setSegSelectors(u);let h=l.value;Object.defineProperty(l,"value",{set:n=>{h=n,u[d].type=n,e.properties.values=[],u[d].value=[],Sp(e,wp(e,"confidence"),"selfie_multiclass_256x256"===h),e.setSize([300,"selfie_multiclass_256x256"===h?260:500]),t.setSegSelectors(u)},get:e=>h}),Object.defineProperty(f,"value",{set:e=>{setTimeout((n=>{u[d].value=e.split(","),t.setSegSelectors(u)}),150)},get:t=>{var n;return e.properties.values=(null==(n=o.value)?void 0:n[d].value)||[],e.properties.values.join(",")}}),Sp(e,wp(e,"confidence"),"selfie_multiclass_256x256"===h),e.setSize([300,"selfie_multiclass_256x256"===h?260:500]);const m=e.onRemoved;e.onRemoved=function(){if(m&&(null==m||m.apply(this,arguments)),void 0!==o.value.findIndex((t=>t.id==e.id))){let e=tp(o.value);e.splice(d,1),t.setSegSelectors(e)}return m}},c=pn({}),u=async e=>{var n,o,r,s;await W(1);const a=wp(e,"mode"),l=wp(e,"model_type"),u=(null==(n=e.properties.values)?void 0:n.length)>0?e.properties.values:[];let d=tp(i.value);d.push({id:e.id,type:l.value,mode:a.value,value:u,show:!1});const p=d.length-1;await t.setSliderControls(d);let f=null==(s=null==(r=null==(o=c.value[e.id])?void 0:o._)?void 0:r.vnode)?void 0:s.el;if(!f)return;let h=e.addDOMWidget("values","btn",f);e.properties.values||e.setProperty("values",[]),Object.defineProperty(h,"value",{set:function(){},get:t=>{var n;const o=(null==(n=i.value)?void 0:n[p].value)||[];return e.properties.values=o.map(((e,t)=>`${t}:${e.value}`)),e.properties.values.join(",")}}),e.setSize("sdxl"==l.value?[375,320]:[455,320]),l.callback=n=>{d=tp(i.value),d[p].type!=n&&(e.setSize("sdxl"==n?[375,320]:[455,320]),d[p].value=[],d[p].type=n,t.setSliderControls(d))};const m=e.onRemoved;e.onRemoved=function(){if(m&&(null==m||m.apply(this,arguments)),void 0!==i.value.findIndex((t=>t.id==e.id))){let e=tp(i.value);e.splice(p,1),t.setSliderControls(e)}return m}};return oo((e=>{y.registerExtension({name:"Comfy.EasyUse.Components",async beforeRegisterNodeDef(e,t){const n=e.prototype.onNodeCreated;"easy stylesSelector"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await s(this),n}),"easy humanSegmentation"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await l(this),n}),"easy sliderControl"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await u(this),n})}})})),(e,s)=>($i(),Ui(Ni,null,[($i(!0),Ui(Ni,null,bo(hn(n),((e,o)=>($i(),zi(om,{ref_for:!0,ref:t=>{t&&(r.value[e.id]=t)},type:e.type,key:o,id:e.id,show:e.show,selectedStyles:e.value,onChooseStyle:e=>((e,o)=>{let i=tp(n.value);i[o].value=e,t.setSelectors(i)})(e,o)},null,8,["type","id","show","selectedStyles","onChooseStyle"])))),128)),($i(!0),Ui(Ni,null,bo(hn(o),((e,n)=>($i(),zi(lm,{ref_for:!0,ref:t=>{t&&(a.value[e.id]=t)},type:e.type,key:n,id:e.id,show:e.show,selected:e.value,onSelect:e=>((e,n)=>{let i=tp(o.value);i[n].value=e,t.setSegSelectors(i)})(e,n)},null,8,["type","id","show","selected","onSelect"])))),128)),($i(!0),Ui(Ni,null,bo(hn(i),((e,n)=>($i(),zi(fm,{ref_for:!0,ref:t=>{t&&(c.value[e.id]=t)},type:e.type,key:n,id:e.id,show:e.show,mode:e.mode,values:e.value,onChangeValues:e=>((e,n)=>{let o=tp(i.value);o[n].value=e,t.setSliderControls(o)})(e,n),onShowSlider:e=>(e=>{let n=tp(i.value);n[e].show=!0,t.setSliderControls(n)})(n)},null,8,["type","id","show","mode","values","onChangeValues","onShowSlider"])))),128))],64))}};var mm=Object.defineProperty,gm=Object.getOwnPropertySymbols,vm=Object.prototype.hasOwnProperty,ym=Object.prototype.propertyIsEnumerable,bm=(e,t,n)=>t in e?mm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function _m(e){return null==e||""===e||Array.isArray(e)&&0===e.length||!(e instanceof Date)&&"object"==typeof e&&0===Object.keys(e).length}function wm(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Sm(e){return!_m(e)}function xm(e,t=!0){return e instanceof Object&&e.constructor===Object&&(t||0!==Object.keys(e).length)}function km(e,...t){return wm(e)?e(...t):e}function Cm(e,t=!0){return"string"==typeof e&&(t||""!==e)}function Am(e){return Cm(e)?e.replace(/(-|_)/g,"").toLowerCase():e}function Em(e,t="",n={}){const o=Am(t).split("."),i=o.shift();return i?xm(e)?Em(km(e[Object.keys(e).find((e=>Am(e)===i))||""],n),o.join("."),n):void 0:km(e,n)}function Om(e,t=!0){return Array.isArray(e)&&(t||0!==e.length)}function Lm(e){return Sm(e)&&!isNaN(e)}function Tm(e,t){if(t){const n=t.test(e);return t.lastIndex=0,n}return!1}function Im(...e){const t=(e={},n={})=>{const o=((e,t)=>{for(var n in t||(t={}))vm.call(t,n)&&bm(e,n,t[n]);if(gm)for(var n of gm(t))ym.call(t,n)&&bm(e,n,t[n]);return e})({},e);return Object.keys(n).forEach((i=>{xm(n[i])&&i in e&&xm(e[i])?o[i]=t(e[i],n[i]):o[i]=n[i]})),o};return e.reduce(((e,n,o)=>0===o?n:t(e,n)),{})}function Nm(e){return e?e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":"):e}function Pm(e){return Cm(e)?e.replace(/(_)/g,"-").replace(/[A-Z]/g,((e,t)=>0===t?e:"-"+e.toLowerCase())).toLowerCase():e}function Dm(e){return Cm(e)?e.replace(/[A-Z]/g,((e,t)=>0===t?e:"."+e.toLowerCase())).toLowerCase():e}function jm(){const e=new Map;return{on(t,n){let o=e.get(t);return o?o.push(n):o=[n],e.set(t,o),this},off(t,n){let o=e.get(t);return o&&o.splice(o.indexOf(n)>>>0,1),this},emit(t,n){let o=e.get(t);o&&o.slice().map((e=>{e(n)}))},clear(){e.clear()}}}var Mm=Object.defineProperty,Rm=Object.defineProperties,$m=Object.getOwnPropertyDescriptors,Gm=Object.getOwnPropertySymbols,Bm=Object.prototype.hasOwnProperty,Fm=Object.prototype.propertyIsEnumerable,Um=(e,t,n)=>t in e?Mm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zm=(e,t)=>{for(var n in t||(t={}))Bm.call(t,n)&&Um(e,n,t[n]);if(Gm)for(var n of Gm(t))Fm.call(t,n)&&Um(e,n,t[n]);return e},Vm=(e,t)=>Rm(e,$m(t)),Hm=(e,t)=>{var n={};for(var o in e)Bm.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&Gm)for(var o of Gm(e))t.indexOf(o)<0&&Fm.call(e,o)&&(n[o]=e[o]);return n},Wm=jm();function Ym(e,t){Om(e)?e.push(...t||[]):xm(e)&&Object.assign(e,t)}function Zm(e,t=""){if(!["opacity","z-index","line-height","font-weight","flex","flex-grow","flex-shrink","order"].some((e=>t.endsWith(e)))){return`${e}`.trim().split(" ").map((e=>Lm(e)?`${e}px`:e)).join(" ")}return e}function Km(e="",t=""){return function(e){return e.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}(`${Cm(e,!1)&&Cm(t,!1)?`${e}-`:e}${t}`)}function Xm(e="",t=""){return`--${Km(e,t)}`}function Qm(e,t="",n="",o=[],i){if(Cm(e)){const r=/{([^}]*)}/g,s=e.trim();if(Tm(s,r)){const e=s.replaceAll(r,(e=>{const t=e.replace(/{|}/g,"").split(".").filter((e=>!o.some((t=>Tm(e,t)))));return`var(${Xm(n,Pm(t.join("-")))}${Sm(i)?`, ${i}`:""})`})),t=/(\d+\s+[\+\-\*\/]\s+\d+)/g,a=/var\([^)]+\)/g;return Tm(e.replace(a,"0"),t)?`calc(${e})`:e}return Zm(s,t)}if(Lm(e))return Zm(e,t)}function Jm(e,t){return e?`${e}{${t}}`:""}var qm=(...e)=>eg(og.getTheme(),...e),eg=(e={},t,n,o="variable")=>{if(t){const{variable:i,options:r}=og.defaults||{},{prefix:s,transform:a}=(null==e?void 0:e.options)||r||{},l=Tm(t,/{([^}]*)}/g)?t:`{${t}}`;return"value"===o||"strict"===a?og.getTokenValue(t):Qm(l,void 0,s,[i.excludedKeyRegex],n)}return""};function tg(e,t={}){const n=og.defaults.variable,{prefix:o=n.prefix,selector:i=n.selector,excludedKeyRegex:r=n.excludedKeyRegex}=t,s=(e,t="")=>Object.entries(e).reduce(((e,[n,i])=>{const a=Tm(n,r)?Km(t):Km(t,Pm(n)),l=function(e){return xm(e)&&e.hasOwnProperty("value")&&e.hasOwnProperty("type")?e.value:e}(i);if(xm(l)){const{variables:t,tokens:n}=s(l,a);Ym(e.tokens,n),Ym(e.variables,t)}else e.tokens.push((o?a.replace(`${o}-`,""):a).replaceAll("-",".")),function(e,t,n){Cm(t,!1)&&e.push(`${t}:${n};`)}(e.variables,Xm(a),Qm(l,a,o,[r]));return e}),{variables:[],tokens:[]}),{variables:a,tokens:l}=s(e,o);return{value:a,tokens:l,declarations:a.join(""),css:Jm(i,a.join(""))}}var ng={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(e){return{type:"class",selector:e,matched:this.pattern.test(e.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(e){return{type:"attr",selector:`:root${e}`,matched:this.pattern.test(e.trim())}}},media:{pattern:/^@media (.*)$/,resolve(e){return{type:"media",selector:`${e}{:root{[CSS]}}`,matched:this.pattern.test(e.trim())}}},system:{pattern:/^system$/,resolve(e){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(e.trim())}}},custom:{resolve:e=>({type:"custom",selector:e,matched:!0})}},resolve(e){const t=Object.keys(this.rules).filter((e=>"custom"!==e)).map((e=>this.rules[e]));return[e].flat().map((e=>{var n;return null!=(n=t.map((t=>t.resolve(e))).find((e=>e.matched)))?n:this.rules.custom.resolve(e)}))}},_toVariables:(e,t)=>tg(e,{prefix:null==t?void 0:t.prefix}),getCommon({name:e="",theme:t={},params:n,set:o,defaults:i}){var r,s,a,l;const{preset:c,options:u}=t;let d,p,f,h;if(Sm(c)){const{primitive:t,semantic:n}=c,m=n||{},{colorScheme:g}=m,v=Hm(m,["colorScheme"]),y=g||{},{dark:b}=y,_=Hm(y,["dark"]),w=Sm(t)?this._toVariables({primitive:t},u):{},S=Sm(v)?this._toVariables({semantic:v},u):{},x=Sm(_)?this._toVariables({light:_},u):{},k=Sm(b)?this._toVariables({dark:b},u):{},[C,A]=[null!=(r=w.declarations)?r:"",w.tokens],[E,O]=[null!=(s=S.declarations)?s:"",S.tokens||[]],[L,T]=[null!=(a=x.declarations)?a:"",x.tokens||[]],[I,N]=[null!=(l=k.declarations)?l:"",k.tokens||[]];d=this.transformCSS(e,C,"light","variable",u,o,i),p=A;f=`${this.transformCSS(e,`${E}${L}color-scheme:light`,"light","variable",u,o,i)}${this.transformCSS(e,`${I}color-scheme:dark`,"dark","variable",u,o,i)}`,h=[...new Set([...O,...T,...N])]}return{primitive:{css:d,tokens:p},semantic:{css:f,tokens:h}}},getPreset({name:e="",preset:t={},options:n,params:o,set:i,defaults:r,selector:s}){var a,l,c;const u=e.replace("-directive",""),d=t,{colorScheme:p}=d,f=Hm(d,["colorScheme"]),h=p||{},{dark:m}=h,g=Hm(h,["dark"]),v=Sm(f)?this._toVariables({[u]:f},n):{},y=Sm(g)?this._toVariables({[u]:g},n):{},b=Sm(m)?this._toVariables({[u]:m},n):{},[_,w]=[null!=(a=v.declarations)?a:"",v.tokens||[]],[S,x]=[null!=(l=y.declarations)?l:"",y.tokens||[]],[k,C]=[null!=(c=b.declarations)?c:"",b.tokens||[]],A=[...new Set([...w,...x,...C])];return{css:`${this.transformCSS(u,`${_}${S}`,"light","variable",n,i,r,s)}${this.transformCSS(u,k,"dark","variable",n,i,r,s)}`,tokens:A}},getPresetC({name:e="",theme:t={},params:n,set:o,defaults:i}){var r;const{preset:s,options:a}=t,l=null==(r=null==s?void 0:s.components)?void 0:r[e];return this.getPreset({name:e,preset:l,options:a,params:n,set:o,defaults:i})},getPresetD({name:e="",theme:t={},params:n,set:o,defaults:i}){var r;const s=e.replace("-directive",""),{preset:a,options:l}=t,c=null==(r=null==a?void 0:a.directives)?void 0:r[s];return this.getPreset({name:s,preset:c,options:l,params:n,set:o,defaults:i})},getColorSchemeOption(e,t){var n;return this.regex.resolve(null!=(n=e.darkModeSelector)?n:t.options.darkModeSelector)},getLayerOrder(e,t={},n,o){const{cssLayer:i}=t;if(i){return`@layer ${km(i.order||"primeui",n)}`}return""},getCommonStyleSheet({name:e="",theme:t={},params:n,props:o={},set:i,defaults:r}){const s=this.getCommon({name:e,theme:t,params:n,set:i,defaults:r}),a=Object.entries(o).reduce(((e,[t,n])=>e.push(`${t}="${n}"`)&&e),[]).join(" ");return Object.entries(s||{}).reduce(((e,[t,n])=>{if(null==n?void 0:n.css){const o=Nm(null==n?void 0:n.css),i=`${t}-variables`;e.push(``)}return e}),[]).join("")},getStyleSheet({name:e="",theme:t={},params:n,props:o={},set:i,defaults:r}){var s;const a={name:e,theme:t,params:n,set:i,defaults:r},l=null==(s=e.includes("-directive")?this.getPresetD(a):this.getPresetC(a))?void 0:s.css,c=Object.entries(o).reduce(((e,[t,n])=>e.push(`${t}="${n}"`)&&e),[]).join(" ");return l?``:""},createTokens(e={},t,n="",o="",i={}){return Object.entries(e).forEach((([e,r])=>{const s=Tm(e,t.variable.excludedKeyRegex)?n:n?`${n}.${Dm(e)}`:Dm(e),a=o?`${o}.${e}`:e;xm(r)?this.createTokens(r,t,s,a,i):(i[s]||(i[s]={paths:[],computed(e,t={}){if(e){const n=this.paths.find((t=>t.scheme===e))||this.paths.find((e=>"none"===e.scheme));return null==n?void 0:n.computed(e,t.binding)}return this.paths.map((e=>e.computed(e.scheme,t[e.scheme])))}}),i[s].paths.push({path:a,value:r,scheme:a.includes("colorScheme.light")?"light":a.includes("colorScheme.dark")?"dark":"none",computed(e,t={}){const n=/{([^}]*)}/g;let o=r;if(t.name=this.path,t.binding||(t.binding={}),Tm(r,n)){const s=r.trim().replaceAll(n,(n=>{var o,r;const s=n.replace(/{|}/g,"");return null==(r=null==(o=i[s])?void 0:o.computed(e,t))?void 0:r.value})),a=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,l=/var\([^)]+\)/g;o=Tm(s.replace(l,"0"),a)?`calc(${s})`:s}return _m(t.binding)&&delete t.binding,{colorScheme:e,path:this.path,paths:t,value:o.includes("undefined")?void 0:o}}}))})),i},getTokenValue(e,t,n){var o;const i=t.split(".").filter((e=>!Tm(e.toLowerCase(),n.variable.excludedKeyRegex))).join(".");const r=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,s=[null==(o=e[i])?void 0:o.computed(r)].flat().filter((e=>e));return 1===s.length?s[0].value:s.reduce(((e={},t)=>{const n=t,{colorScheme:o}=n,i=Hm(n,["colorScheme"]);return e[o]=i,e}),void 0)},transformCSS(e,t,n,o,i={},r,s,a){if(Sm(t)){const{cssLayer:l}=i;if("style"!==o){const e=this.getColorSchemeOption(i,s),o=a?Jm(a,t):t;t="dark"===n?e.reduce(((e,{selector:t})=>(Sm(t)&&(e+=t.includes("[CSS]")?t.replace("[CSS]",o):Jm(t,o)),e)),""):Jm(null!=a?a:":root",t)}if(l){const n={name:"primeui",order:"primeui"};xm(l)&&(n.name=km(l.name,{name:e,type:o})),Sm(n.name)&&(t=Jm(`@layer ${n.name}`,t),null==r||r.layerNames(n.name))}return t}return""}},og={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(e={}){const{theme:t}=e;t&&(this._theme=Vm(zm({},t),{options:zm(zm({},this.defaults.options),t.options)}),this._tokens=ng.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var e;return(null==(e=this.theme)?void 0:e.preset)||{}},get options(){var e;return(null==(e=this.theme)?void 0:e.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(e){this.update({theme:e}),Wm.emit("theme:change",e)},getPreset(){return this.preset},setPreset(e){this._theme=Vm(zm({},this.theme),{preset:e}),this._tokens=ng.createTokens(e,this.defaults),this.clearLoadedStyleNames(),Wm.emit("preset:change",e),Wm.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(e){this._theme=Vm(zm({},this.theme),{options:e}),this.clearLoadedStyleNames(),Wm.emit("options:change",e),Wm.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(e){this._layerNames.add(e)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(e){return this._loadedStyleNames.has(e)},setLoadedStyleName(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(e){return ng.getTokenValue(this.tokens,e,this.defaults)},getCommon(e="",t){return ng.getCommon({name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPresetC(n)},getDirective(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPresetD(n)},getCustomPreset(e="",t,n,o){const i={name:e,preset:t,options:this.options,selector:n,params:o,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPreset(i)},getLayerOrderCSS(e=""){return ng.getLayerOrder(e,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(e="",t,n="style",o){return ng.transformCSS(e,t,o,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(e="",t,n={}){return ng.getCommonStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(e,t,n={}){return ng.getStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(e){this._loadingStyles.add(e)},onStyleUpdated(e){this._loadingStyles.add(e)},onStyleLoaded(e,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),Wm.emit(`theme:${t}:load`,e),!this._loadingStyles.size&&Wm.emit("theme:load"))}};function ig(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className))}function rg(e,t){if(e&&t){const n=t=>{ig(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)};[t].flat().filter(Boolean).forEach((e=>e.split(" ").forEach(n)))}}function sg(e,t){if(e&&t){const n=t=>{e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")};[t].flat().filter(Boolean).forEach((e=>e.split(" ").forEach(n)))}}function ag(e,t){if(e instanceof HTMLElement){return e.offsetWidth}return 0}function lg(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function cg(e,t={}){if(lg(e)){const n=(t,o)=>{var i,r;const s=(null==(i=null==e?void 0:e.$attrs)?void 0:i[t])?[null==(r=null==e?void 0:e.$attrs)?void 0:r[t]]:[];return[o].flat().reduce(((e,o)=>{if(null!=o){const i=typeof o;if("string"===i||"number"===i)e.push(o);else if("object"===i){const i=Array.isArray(o)?n(t,o):Object.entries(o).map((([e,n])=>"style"!==t||!n&&0!==n?n?e:void 0:`${e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${n}`));e=i.length?e.concat(i.filter((e=>!!e))):e}}return e}),s)};Object.entries(t).forEach((([t,o])=>{if(null!=o){const i=t.match(/^on(.+)/);i?e.addEventListener(i[1].toLowerCase(),o):"p-bind"===t?cg(e,o):(o="class"===t?[...new Set(n("class",o))].join(" ").trim():"style"===t?n("style",o).join(";").trim():o,(e.$attrs=e.$attrs||{})&&(e.$attrs[t]=o),e.setAttribute(t,o))}}))}}function ug(e,t={},...n){if(e){const o=document.createElement(e);return cg(o,t),o.append(...n),o}}function dg(e,t){return lg(e)?e.matches(t)?e:e.querySelector(t):null}function pg(e,t){if(lg(e)){const n=e.getAttribute(t);return isNaN(n)?"true"===n||"false"===n?"true"===n:n:+n}}function fg(e){if(e){let t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),t}return 0}function hg(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function mg(e,t){if(e){return e.offsetHeight}return 0}function gg(e,t=[]){const n=hg(e);return null===n?t:gg(n,t.concat([n]))}function vg(e){let t=[];if(e){let n=gg(e);const o=/(auto|scroll)/,i=e=>{try{let t=window.getComputedStyle(e,null);return o.test(t.getPropertyValue("overflow"))||o.test(t.getPropertyValue("overflowX"))||o.test(t.getPropertyValue("overflowY"))}catch(t){return!1}};for(let e of n){let n=1===e.nodeType&&e.dataset.scrollselectors;if(n){let o=n.split(",");for(let n of o){let o=dg(e,n);o&&i(o)&&t.push(o)}}9!==e.nodeType&&i(e)&&t.push(e)}}return t}function yg(e){return!(null==e||!e.nodeName||!hg(e))}function bg(e){if(e){let t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth),t}return 0}var _g={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(e){return this._loadedStyleNames.has(e)},setLoadedStyleName:function(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName:function(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};function wg(e){return(wg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function xg(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=pn(!1),o=pn(e),i=pn(null),r="undefined"!=typeof window&&window.document&&window.document.createElement?window.document:void 0,s=t.document,a=void 0===s?r:s,l=t.immediate,c=void 0===l||l,u=t.manual,d=void 0!==u&&u,p=t.name,f=void 0===p?"style_".concat(++Cg):p,h=t.id,m=void 0===h?void 0:h,g=t.media,v=void 0===g?void 0:g,y=t.nonce,b=void 0===y?void 0:y,_=t.first,w=void 0!==_&&_,S=t.onMounted,x=void 0===S?void 0:S,k=t.onUpdated,C=void 0===k?void 0:k,A=t.onLoad,E=void 0===A?void 0:A,O=t.props,L=void 0===O?{}:O,T=function(){},I=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(a){var s=xg(xg({},L),r),l=s.name||f,c=s.id||m,u=s.nonce||b;i.value=a.querySelector('style[data-primevue-style-id="'.concat(l,'"]'))||a.getElementById(c)||a.createElement("style"),i.value.isConnected||(o.value=t||e,cg(i.value,{type:"text/css",id:c,media:v,nonce:u}),w?a.head.prepend(i.value):a.head.appendChild(i.value),function(e,t="",n){lg(e)&&null!=n&&e.setAttribute(t,n)}(i.value,"data-primevue-style-id",l),cg(i.value,s),i.value.onload=function(e){return null==E?void 0:E(e,{name:l})},null==x||x(l)),n.value||(T=bi(o,(function(e){i.value.textContent=e,null==C||C(l)}),{immediate:!0}),n.value=!0)}};return c&&!d&&function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ar()?oo(e):t?e():Pn(e)}(I),{id:m,name:f,el:i,css:o,unload:function(){a&&n.value&&(T(),yg(i.value)&&a.head.removeChild(i.value),n.value=!1)},load:I,isLoaded:Qt(n)}}function Eg(e){return(Eg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Og(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,s,a=[],l=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t);else for(;!(l=(o=r.call(n)).done)&&(a.push(o.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Lg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return e})(km(e,{dt:qm}));return n?Ag(Nm(n),Ig({name:this.name},t)):{}},loadCSS:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.load(this.css,e)},loadTheme:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.load(this.theme,t,(function(n){return og.transformCSS(t.name||e.name,n)}))},getCommonTheme:function(e){return og.getCommon(this.name,e)},getComponentTheme:function(e){return og.getComponent(this.name,e)},getDirectiveTheme:function(e){return og.getDirective(this.name,e)},getPresetTheme:function(e,t,n){return og.getCustomPreset(this.name,e,t,n)},getLayerOrderThemeCSS:function(){return og.getLayerOrderCSS(this.name)},getStyleSheet:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.css){var n=km(this.css,{dt:qm}),o=Nm("".concat(n).concat(e)),i=Object.entries(t).reduce((function(e,t){var n=Og(t,2),o=n[0],i=n[1];return e.push("".concat(o,'="').concat(i,'"'))&&e}),[]).join(" ");return'")}return""},getCommonThemeStyleSheet:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return og.getCommonStyleSheet(this.name,e,t)},getThemeStyleSheet:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[og.getStyleSheet(this.name,e,t)];if(this.theme){var o="base"===this.name?"global-style":"".concat(this.name,"-style"),i=km(this.theme,{dt:qm}),r=Nm(og.transformCSS(o,i)),s=Object.entries(t).reduce((function(e,t){var n=Og(t,2),o=n[0],i=n[1];return e.push("".concat(o,'="').concat(i,'"'))&&e}),[]).join(" ");n.push('"))}return n.join("")},extend:function(e){return Ig(Ig({},this),{},{css:void 0,theme:void 0},e)}},Dg={};var jg=function(){let e=[];const t=(t,n,o=0)=>[...e].reverse().find((e=>!0))||{key:t,value:o},n=e=>e&&parseInt(e.style.zIndex,10)||0;return{get:n,set:(n,o,i)=>{o&&(o.style.zIndex=String(((n,o,i=999)=>{const r=t(n,o,i),s=r.value+(r.key===n?0:i)+1;return e.push({key:n,value:s}),s})(n,!0,i)))},clear:t=>{var o;t&&(o=n(t),e=e.filter((e=>e.value!==o)),t.style.zIndex="")},getCurrent:e=>(e=>t(e).value)(e)}}();function Mg(e){return(Mg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rg(e,t,n){return t&&function(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:function(){};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.listener=n}),[{key:"bindScrollListener",value:function(){this.scrollableParents=vg(this.element);for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:"pv_id_")}var Fg=Pg.extend({name:"common"});function Ug(e){return(Ug="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zg(e){return Zg(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wg(e)||Hg()}function Vg(e,t){return Zg(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,s,a=[],l=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=r.call(n)).done)&&(a.push(o.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Wg(e,t)||Hg()}function Hg(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Wg(e,t){if(e){if("string"==typeof e)return Yg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yg(e,t):void 0}}function Yg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:function(){};_g.clearLoadedStyleNames(),Wm.on("theme:change",e)},_getHostInstance:function(e){return e?this.$options.hostName?e.$.type.name===this.$options.hostName?e:this._getHostInstance(e.$parentInstance):e.$parentInstance:void 0},_getPropValue:function(e){var t;return this[e]||(null===(t=this._getHostInstance(this))||void 0===t?void 0:t[e])},_getOptionValue:function(e){return Em(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})},_getPTValue:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=/./g.test(n)&&!!o[n.split(".")[0]],s=this._getPropValue("ptOptions")||(null===(e=this.$primevueConfig)||void 0===e?void 0:e.ptOptions)||{},a=s.mergeSections,l=void 0===a||a,c=s.mergeProps,u=void 0!==c&&c,d=i?r?this._useGlobalPT(this._getPTClassValue,n,o):this._useDefaultPT(this._getPTClassValue,n,o):void 0,p=r?void 0:this._getPTSelf(t,this._getPTClassValue,n,Xg(Xg({},o),{},{global:d||{}})),f=this._getPTDatasets(n);return l||!l&&p?u?this._mergeProps(u,d,p,f):Xg(Xg(Xg({},d),p),f):Xg(Xg({},p),f)},_getPTSelf:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=new Array(t>1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:"",o="data-pc-",i="root"===n&&Sm(null===(e=this.pt)||void 0===e?void 0:e["data-pc-section"]);return"transition"!==n&&Xg(Xg({},"root"===n&&Xg(Qg({},"".concat(o,"name"),Am(i?null===(t=this.pt)||void 0===t?void 0:t["data-pc-section"]:this.$.type.name)),i&&Qg({},"".concat(o,"extend"),Am(this.$.type.name)))),{},Qg({},"".concat(o,"section"),Am(n)))},_getPTClassValue:function(){var e=this._getOptionValue.apply(this,arguments);return Cm(e)||Om(e)?{class:e}:e},_getPT:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2?arguments[2]:void 0,i=function(e){var i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=o?o(e):e,a=Am(n),l=Am(t.$name);return null!==(i=r?a!==l?null==s?void 0:s[a]:void 0:null==s?void 0:s[a])&&void 0!==i?i:s};return null!=e&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:i(e.originalValue),value:i(e.value)}:i(e,!0)},_usePT:function(e,t,n,o){var i=function(e){return t(e,n,o)};if(null!=e&&e.hasOwnProperty("_usept")){var r,s=e._usept||(null===(r=this.$primevueConfig)||void 0===r?void 0:r.ptOptions)||{},a=s.mergeSections,l=void 0===a||a,c=s.mergeProps,u=void 0!==c&&c,d=i(e.originalValue),p=i(e.value);if(void 0===d&&void 0===p)return;return Cm(p)?p:Cm(d)?d:l||!l&&p?u?this._mergeProps(u,d,p):Xg(Xg({},d),p):p}return i(e)},_useGlobalPT:function(e,t,n){return this._usePT(this.globalPT,e,t,n)},_useDefaultPT:function(e,t,n){return this._usePT(this.defaultPT,e,t,n)},ptm:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._getPTValue(this.pt,e,Xg(Xg({},this.$params),t))},ptmi:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nr(this.$_attrsWithoutPT,this.ptm(e,t))},ptmo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._getPTValue(e,t,Xg({instance:this},n),!1)},cx:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,e,Xg(Xg({},this.$params),t))},sx:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var n=this._getOptionValue(this.$style.inlineStyles,e,Xg(Xg({},this.$params),t));return[this._getOptionValue(Fg.inlineStyles,e,Xg(Xg({},this.$params),t)),n]}}},computed:{globalPT:function(){var e,t=this;return this._getPT(null===(e=this.$primevueConfig)||void 0===e?void 0:e.pt,void 0,(function(e){return km(e,{instance:t})}))},defaultPT:function(){var e,t=this;return this._getPT(null===(e=this.$primevueConfig)||void 0===e?void 0:e.pt,void 0,(function(e){return t._getOptionValue(e,t.$name,Xg({},t.$params))||km(e,Xg({},t.$params))}))},isUnstyled:function(){var e;return void 0!==this.unstyled?this.unstyled:null===(e=this.$primevueConfig)||void 0===e?void 0:e.unstyled},$theme:function(){var e;return null===(e=this.$primevueConfig)||void 0===e?void 0:e.theme},$style:function(){return Xg(Xg({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var e;return{nonce:null===(e=this.$primevueConfig)||void 0===e||null===(e=e.csp)||void 0===e?void 0:e.nonce}},$primevueConfig:function(){var e;return null===(e=this.$primevue)||void 0===e?void 0:e.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var e=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:e,props:null==e?void 0:e.$props,state:null==e?void 0:e.$data,attrs:null==e?void 0:e.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter((function(e){var t=Vg(e,1)[0];return null==t?void 0:t.startsWith("pt:")})).reduce((function(e,t){var n=Vg(t,2),o=n[0],i=n[1],r=zg(o.split(":")).slice(1);return null==r||r.reduce((function(e,t,n,o){return!e[t]&&(e[t]=n===o.length-1?i:{}),e[t]}),e),e}),{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter((function(e){var t=Vg(e,1)[0];return!(null!=t&&t.startsWith("pt:"))})).reduce((function(e,t){var n=Vg(t,2),o=n[0],i=n[1];return e[o]=i,e}),{})},$attrSelector:function(){return Bg("pc")}}},qg=Pg.extend({name:"baseicon",css:"\n.p-icon {\n display: inline-block;\n vertical-align: baseline;\n}\n\n.p-icon-spin {\n -webkit-animation: p-icon-spin 2s infinite linear;\n animation: p-icon-spin 2s infinite linear;\n}\n\n@-webkit-keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n@keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n"});function ev(e){return(ev="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function nv(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,o=Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=function(){var e=gv._getOptionValue.apply(gv,arguments);return Cm(e)||Om(e)?{class:e}:e},l=(null===(e=n.binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.ptOptions)||(null===(t=n.$primevueConfig)||void 0===t?void 0:t.ptOptions)||{},c=l.mergeSections,u=void 0===c||c,d=l.mergeProps,p=void 0!==d&&d,f=s?gv._useDefaultPT(n,n.defaultPT(),a,i,r):void 0,h=gv._usePT(n,gv._getPT(o,n.$name),a,i,hv(hv({},r),{},{global:f||{}})),m=gv._getPTDatasets(n,i);return u||!u&&h?p?gv._mergeProps(n,p,f,h,m):hv(hv(hv({},f),h),m):hv(hv({},h),m)},_getPTDatasets:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="data-pc-";return hv(hv({},"root"===t&&mv({},"".concat(n,"name"),Am(e.$name))),{},mv({},"".concat(n,"section"),Am(t)))},_getPT:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,o=function(e){var o,i=n?n(e):e,r=Am(t);return null!==(o=null==i?void 0:i[r])&&void 0!==o?o:i};return null!=e&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:o(e.originalValue),value:o(e.value)}:o(e)},_usePT:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=function(e){return n(e,o,i)};if(null!=t&&t.hasOwnProperty("_usept")){var s,a=t._usept||(null===(s=e.$primevueConfig)||void 0===s?void 0:s.ptOptions)||{},l=a.mergeSections,c=void 0===l||l,u=a.mergeProps,d=void 0!==u&&u,p=r(t.originalValue),f=r(t.value);if(void 0===p&&void 0===f)return;return Cm(f)?f:Cm(p)?p:c||!c&&f?d?gv._mergeProps(e,d,p,f):hv(hv({},p),f):f}return r(t)},_useDefaultPT:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return gv._usePT(e,t,n,o,i)},_loadStyles:function(e,t,n){var o,i=gv._getConfig(t,n),r={nonce:null==i||null===(o=i.csp)||void 0===o?void 0:o.nonce};gv._loadCoreStyles(e.$instance,r),gv._loadThemeStyles(e.$instance,r),gv._loadScopedThemeStyles(e.$instance,r),gv._themeChangeListener((function(){return gv._loadThemeStyles(e.$instance,r)}))},_loadCoreStyles:function(){var e,t,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;!_g.isStyleNameLoaded(null===(e=o.$style)||void 0===e?void 0:e.name)&&null!==(t=o.$style)&&void 0!==t&&t.name&&(Pg.loadCSS(i),o.isUnstyled()&&(null===(n=o.$style)||void 0===n||n.loadCSS(i)),_g.setLoadedStyleName(o.$style.name))},_loadThemeStyles:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(null==n||!n.isUnstyled()){if(!og.isStyleNameLoaded("common")){var i,r,s=(null===(i=n.$style)||void 0===i||null===(r=i.getCommonTheme)||void 0===r?void 0:r.call(i))||{},a=s.primitive,l=s.semantic;Pg.load(null==a?void 0:a.css,hv({name:"primitive-variables"},o)),Pg.load(null==l?void 0:l.css,hv({name:"semantic-variables"},o)),Pg.loadTheme(hv({name:"global-style"},o)),og.setLoadedStyleName("common")}if(!og.isStyleNameLoaded(null===(e=n.$style)||void 0===e?void 0:e.name)&&null!==(t=n.$style)&&void 0!==t&&t.name){var c,u,d,p,f=((null===(c=n.$style)||void 0===c||null===(u=c.getDirectiveTheme)||void 0===u?void 0:u.call(c))||{}).css;null===(d=n.$style)||void 0===d||d.load(f,hv({name:"".concat(n.$style.name,"-variables")},o)),null===(p=n.$style)||void 0===p||p.loadTheme(hv({name:"".concat(n.$style.name,"-style")},o)),og.setLoadedStyleName(n.$style.name)}if(!og.isStyleNameLoaded("layer-order")){var h,m,g=null===(h=n.$style)||void 0===h||null===(m=h.getLayerOrderThemeCSS)||void 0===m?void 0:m.call(h);Pg.load(g,hv({name:"layer-order",first:!0},o)),og.setLoadedStyleName("layer-order")}}},_loadScopedThemeStyles:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e.preset();if(n&&e.$attrSelector){var o,i,r,s=((null===(o=e.$style)||void 0===o||null===(i=o.getPresetTheme)||void 0===i?void 0:i.call(o,n,"[".concat(e.$attrSelector,"]")))||{}).css,a=null===(r=e.$style)||void 0===r?void 0:r.load(s,hv({name:"".concat(e.$attrSelector,"-").concat(e.$style.name)},t));e.scopedStyleEl=a.el}},_themeChangeListener:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};_g.clearLoadedStyleNames(),Wm.on("theme:change",e)},_hook:function(e,t,n,o,i,r){var s,a,l,c="on".concat(Cm(l=t,!1)?l[0].toUpperCase()+l.slice(1):l),u=gv._getConfig(o,i),d=null==n?void 0:n.$instance,p=gv._usePT(d,gv._getPT(null==o||null===(s=o.value)||void 0===s?void 0:s.pt,e),gv._getOptionValue,"hooks.".concat(c)),f=gv._useDefaultPT(d,null==u||null===(a=u.pt)||void 0===a||null===(a=a.directives)||void 0===a?void 0:a[e],gv._getOptionValue,"hooks.".concat(c)),h={el:n,binding:o,vnode:i,prevVnode:r};null==p||p(d,h),null==f||f(d,h)},_mergeProps:function(){for(var e=arguments.length>1?arguments[1]:void 0,t=arguments.length,n=new Array(t>2?t-2:0),o=2;o1&&void 0!==arguments[1]?arguments[1]:{},n=function(n,o,i,r,s){var a,l,c;o._$instances=o._$instances||{};var u=gv._getConfig(i,r),d=o._$instances[e]||{},p=_m(d)?hv(hv({},t),null==t?void 0:t.methods):{};o._$instances[e]=hv(hv({},d),{},{$name:e,$host:o,$binding:i,$modifiers:null==i?void 0:i.modifiers,$value:null==i?void 0:i.value,$el:d.$el||o||void 0,$style:hv({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},null==t?void 0:t.style),$primevueConfig:u,$attrSelector:o.$attrSelector,defaultPT:function(){return gv._getPT(null==u?void 0:u.pt,void 0,(function(t){var n;return null==t||null===(n=t.directives)||void 0===n?void 0:n[e]}))},isUnstyled:function(){var e,t;return void 0!==(null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.unstyled)?null===(t=o.$instance)||void 0===t||null===(t=t.$binding)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.unstyled:null==u?void 0:u.unstyled},theme:function(){var e;return null===(e=o.$instance)||void 0===e||null===(e=e.$primevueConfig)||void 0===e?void 0:e.theme},preset:function(){var e;return null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.dt},ptm:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gv._getPTValue(o.$instance,null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.pt,t,hv({},n))},ptmo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return gv._getPTValue(o.$instance,e,t,n,!1)},cx:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null!==(e=o.$instance)&&void 0!==e&&e.isUnstyled()?void 0:gv._getOptionValue(null===(t=o.$instance)||void 0===t||null===(t=t.$style)||void 0===t?void 0:t.classes,n,hv({},i))},sx:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?gv._getOptionValue(null===(e=o.$instance)||void 0===e||null===(e=e.$style)||void 0===e?void 0:e.inlineStyles,t,hv({},n)):void 0}},p),o.$instance=o._$instances[e],null===(a=(l=o.$instance)[n])||void 0===a||a.call(l,o,i,r,s),o["$".concat(e)]=o.$instance,gv._hook(e,n,o,i,r,s),o.$pd||(o.$pd={}),o.$pd[e]=hv(hv({},null===(c=o.$pd)||void 0===c?void 0:c[e]),{},{name:e,instance:o.$instance})};return{created:function(e,t,o,i){n("created",e,t,o,i)},beforeMount:function(e,t,o,i){e.$attrSelector=Bg("pd"),gv._loadStyles(e,t,o),n("beforeMount",e,t,o,i),function(e){var t,n,o,i,r,s=null===(t=e.$instance)||void 0===t?void 0:t.watch;null==s||null===(n=s.config)||void 0===n||n.call(e.$instance,null===(o=e.$instance)||void 0===o?void 0:o.$primevueConfig),cv.on("config:change",(function(t){var n,o=t.newValue,i=t.oldValue;return null==s||null===(n=s.config)||void 0===n?void 0:n.call(e.$instance,o,i)})),null==s||null===(i=s["config.ripple"])||void 0===i||i.call(e.$instance,null===(r=e.$instance)||void 0===r||null===(r=r.$primevueConfig)||void 0===r?void 0:r.ripple),cv.on("config:ripple:change",(function(t){var n,o=t.newValue,i=t.oldValue;return null==s||null===(n=s["config.ripple"])||void 0===n?void 0:n.call(e.$instance,o,i)}))}(e)},mounted:function(e,t,o,i){gv._loadStyles(e,t,o),n("mounted",e,t,o,i)},beforeUpdate:function(e,t,o,i){n("beforeUpdate",e,t,o,i)},updated:function(e,t,o,i){gv._loadStyles(e,t,o),n("updated",e,t,o,i)},beforeUnmount:function(e,t,o,i){n("beforeUnmount",e,t,o,i)},unmounted:function(e,t,o,i){var r;null===(r=e.$instance)||void 0===r||null===(r=r.scopedStyleEl)||void 0===r||null===(r=r.value)||void 0===r||r.remove(),n("unmounted",e,t,o,i)}}},extend:function(){var e=dv(gv._getMeta.apply(gv,arguments),2),t=e[0],n=e[1];return hv({extend:function(){var e=dv(gv._getMeta.apply(gv,arguments),2),t=e[0],o=e[1];return gv.extend(t,hv(hv(hv({},n),null==n?void 0:n.methods),o))}},gv._extend(t,n))}},vv=Pg.extend({name:"ripple-directive",theme:function(e){var t=e.dt;return"\n.p-ink {\n display: block;\n position: absolute;\n background: ".concat(t("ripple.background"),";\n border-radius: 100%;\n transform: scale(0);\n pointer-events: none;\n}\n\n.p-ink-active {\n animation: ripple 0.4s linear;\n}\n\n@keyframes ripple {\n 100% {\n opacity: 0;\n transform: scale(2.5);\n }\n}\n")},classes:{root:"p-ink"}});function yv(e){return(yv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bv(e){return function(e){if(Array.isArray(e))return _v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return _v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_v(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);ne.length)&&(t=e.length);for(var n=0,o=Array(t);n0||navigator.msMaxTouchPoints>0||o.hide(e),window.removeEventListener("resize",t)})),n.addEventListener("mouseleave",(function t(){o.hide(e),n.removeEventListener("mouseleave",t)})),this.bindScrollListener(e),jg.set("tooltip",n,e.$_ptooltipZIndex)}},show:function(e,t,n){var o=this;void 0!==n?this.timer=setTimeout((function(){return o.tooltipActions(e,t)}),n):this.tooltipActions(e,t)},tooltipRemoval:function(e){this.remove(e),this.unbindScrollListener(e)},hide:function(e,t){var n=this;clearTimeout(this.timer),void 0!==t?setTimeout((function(){return n.tooltipRemoval(e)}),t):this.tooltipRemoval(e)},getTooltipElement:function(e){return document.getElementById(e.$_ptooltipId)},create:function(e){var t=e.$_ptooltipModifiers,n=ug("div",{class:!this.isUnstyled()&&this.cx("arrow"),"p-bind":this.ptm("arrow",{context:t})}),o=ug("div",{class:!this.isUnstyled()&&this.cx("text"),"p-bind":this.ptm("text",{context:t})});e.$_ptooltipEscape?(o.innerHTML="",o.appendChild(document.createTextNode(e.$_ptooltipValue))):o.innerHTML=e.$_ptooltipValue;var i=ug("div",Iv(Iv({id:e.$_ptooltipIdAttr,role:"tooltip",style:{display:"inline-block",width:e.$_ptooltipFitContent?"fit-content":void 0,pointerEvents:!this.isUnstyled()&&e.$_ptooltipAutoHide&&"none"},class:[!this.isUnstyled()&&this.cx("root"),e.$_ptooltipClass]},this.$attrSelector,""),"p-bind",this.ptm("root",{context:t})),n,o);return document.body.appendChild(i),e.$_ptooltipId=i.id,this.$el=i,i},remove:function(e){if(e){var t=this.getTooltipElement(e);t&&t.parentElement&&(jg.clear(t),document.body.removeChild(t)),e.$_ptooltipId=null}},align:function(e){var t=e.$_ptooltipModifiers;t.top?(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignTop(e))):t.left?(this.alignLeft(e),this.isOutOfBounds(e)&&(this.alignRight(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignLeft(e))))):t.bottom?(this.alignBottom(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&this.alignBottom(e))):(this.alignRight(e),this.isOutOfBounds(e)&&(this.alignLeft(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignRight(e)))))},getHostOffset:function(e){var t=e.getBoundingClientRect();return{left:t.left+function(){let e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}(),top:t.top+function(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}()}},alignRight:function(e){this.preAlign(e,"right");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+ag(e),i=n.top+(mg(e)-mg(t))/2;t.style.left=o+"px",t.style.top=i+"px"},alignLeft:function(e){this.preAlign(e,"left");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left-ag(t),i=n.top+(mg(e)-mg(t))/2;t.style.left=o+"px",t.style.top=i+"px"},alignTop:function(e){this.preAlign(e,"top");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+(ag(e)-ag(t))/2,i=n.top-mg(t);t.style.left=o+"px",t.style.top=i+"px"},alignBottom:function(e){this.preAlign(e,"bottom");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+(ag(e)-ag(t))/2,i=n.top+mg(e);t.style.left=o+"px",t.style.top=i+"px"},preAlign:function(e,t){var n=this.getTooltipElement(e);n.style.left="-999px",n.style.top="-999px",sg(n,"p-tooltip-".concat(n.$_ptooltipPosition)),!this.isUnstyled()&&rg(n,"p-tooltip-".concat(t)),n.$_ptooltipPosition=t,n.setAttribute("data-p-position",t);var o=dg(n,'[data-pc-section="arrow"]');o.style.top="bottom"===t?"0":"right"===t||"left"===t||"right"!==t&&"left"!==t&&"top"!==t&&"bottom"!==t?"50%":null,o.style.bottom="top"===t?"0":null,o.style.left="right"===t||"right"!==t&&"left"!==t&&"top"!==t&&"bottom"!==t?"0":"top"===t||"bottom"===t?"50%":null,o.style.right="left"===t?"0":null},isOutOfBounds:function(e){var t=this.getTooltipElement(e),n=t.getBoundingClientRect(),o=n.top,i=n.left,r=ag(t),s=mg(t),a=function(){let e=window,t=document,n=t.documentElement,o=t.getElementsByTagName("body")[0];return{width:e.innerWidth||n.clientWidth||o.clientWidth,height:e.innerHeight||n.clientHeight||o.clientHeight}}();return i+r>a.width||i<0||o<0||o+s>a.height},getTarget:function(e){return ig(e,"p-inputwrapper")?dg(e,"input"):e},getModifiers:function(e){return e.modifiers&&Object.keys(e.modifiers).length?e.modifiers:e.arg&&"object"===Nv(e.arg)?Object.entries(e.arg).reduce((function(e,t){var n=Lv(t,2),o=n[0],i=n[1];return"event"!==o&&"position"!==o||(e[i]=!0),e}),{}):{}}}}),Dv={name:"Card",extends:{name:"BaseCard",extends:Jg,style:Pg.extend({name:"card",theme:function(e){var t=e.dt;return"\n.p-card {\n background: ".concat(t("card.background"),";\n color: ").concat(t("card.color"),";\n box-shadow: ").concat(t("card.shadow"),";\n border-radius: ").concat(t("card.border.radius"),";\n display: flex;\n flex-direction: column;\n}\n\n.p-card-caption {\n display: flex;\n flex-direction: column;\n gap: ").concat(t("card.caption.gap"),";\n}\n\n.p-card-body {\n padding: ").concat(t("card.body.padding"),";\n display: flex;\n flex-direction: column;\n gap: ").concat(t("card.body.gap"),";\n}\n\n.p-card-title {\n font-size: ").concat(t("card.title.font.size"),";\n font-weight: ").concat(t("card.title.font.weight"),";\n}\n\n.p-card-subtitle {\n color: ").concat(t("card.subtitle.color"),";\n}\n")},classes:{root:"p-card p-component",header:"p-card-header",body:"p-card-body",caption:"p-card-caption",title:"p-card-title",subtitle:"p-card-subtitle",content:"p-card-content",footer:"p-card-footer"}}),provide:function(){return{$pcCard:this,$parentInstance:this}}},inheritAttrs:!1};Dv.render=function(e,t,n,o,i,r){return $i(),Ui("div",nr({class:e.cx("root")},e.ptmi("root")),[e.$slots.header?($i(),Ui("div",nr({key:0,class:e.cx("header")},e.ptm("header")),[_o(e.$slots,"header")],16)):Ji("",!0),Zi("div",nr({class:e.cx("body")},e.ptm("body")),[e.$slots.title||e.$slots.subtitle?($i(),Ui("div",nr({key:0,class:e.cx("caption")},e.ptm("caption")),[e.$slots.title?($i(),Ui("div",nr({key:0,class:e.cx("title")},e.ptm("title")),[_o(e.$slots,"title")],16)):Ji("",!0),e.$slots.subtitle?($i(),Ui("div",nr({key:1,class:e.cx("subtitle")},e.ptm("subtitle")),[_o(e.$slots,"subtitle")],16)):Ji("",!0)],16)):Ji("",!0),Zi("div",nr({class:e.cx("content")},e.ptm("content")),[_o(e.$slots,"content")],16),e.$slots.footer?($i(),Ui("div",nr({key:1,class:e.cx("footer")},e.ptm("footer")),[_o(e.$slots,"footer")],16)):Ji("",!0)],16)],16)};const jv={class:"no-result-placeholder"},Mv={class:"no-result-placeholder-content"},Rv={key:0},$v={__name:"noResultsPlaceholder",props:{icon:{type:String,default:"",required:!1},iconSize:{type:String,default:"3rem",required:!1},title:{type:String,required:!0},message:{type:String,required:!1},buttonLabel:{type:String,default:"",required:!1}},emits:["action"],setup:e=>(t,n)=>($i(),Ui("div",jv,[Ki(hn(Dv),null,{content:Vn((()=>[Zi("div",Mv,[Zi("i",{class:Me(e.icon),style:Ie({"font-size":e.iconSize,"margin-bottom":".5rem"})},null,6),Zi("h3",null,Be(e.title),1),e.message?($i(),Ui("p",Rv,Be(e.message),1)):Ji("",!0),e.buttonLabel?($i(),zi(hn(Ev),{key:1,label:e.buttonLabel,onClick:n[0]||(n[0]=e=>t.$emit("action")),class:"p-button-text"},null,8,["label"])):Ji("",!0)])])),_:1})]))};var Gv=Pg.extend({name:"inputtext",theme:function(e){var t=e.dt;return"\n.p-inputtext {\n font-family: inherit;\n font-feature-settings: inherit;\n font-size: 1rem;\n color: ".concat(t("inputtext.color"),";\n background: ").concat(t("inputtext.background"),";\n padding: ").concat(t("inputtext.padding.y")," ").concat(t("inputtext.padding.x"),";\n border: 1px solid ").concat(t("inputtext.border.color"),";\n transition: background ").concat(t("inputtext.transition.duration"),", color ").concat(t("inputtext.transition.duration"),", border-color ").concat(t("inputtext.transition.duration"),", outline-color ").concat(t("inputtext.transition.duration"),", box-shadow ").concat(t("inputtext.transition.duration"),";\n appearance: none;\n border-radius: ").concat(t("inputtext.border.radius"),";\n outline-color: transparent;\n box-shadow: ").concat(t("inputtext.shadow"),";\n}\n\n.p-inputtext:enabled:hover {\n border-color: ").concat(t("inputtext.hover.border.color"),";\n}\n\n.p-inputtext:enabled:focus {\n border-color: ").concat(t("inputtext.focus.border.color"),";\n box-shadow: ").concat(t("inputtext.focus.ring.shadow"),";\n outline: ").concat(t("inputtext.focus.ring.width")," ").concat(t("inputtext.focus.ring.style")," ").concat(t("inputtext.focus.ring.color"),";\n outline-offset: ").concat(t("inputtext.focus.ring.offset"),";\n}\n\n.p-inputtext.p-invalid {\n border-color: ").concat(t("inputtext.invalid.border.color"),";\n}\n\n.p-inputtext.p-variant-filled {\n background: ").concat(t("inputtext.filled.background"),";\n}\n\n.p-inputtext.p-variant-filled:enabled:focus {\n background: ").concat(t("inputtext.filled.focus.background"),";\n}\n\n.p-inputtext:disabled {\n opacity: 1;\n background: ").concat(t("inputtext.disabled.background"),";\n color: ").concat(t("inputtext.disabled.color"),";\n}\n\n.p-inputtext::placeholder {\n color: ").concat(t("inputtext.placeholder.color"),";\n}\n\n.p-inputtext-sm {\n font-size: ").concat(t("inputtext.sm.font.size"),";\n padding: ").concat(t("inputtext.sm.padding.y")," ").concat(t("inputtext.sm.padding.x"),";\n}\n\n.p-inputtext-lg {\n font-size: ").concat(t("inputtext.lg.font.size"),";\n padding: ").concat(t("inputtext.lg.padding.y")," ").concat(t("inputtext.lg.padding.x"),";\n}\n\n.p-inputtext-fluid {\n width: 100%;\n}\n")},classes:{root:function(e){var t=e.instance,n=e.props;return["p-inputtext p-component",{"p-filled":t.filled,"p-inputtext-sm":"small"===n.size,"p-inputtext-lg":"large"===n.size,"p-invalid":n.invalid,"p-variant-filled":n.variant?"filled"===n.variant:"filled"===t.$primevue.config.inputStyle||"filled"===t.$primevue.config.inputVariant,"p-inputtext-fluid":t.hasFluid}]}}}),Bv={name:"InputText",extends:{name:"BaseInputText",extends:Jg,props:{modelValue:null,size:{type:String,default:null},invalid:{type:Boolean,default:!1},variant:{type:String,default:null},fluid:{type:Boolean,default:null}},style:Gv,provide:function(){return{$pcInputText:this,$parentInstance:this}}},inheritAttrs:!1,emits:["update:modelValue"],inject:{$pcFluid:{default:null}},methods:{getPTOptions:function(e){return("root"===e?this.ptmi:this.ptm)(e,{context:{filled:this.filled,disabled:this.$attrs.disabled||""===this.$attrs.disabled}})},onInput:function(e){this.$emit("update:modelValue",e.target.value)}},computed:{filled:function(){return null!=this.modelValue&&this.modelValue.toString().length>0},hasFluid:function(){return _m(this.fluid)?!!this.$pcFluid:this.fluid}}},Fv=["value","aria-invalid"];Bv.render=function(e,t,n,o,i,r){return $i(),Ui("input",nr({type:"text",class:e.cx("root"),value:e.modelValue,"aria-invalid":e.invalid||void 0,onInput:t[0]||(t[0]=function(){return r.onInput&&r.onInput.apply(r,arguments)})},r.getPTOptions("root")),null,16,Fv)};const Uv={class:"left flex-1"},zv={key:1,class:"edit"},Vv={key:2,class:"label"},Hv={class:"right toolbar"},Wv={key:0,class:"nodes"},Yv={__name:"group",props:{item:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup(e){const t=e,n=np(),o=pn(!1),i=pn(null),r=pn(""),s=e=>{var o,i;let r=t.item;if(!(null==(o=r.info)?void 0:o.is_edit)&&(null==(i=r.children)?void 0:i.length)>0){let e=y.canvas.graph._groups.find((e=>e.pos[0]==r.info.pos[0]&&e.pos[1]==r.info.pos[1]));e&&(e.show_nodes=!e.show_nodes,n.setGroups(y.canvas.graph._groups))}},a=async()=>{let e=t.item,i=y.canvas.graph._groups.find((t=>t.pos[0]==e.info.pos[0]&&t.pos[1]==e.info.pos[1]));i?(i.is_edit=!1,i.title=r.value,await n.setGroups(y.canvas.graph._groups),o.value=!1):o.value=!1};return(l,c)=>{var u,d,p;return $i(),Ui(Ni,null,[Zi("div",{class:Me("comfyui-easyuse-map-nodes-group"),onClick:s},[Zi("div",Uv,[e.item.children?($i(),Ui("i",{key:0,class:Me(["icon",e.item.info.show_nodes?"pi pi-folder-open":"pi pi-folder"]),style:Ie({color:e.item.info.color})},null,6)):Ji("",!0),(null==(u=e.item.info)?void 0:u.is_edit)?($i(),Ui("div",zv,[Ki(hn(Bv),{ref_key:"modifyRef",ref:i,modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=e=>r.value=e),variant:"outline",size:"small",type:"text",onBlur:a,onKeydown:[qr(a,["enter"]),qr(a,["esc"])],style:{width:"100%"}},null,8,["modelValue"])])):($i(),Ui("div",Vv,[Zi("span",{onDblclick:c[1]||(c[1]=Qr((s=>(async()=>{var e,s;if(o.value)return;let a=t.item,l=y.canvas.graph._groups.find((e=>e.pos[0]==a.info.pos[0]&&e.pos[1]==a.info.pos[1]));l&&(l.is_edit=!l.is_edit,r.value=l.is_edit?a.info.title:"",await n.setGroups(y.canvas.graph._groups),o.value=!0,null==(s=null==(e=i.value)?void 0:e[0])||s.$el.focus())})(e.item)),["stop"]))},Be(e.item.info.title),33)]))]),Zi("div",Hv,[(null==(d=e.item.children)?void 0:d.length)>0?($i(),zi(hn(Ev),{key:0,size:"small",icon:e.item.children.find((e=>e.mode==hn(j).ALWAYS))?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:c[2]||(c[2]=Qr((e=>l.$emit("changeMode")),["stop"])),onMousedown:c[3]||(c[3]=Qr((e=>l.$emit("mousedown")),["stop"])),onMouseup:c[4]||(c[4]=Qr((e=>l.$emit("mouseup")),["stop"]))},null,8,["icon"])):Ji("",!0)])]),(null==(p=e.item.children)?void 0:p.length)>0&&e.item.info.show_nodes?($i(),Ui("div",Wv,[_o(l.$slots,"default")])):Ji("",!0)],64)}}},Zv={key:1,class:"label error"},Kv={class:"right toolbar"},Xv={__name:"node",props:{node:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup:e=>(t,n)=>($i(),Ui("div",{class:Me(["comfyui-easyuse-map-nodes-node",{never:void 0!==e.node.mode&&e.node.mode==hn(j).NEVER},{bypass:void 0!==e.node.mode&&e.node.mode==hn(j).BYPASS}])},[void 0!==e.node.title?($i(),Ui("span",{key:0,class:"label",onDblclick:n[0]||(n[0]=Qr((t=>hn(Lp)(e.node.id)),["stop"]))},Be(e.node.title),33)):($i(),Ui("span",Zv,Be(e.node.type),1)),Zi("div",Kv,[Ki(hn(Ev),{size:"small",icon:e.node.mode==hn(j).ALWAYS?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:n[1]||(n[1]=Qr((e=>t.$emit("changeMode")),["stop"])),onMousedown:n[2]||(n[2]=Qr((e=>t.$emit("mousedown")),["stop"])),onMouseup:n[3]||(n[3]=Qr((e=>t.$emit("mouseup")),["stop"]))},null,8,["icon"])])],2))},Qv={class:"title"},Jv={class:"toolbar"},qv={key:0},ey={key:1,class:"no_result",style:{height:"100%"}},ty="comfyui-easyuse-map-nodes",ny={__name:"nodesMap",setup(e){const t=np(),{groups_nodes:n,groups:o}=ws(t),i=pn(!1),r=e=>{i.value=!i.value,y.canvas.graph._groups.forEach((e=>{e.show_nodes=i.value})),t.setGroups(y.canvas.graph._groups)};let s,a=0,l=0,c=!1;const u=(e,n=!1)=>{if(c)return void(c=!1);const o=e.children.find((e=>e.mode==j.ALWAYS)),i=e.children.map((e=>e.id));y.canvas.graph._nodes.forEach((e=>{i.includes(e.id)&&(e.mode=o?n?j.NEVER:j.BYPASS:j.ALWAYS,e.graph.change())})),t.setNodes(y.canvas.graph._nodes)},d=(e,n=!1)=>{if(c)return void(c=!1);const o=e.mode==j.ALWAYS,i=y.canvas.graph._nodes.find((t=>t.id==e.id));i&&(i.mode=o?n?j.NEVER:j.BYPASS:j.ALWAYS,i.graph.change(),t.setNodes(y.canvas.graph._nodes))},p=(e,t="group")=>{a=(new Date).getTime(),clearTimeout(s),s=setTimeout((n=>{"group"==t?u(e,!0):d(e,!0)}),500)},f=e=>{l=(new Date).getTime(),l-a>500&&(c=!0),clearTimeout(s)};return(e,t)=>{var s,a;return $i(),Ui("div",{class:Me(ty)},[Zi("div",{class:Me(ty+"__header")},[Zi("div",Qv,Be(hn(V)("Nodes Map",!0)),1),Zi("div",Jv,[(null==(s=hn(o))?void 0:s.length)>0?Hn(($i(),zi(hn(Ev),{key:0,icon:i.value?"pi pi-angle-double-down":"pi pi-angle-double-up",text:"",rounded:"",severity:"secondary",onClick:r,size:"small"},null,8,["icon"])),[[hn(Pv),i.value?hn(V)("Collapse All"):hn(V)("Expand All"),void 0,{right:!0}]]):Ji("",!0)])],2),Zi("div",{class:Me(ty+"__content")},[(null==(a=hn(n))?void 0:a.length)>0?($i(),Ui("ol",qv,[($i(!0),Ui(Ni,null,bo(hn(n),((e,t)=>($i(),Ui("li",{key:t},[void 0!==e.children?($i(),zi(Yv,{key:0,item:e,onChangeMode:t=>u(e),onMousedown:t=>p(e,"group"),onMouseup:f},{default:Vn((()=>[($i(!0),Ui(Ni,null,bo(e.children,((e,t)=>($i(),zi(Xv,{key:t,node:e,onChangeMode:t=>d(e),onMousedown:t=>p(e,"node"),onMouseup:f},null,8,["node","onChangeMode","onMousedown"])))),128))])),_:2},1032,["item","onChangeMode","onMousedown"])):($i(),zi(Xv,{key:1,node:e.info,onChangeMode:t=>d(e.info),onMousedown:t=>p(e.info,"node"),onMouseup:f},null,8,["node","onChangeMode","onMousedown"]))])))),128))])):($i(),Ui("div",ey,[Ki($v,{icon:"pi pi-sitemap",title:hn(V)("No Nodes",!0),message:hn(V)("No nodes found in the map",!0)},null,8,["title","message"])]))],2)])}}},oy={__name:"index",setup(e){const t=np();return oo((e=>{t.watchGraph()})),ao((e=>{})),(e,t)=>($i(),Ui("div",{class:Me("comfyui-easyuse-map")},[Ki(ny)]))}},iy={__name:"App",setup(e){const t=e=>{y.extensionManager.registerSidebarTab({id:M,icon:"pi pi-sitemap",title:V("Nodes Map",!0),tooltip:V("Nodes Map",!0),type:"custom",render:e=>{e.style.height="100%",((...e)=>{ns().render(...e)})(function(e,t,n){const o=arguments.length;return 2===o?ue(t)&&!ie(t)?Vi(t)?Ki(e,null,[t]):Ki(e,t):Ki(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):3===o&&Vi(n)&&(n=[n]),Ki(e,t,n))}(oy,{}),e)}})};return oo((e=>{try{t()}catch(n){}})),(e,t)=>($i(),zi(hm))}};var ry="equals",sy="notEquals";function ay(e){return(ay="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function cy(e){for(var t=1;t{const t=ns().createApp(...e),{mount:n}=t;return t.mount=e=>{const o=function(e){if(le(e)){return document.querySelector(e)}return e}(e);if(!o)return;const i=t._component;ae(i)||i.render||i.template||(i.template=o.innerHTML),o.innerHTML="";const r=n(o,!1,function(e){if(e instanceof SVGElement)return"svg";if("function"==typeof MathMLElement&&e instanceof MathMLElement)return"mathml"}(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t})(iy);yy.use(my),yy.use(function(){const e=We(!0),t=e.run((()=>pn({})));let n=[],o=[];const i=rn({install(e){is(i),i._a=e,e.provide(rs,i),e.config.globalProperties.$pinia=i,o.forEach((e=>n.push(e))),o=[]},use(e){return this._a?n.push(e):o.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}()),yy.mount("#"+vy.id); +let os;const is=e=>os=e,rs=Symbol();function ss(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var as,ls;(ls=as||(as={})).direct="direct",ls.patchObject="patch object",ls.patchFunction="patch function";const cs=()=>{};function us(e,t,n,o=cs){e.push(t);const i=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),o())};var r;return!n&&Ye()&&(r=i,ze&&ze.cleanups.push(r)),i}function ds(e,...t){e.slice().forEach((e=>{e(...t)}))}const ps=e=>e(),fs=Symbol(),hs=Symbol();function ms(e,t){e instanceof Map&&t instanceof Map?t.forEach(((t,n)=>e.set(n,t))):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const o=t[n],i=e[n];ss(i)&&ss(o)&&e.hasOwnProperty(n)&&!dn(o)&&!qt(o)?e[n]=ms(i,o):e[n]=o}return e}const gs=Symbol();const{assign:vs}=Object;function ys(e,t,n,o){const{state:i,actions:r,getters:s}=t,a=n.state.value[e];let l;return l=bs(e,(function(){a||(n.state.value[e]=i?i():{});const t=function(e){const t=ie(e)?new Array(e.length):{};for(const n in e)t[n]=_n(e,n);return t}(n.state.value[e]);return vs(t,r,Object.keys(s||{}).reduce(((t,o)=>(t[o]=rn(_r((()=>{is(n);const t=n._s.get(e);return s[o].call(t,t)}))),t)),{}))}),t,n,o,!0),l}function bs(e,t,n={},o,i,r){let s;const a=vs({actions:{}},n),l={deep:!0};let c,u,d,p=[],f=[];const h=o.state.value[e];let m;function g(t){let n;c=u=!1,"function"==typeof t?(t(o.state.value[e]),n={type:as.patchFunction,storeId:e,events:d}):(ms(o.state.value[e],t),n={type:as.patchObject,payload:t,storeId:e,events:d});const i=m=Symbol();Pn().then((()=>{m===i&&(c=!0)})),u=!0,ds(p,n,o.state.value[e])}r||h||(o.state.value[e]={}),pn({});const v=r?function(){const{state:e}=n,t=e?e():{};this.$patch((e=>{vs(e,t)}))}:cs;const y=(t,n="")=>{if(fs in t)return t[hs]=n,t;const i=function(){is(o);const n=Array.from(arguments),r=[],s=[];let a;ds(f,{args:n,name:i[hs],store:b,after:function(e){r.push(e)},onError:function(e){s.push(e)}});try{a=t.apply(this&&this.$id===e?this:b,n)}catch(l){throw ds(s,l),l}return a instanceof Promise?a.then((e=>(ds(r,e),e))).catch((e=>(ds(s,e),Promise.reject(e)))):(ds(r,a),a)};return i[fs]=!0,i[hs]=n,i},b=Xt({_p:o,$id:e,$onAction:us.bind(null,f),$patch:g,$reset:v,$subscribe(t,n={}){const i=us(p,t,n.detached,(()=>r())),r=s.run((()=>bi((()=>o.state.value[e]),(o=>{("sync"===n.flush?u:c)&&t({storeId:e,type:as.direct,events:d},o)}),vs({},l,n))));return i},$dispose:function(){s.stop(),p=[],f=[],o._s.delete(e)}});o._s.set(e,b);const _=(o._a&&o._a.runWithContext||ps)((()=>o._e.run((()=>(s=We()).run((()=>t({action:y})))))));for(const x in _){const t=_[x];if(dn(t)&&(!dn(S=t)||!S.effect)||qt(t))r||(!h||ss(w=t)&&w.hasOwnProperty(gs)||(dn(t)?t.value=h[x]:ms(t,h[x])),o.state.value[e][x]=t);else if("function"==typeof t){const e=y(t,x);_[x]=e,a.actions[x]=t}}var w,S;return vs(b,_),vs(on(b),_),Object.defineProperty(b,"$state",{get:()=>o.state.value[e],set:e=>{g((t=>{vs(t,e)}))}}),o._p.forEach((e=>{vs(b,s.run((()=>e({store:b,app:o._a,pinia:o,options:a}))))})),h&&r&&n.hydrate&&n.hydrate(b.$state,h),c=!0,u=!0,b}function _s(e,t,n){let o,i;const r="function"==typeof t;function s(e,n){(e=e||(!!(sr||Fn||Uo)?zo(rs,null):null))&&is(e),(e=os)._s.has(o)||(r?bs(o,t,i,e):ys(o,i,e));return e._s.get(o)}return"string"==typeof e?(o=e,i=r?n:t):(i=e,o=e.id),s.$id=o,s}function ws(e){{e=on(e);const t={};for(const n in e){const o=e[n];(dn(o)||qt(o))&&(t[n]=bn(e,n))}return t}}var Ss="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ks=function(){this.__data__=[],this.size=0};var Cs=function(e,t){return e===t||e!=e&&t!=t},As=Cs;var Es=function(e,t){for(var n=e.length;n--;)if(As(e[n][0],t))return n;return-1},Os=Es,Ls=Array.prototype.splice;var Ts=Es;var Is=Es;var Ns=Es;var Ps=ks,Ds=function(e){var t=this.__data__,n=Os(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ls.call(t,n,1),--this.size,!0)},js=function(e){var t=this.__data__,n=Ts(t,e);return n<0?void 0:t[n][1]},Ms=function(e){return Is(this.__data__,e)>-1},Rs=function(e,t){var n=this.__data__,o=Ns(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this};function $s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},ec=sa,tc=ql,nc=Il,oc={};oc["[object Float32Array]"]=oc["[object Float64Array]"]=oc["[object Int8Array]"]=oc["[object Int16Array]"]=oc["[object Int32Array]"]=oc["[object Uint8Array]"]=oc["[object Uint8ClampedArray]"]=oc["[object Uint16Array]"]=oc["[object Uint32Array]"]=!0,oc["[object Arguments]"]=oc["[object Array]"]=oc["[object ArrayBuffer]"]=oc["[object Boolean]"]=oc["[object DataView]"]=oc["[object Date]"]=oc["[object Error]"]=oc["[object Function]"]=oc["[object Map]"]=oc["[object Number]"]=oc["[object Object]"]=oc["[object RegExp]"]=oc["[object Set]"]=oc["[object String]"]=oc["[object WeakMap]"]=!1;var ic=function(e){return nc(e)&&tc(e.length)&&!!oc[ec(e)]};var rc=function(e){return function(t){return e(t)}},sc={exports:{}};!function(e,t){var n=Hs,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,r=i&&i.exports===o&&n.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||r&&r.binding&&r.binding("util")}catch(t){}}();e.exports=s}(sc,sc.exports);var ac=sc.exports,lc=ic,cc=rc,uc=ac&&ac.isTypedArray,dc=uc?cc(uc):lc,pc=Tl,fc=Yl,hc=Zl,mc=Xl,gc=Jl,vc=dc,yc=Object.prototype.hasOwnProperty;var bc=function(e,t){var n=hc(e),o=!n&&fc(e),i=!n&&!o&&mc(e),r=!n&&!o&&!i&&vc(e),s=n||o||i||r,a=s?pc(e.length,String):[],l=a.length;for(var c in e)!t&&!yc.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||gc(c,l))||a.push(c);return a},_c=Object.prototype;var wc=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_c)};var Sc=function(e,t){return function(n){return e(t(n))}},xc=Sc(Object.keys,Object),kc=wc,Cc=xc,Ac=Object.prototype.hasOwnProperty;var Ec=da,Oc=ql;var Lc=function(e){return null!=e&&Oc(e.length)&&!Ec(e)},Tc=bc,Ic=function(e){if(!kc(e))return Cc(e);var t=[];for(var n in Object(e))Ac.call(e,n)&&"constructor"!=n&&t.push(n);return t},Nc=Lc;var Pc=function(e){return Nc(e)?Tc(e):Ic(e)},Dc=Ll,jc=Pc;var Mc=function(e,t){return e&&Dc(t,jc(t),e)};var Rc=aa,$c=wc,Gc=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Bc=Object.prototype.hasOwnProperty;var Fc=bc,Uc=function(e){if(!Rc(e))return Gc(e);var t=$c(e),n=[];for(var o in e)("constructor"!=o||!t&&Bc.call(e,o))&&n.push(o);return n},zc=Lc;var Vc=function(e){return zc(e)?Fc(e,!0):Uc(e)},Hc=Ll,Wc=Vc;var Yc=function(e,t){return e&&Hc(t,Wc(t),e)},Zc={exports:{}};!function(e,t){var n=Zs,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,r=i&&i.exports===o?n.Buffer:void 0,s=r?r.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,o=s?s(n):new e.constructor(n);return e.copy(o),o}}(Zc,Zc.exports);var Kc=Zc.exports;var Xc=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n({groups:[],nodes:[]}),getters:{groups_nodes(){var e;let t=[],n=[];if((null==(e=this.nodes)?void 0:e.length)>0){this.nodes.map((e=>{let o=e.pos,i=!1;for(let n=0;nr.pos[0]&&o[0]r.pos[1]&&o[1]e.pos[0]-t.pos[0])).sort(((e,t)=>e.pos[1]-t.pos[1])))},setNodes(e){this.nodes=tp(e)},update(){y.extensionManager.activeSidebarTab===M&&setTimeout((e=>{this.setGroups(y.canvas.graph._groups),this.setNodes(y.canvas.graph._nodes)}),1)},watchGraph(){let e=this;this.update();const t=y.graph.onNodeAdded;y.graph.onNodeAdded=function(n){e.update();const o=n.onRemoved;return n.onRemoved=function(){return e.update(),null==o?void 0:o.apply(this,arguments)},null==t?void 0:t.apply(this,arguments)},y.canvas.onNodeMoved=function(t){e.update()};const n=LGraphCanvas.onNodeAlign;LGraphCanvas.onNodeAlign=function(t){return e.update(),null==n?void 0:n.apply(this,arguments)};const o=LGraphCanvas.onGroupAdd;LGraphCanvas.onGroupAdd=function(){return e.update(),null==o?void 0:o.apply(this,arguments)};const i=LGraphCanvas.onGroupAlign;LGraphCanvas.onGroupAlign=function(t){return e.update(),null==i?void 0:i.apply(this,arguments)};const r=LGraphCanvas.onMenuNodeRemove;LGraphCanvas.onMenuNodeRemove=function(t){return e.update(),null==r?void 0:r.apply(this,arguments)}}}});let op=null;const ip=["custom_obsidian","custom_obsidian_dark","custom_milk_white"],rp={"easy positive":"green","easy negative":"red","easy promptList":"cyan","easy promptLine":"cyan","easy promptConcat":"cyan","easy promptReplace":"cyan","easy textSwitch":"pale_blue"};let sp=LGraphCanvas.node_colors,ap=null,lp=null,cp=null,up=null;for(let by in H)dp=H[by],y.ui.settings.addSetting(dp);var dp;function pp(e,t=!1){let n="after",o="before";t&&([o,n]=[n,o]),e.label=(e.label??e.name).replace(o,n),e.name=e.label}function fp(e,t,n,o,i,r,s){t.strokeStyle=o,t.fillStyle=i;let a=LiteGraph.NODE_TITLE_HEIGHT,l=this.ds.scale<.5,c=e._shape||e.constructor.shape||LiteGraph.ROUND_SHAPE,u=e.constructor.title_mode,d=!0;u==LiteGraph.TRANSPARENT_TITLE||u==LiteGraph.NO_TITLE?d=!1:u==LiteGraph.AUTOHIDE_TITLE&&mouse_over&&(d=!0);let p=new Float32Array(4);p=[0,d?-a:0,n[0]+1,d?n[1]+a:n[1]];let f=t.globalAlpha;if(t.lineWidth=1,t.beginPath(),c==LiteGraph.BOX_SHAPE||l?t.fillRect(p[0],p[1],p[2],p[3]):c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CARD_SHAPE?t.roundRect(p[0],p[1],p[2],p[3],c==LiteGraph.CARD_SHAPE?[this.round_radius,this.round_radius,0,0]:[this.round_radius]):c==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*n[0],.5*n[1],.5*n[0],0,2*Math.PI),t.strokeStyle=LiteGraph.WIDGET_OUTLINE_COLOR,t.stroke(),t.strokeStyle=o,t.fill(),!e.flags.collapsed&&d&&(t.shadowColor="transparent",t.fillStyle="rgba(0,0,0,0.2)",t.fillRect(0,-1,p[2],2)),t.shadowColor="transparent",e.onDrawBackground&&e.onDrawBackground(t,this,this.canvas,this.graph_mouse),d||u==LiteGraph.TRANSPARENT_TITLE){const i="dark"==function(e){let t=e.replace("#","");return n=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16),.299*n+.587*o+.114*i>127.5?"light":"dark";var n,o,i}((null==e?void 0:e.color)||"#ffffff");if(e.onDrawTitleBar)e.onDrawTitleBar(t,a,n,this.ds.scale,o);else if(u!=LiteGraph.TRANSPARENT_TITLE&&(e.constructor.title_color||this.render_title_colored)){let i=e.constructor.title_color||o;if(e.flags.collapsed&&(t.shadowColor=LiteGraph.DEFAULT_SHADOW_COLOR),this.use_gradients){let e=LGraphCanvas.gradients[i];e||(e=LGraphCanvas.gradients[i]=t.createLinearGradient(0,0,400,0),e.addColorStop(0,i),e.addColorStop(1,"#000")),t.fillStyle=e}else t.fillStyle=i;t.beginPath(),c==LiteGraph.BOX_SHAPE||l?t.rect(0,-a,n[0]+1,a):c!=LiteGraph.ROUND_SHAPE&&c!=LiteGraph.CARD_SHAPE||t.roundRect(0,-a,n[0]+1,a,e.flags.collapsed?[this.round_radius]:[this.round_radius,this.round_radius,0,0]),t.fill(),t.shadowColor="transparent"}let s=!1;LiteGraph.node_box_coloured_by_mode&&LiteGraph.NODE_MODES_COLORS[e.mode]&&(s=LiteGraph.NODE_MODES_COLORS[e.mode]),LiteGraph.node_box_coloured_when_on&&(s=e.action_triggered?"#FFF":e.execute_triggered?"#AAA":s);let d=10;if(e.onDrawTitleBox)e.onDrawTitleBox(t,a,n,this.ds.scale);else if(c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CIRCLE_SHAPE||c==LiteGraph.CARD_SHAPE){const n=i?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR,o=i?"#eeeeee":e.boxcolor||s||LiteGraph.NODE_DEFAULT_BOXCOLOR;t.fillStyle=r?n:o,t.beginPath(),t.fillRect(10,0-1.05*d-1,1.1*d,.125*d),t.fillRect(10,0-1.45*d-1,1.1*d,.125*d),t.fillRect(10,0-1.85*d-1,1.1*d,.125*d)}else t.fillStyle=e.boxcolor||s||LiteGraph.NODE_DEFAULT_BOXCOLOR,t.fillRect(.5*(a-d),-.5*(a+d),d,d);if(t.globalAlpha=f,e.onDrawTitleText&&e.onDrawTitleText(t,a,n,this.ds.scale,this.title_text_font,r),!l){t.font=this.title_text_font;let n=String(e.getTitle());n&&(t.fillStyle=r?i?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR:i?"#ffffff":e.constructor.title_text_color||this.node_title_color,e.flags.collapsed?(t.textAlign="left",t.measureText(n),t.fillText(n.substr(0,20),a,LiteGraph.NODE_TITLE_TEXT_Y-a),t.textAlign="left"):(t.textAlign="left",t.fillText(n,a,LiteGraph.NODE_TITLE_TEXT_Y-a)))}if(!e.flags.collapsed&&e.subgraph&&!e.skip_subgraph_button){let n=LiteGraph.NODE_TITLE_HEIGHT,o=e.size[0]-n,i=LiteGraph.isInsideRectangle(this.graph_mouse[0]-e.pos[0],this.graph_mouse[1]-e.pos[1],o+2,2-n,n-4,n-4);t.fillStyle=i?"#888":"#555",c==LiteGraph.BOX_SHAPE||l?t.fillRect(o+2,2-n,n-4,n-4):(t.beginPath(),t.roundRect(o+2,2-n,n-4,n-4,[4]),t.fill()),t.fillStyle="#333",t.beginPath(),t.moveTo(o+.2*n,.6*-n),t.lineTo(o+.8*n,.6*-n),t.lineTo(o+.5*n,.3*-n),t.fill()}e.onDrawTitle&&e.onDrawTitle(t)}if(r){e.onBounding&&e.onBounding(p),u==LiteGraph.TRANSPARENT_TITLE&&(p[1]-=a,p[3]+=a),t.lineWidth=2,t.globalAlpha=.8,t.beginPath();let i=0,r=0,s=1;c==LiteGraph.BOX_SHAPE?t.rect(i+p[0],i+p[1],r+p[2],r+p[3]):c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CARD_SHAPE&&e.flags.collapsed?t.roundRect(i+p[0],i+p[1],r+p[2],r+p[3],[this.round_radius*s]):c==LiteGraph.CARD_SHAPE?t.roundRect(i+p[0],i+p[1],r+p[2],r+p[3],[this.round_radius*s,s,this.round_radius*s,s]):c==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*n[0],.5*n[1],.5*n[0]+6,0,2*Math.PI),t.strokeStyle=LiteGraph.NODE_BOX_OUTLINE_COLOR,t.stroke(),t.strokeStyle=o,t.globalAlpha=1}e.execute_triggered>0&&e.execute_triggered--,e.action_triggered>0&&e.action_triggered--}function hp(e,t,n,o){if(!e.widgets||!e.widgets.length)return 0;let i=e.size[0],r=e.widgets;t+=2;let s=LiteGraph.NODE_WIDGET_HEIGHT,a=this.ds.scale>.5;n.save(),n.globalAlpha=this.editor_alpha;let l=LiteGraph.WIDGET_OUTLINE_COLOR,c=LiteGraph.WIDGET_BGCOLOR,u=LiteGraph.WIDGET_TEXT_COLOR,d=LiteGraph.WIDGET_SECONDARY_TEXT_COLOR,p=12;for(let f=0;f1&&(i=1),n.fillStyle=h.options.hasOwnProperty("slider_color")?h.options.slider_color:o==h?l:I,n.beginPath(),n.roundRect(p,m,i*(g-24),s,[.25*s]),n.fill(),h.marker){let e=(h.marker-h.options.min)/t;e<0&&(e=0),e>1&&(e=1),n.fillStyle=h.options.hasOwnProperty("marker_color")?h.options.marker_color:"#AA9",n.roundRect(p+e*(g-24),m,2,s,[.25*s])}if(a){n.textAlign="center",n.fillStyle=u;let e=(h.label||h.name)+": "+Number(h.value).toFixed(null!=h.options.precision?h.options.precision:3).toString();n.fillText(e,.5*g,m+.7*s)}break;case"number":case"combo":if(n.textAlign="left",n.strokeStyle=l,n.fillStyle=c,n.beginPath(),a?n.roundRect(p,m,g-24,s,[.25*s]):n.rect(p,m,g-24,s),n.fill(),a){h.disabled||n.stroke(),n.fillStyle=u,h.disabled||(n.beginPath(),n.moveTo(24,m+6.5),n.lineTo(18,m+.5*s),n.lineTo(24,m+s-6.5),n.fill(),n.beginPath(),n.moveTo(g-p-12,m+6.5),n.lineTo(g-p-6,m+.5*s),n.lineTo(g-p-12,m+s-6.5),n.fill()),n.fillStyle=d,n.font="10px Inter",n.fillText(h.label||h.name,29,m+.7*s),n.fillStyle=u,n.textAlign="right";let e=6;if("number"==h.type)n.font="10px Inter",n.fillText(Number(h.value).toFixed(void 0!==h.options.precision?h.options.precision:3),g-24-e,m+.7*s);else{let t=h.value;if(h.options.values){let e=h.options.values;e.constructor===Function&&(e=e()),e&&e.constructor!==Array&&(t=e[h.value])}n.fillText(t,g-24-e,m+.7*s)}}break;case"string":case"text":if(n.textAlign="left",n.strokeStyle=l,n.fillStyle=c,n.beginPath(),a?n.roundRect(p,m,g-24,s,[.25*s]):n.rect(p,m,g-24,s),n.fill(),a){h.disabled||n.stroke(),n.save(),n.beginPath(),n.rect(p,m,g-24,s),n.clip(),n.fillStyle=d;const e=h.label||h.name;n.font="10px Inter",null!=e&&n.fillText(e,24,m+.7*s),n.fillStyle=u,n.textAlign="right",n.fillText(String(h.value).substr(0,30),g-24,m+.7*s),n.restore()}break;default:h.draw&&h.draw(n,e,g,m,s)}t+=(h.computeSize?h.computeSize(g)[1]:s)+4,n.globalAlpha=this.editor_alpha}n.restore(),n.textAlign="left"}function mp(e,t,n,o,i){return new LiteGraph.ContextMenu(LiteGraph.NODE_MODES,{event:n,callback:function(e){if(!i)return;var t=Object.values(LiteGraph.NODE_MODES).indexOf(e),n=function(e){t>=0&&LiteGraph.NODE_MODES[t]?e.changeMode(t):e.changeMode(LiteGraph.ALWAYS),op||(op=np()),op.update()},o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)n(i);else for(var r in o.selected_nodes)n(o.selected_nodes[r])},parentMenu:o,node:i}),!1}function gp(e,t,n,o,i){if(!i)throw"no node for color";var r=[];for(var s in r.push({value:null,content:"No color"}),LGraphCanvas.node_colors){var a=LGraphCanvas.node_colors[s];e={value:s,content:""+s+""};r.push(e)}return new LiteGraph.ContextMenu(r,{event:n,callback:function(e){if(!i)return;var t=e.value?LGraphCanvas.node_colors[e.value]:null,n=function(e){t?e.constructor===LiteGraph.LGraphGroup?e.color=t.groupcolor:(e.color=t.color,e.bgcolor=t.bgcolor):(delete e.color,delete e.bgcolor),op||(op=np()),op.update()},o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)n(i);else for(var r in o.selected_nodes)n(o.selected_nodes[r]);i.setDirtyCanvas(!0,!0)},parentMenu:o,node:i}),!1}function vp(e,t,n,o,i){var r=e.property||"title",s=i[r],a=document.createElement("div");a.is_modified=!1,a.className="graphdialog",a.innerHTML="",a.close=function(){a.parentNode&&a.parentNode.removeChild(a)},a.querySelector(".name").innerText=r;var l=a.querySelector(".value");l&&(l.value=s,l.addEventListener("blur",(function(e){this.focus()})),l.addEventListener("keydown",(function(e){if(a.is_modified=!0,27==e.keyCode)a.close();else if(13==e.keyCode)h();else if(13!=e.keyCode&&"textarea"!=e.target.localName)return;e.preventDefault(),e.stopPropagation()})));var c=LGraphCanvas.active_canvas.canvas,u=c.getBoundingClientRect(),d=-20,p=-20;u&&(d-=u.left,p-=u.top),event?(a.style.left=event.clientX+d+"px",a.style.top=event.clientY+p+"px"):(a.style.left=.5*c.width+d+"px",a.style.top=.5*c.height+p+"px"),a.querySelector("button").addEventListener("click",h),c.parentNode.appendChild(a),l&&l.focus();var f=null;function h(){l&&function(t){"Number"==e.type?t=Number(t):"Boolean"==e.type&&(t=Boolean(t));i[r]=t,a.parentNode&&a.parentNode.removeChild(a);i.setDirtyCanvas(!0,!0),op||(op=np());op.update()}(l.value)}a.addEventListener("mouseleave",(function(e){LiteGraph.dialog_close_on_mouse_leave&&!a.is_modified&&LiteGraph.dialog_close_on_mouse_leave&&(f=setTimeout(a.close,LiteGraph.dialog_close_on_mouse_leave_delay))})),a.addEventListener("mouseenter",(function(e){LiteGraph.dialog_close_on_mouse_leave&&f&&clearTimeout(f)}))}y.registerExtension({name:"Comfy.EasyUse.UI",init(){var e,t;const n="Comfy.CustomColorPalettes",o="Comfy.Settings.Comfy.CustomColorPalettes";if(lp||(lp=A(n,o)),cp||(cp=A("Comfy.ColorPalette","Comfy.Settings.Comfy.ColorPalette")||"dark"),(!(null==(e=null==lp?void 0:lp.obsidian)?void 0:e.version)||lp.obsidian.version<$.ColorPalette.version)&&(lp.obsidian=$.ColorPalette,lp.obsidian_dark=G.ColorPalette,E(n,lp,o)),(!(null==(t=null==lp?void 0:lp.milk_white)?void 0:t.version)||lp.milk_white.version{(null==e?void 0:e.value)&&(null==e?void 0:e.oldValue)&&(await W(1),Object.assign(y.canvas.default_connection_color_byType,N),Object.assign(LGraphCanvas.link_type_colors,N)),"custom_milk_white"==e.value&&document.body.classList.remove(T)})),setTimeout((e=>bp(A("Comfy.UseNewMenu")||"Disabled")),1)},async nodeCreated(e){var t;if(rp.hasOwnProperty(e.comfyClass)){const t=rp[e.comfyClass],n=sp[t];if(!n)return;n.color&&(e.color=n.color),n.bgcolor&&(e.bgcolor=n.bgcolor)}if(ap||(ap=A("Comfy.WidgetControlMode")),"before"==ap){const n="before"==ap;if((null==(t=e.widgets)?void 0:t.length)>0)for(const t of e.widgets)if(["control_before_generate","control_after_generate"].includes(t.name)&&(await pp(t,n),t.linkedWidgets))for(const e of t.linkedWidgets)await pp(e,n)}}});const yp=null==(h=y.ui.settings.settingsLookup)?void 0:h["Comfy.UseNewMenu"];yp&&(yp.onChange=e=>bp(e));const bp=e=>{var t;const n=(null==(t=document.getElementById("crystools-root"))?void 0:t.children)||null;if((null==n?void 0:n.length)>0){if(!up)for(let e=0;ee.widgets.find((e=>e.name===t)),Sp=(e,t,n=!1,o="")=>{var i;if(!t||((e,t)=>!!e.inputs&&e.inputs.some((e=>e.name===t)))(e,t.name))return;_p[t.name]||(_p[t.name]={origType:t.type,origComputeSize:t.computeSize});const r=e.size;t.type=n?_p[t.name].origType:"easyHidden"+o,t.computeSize=n?_p[t.name].origComputeSize:()=>[0,-4],null==(i=t.linkedWidgets)||i.forEach((o=>Sp(e,o,":"+t.name,n)));const s=n?Math.max(e.computeSize()[1],r[1]):e.size[1];e.setSize([e.size[0],s])},xp=(e,t=0)=>{var n,o;if(e)return(null==(n=e.widgets)?void 0:n[t])?e.widgets[t].value:e.widgets_values?null==(o=e.widgets_values)?void 0:o[t]:void 0},kp=e=>e.setSize([e.size[0],e.computeSize()[1]]),Cp=(e,t)=>graph.getNodeById(e),Ap=e=>{var t;try{return Object.values(null==(t=null==graph?void 0:graph.list_of_graphcanvas[0])?void 0:t.selected_nodes)}catch(n){return[]}};function Ep(e,t,n){return e+(o=n,(.5-.5*Math.cos(Math.PI*o))*(t-e));var o}const Op=(e,t=!0)=>{var n,o;const i=(null==(o=null==(n=e.graph)?void 0:n.list_of_graphcanvas)?void 0:o[0])||null;if(!i)return;const[r,s]=e.pos,[a,l]=e.size;(([e,t],n)=>{const o=n.ds,i=document.body.clientWidth,r=document.body.clientHeight,s=o.scale,a=.5*i/s-e,l=.5*r/s-t,c=Date.now()+250,u=o.offset[0],d=o.offset[1],p=()=>{const e=c-Date.now();if(!(Date.now(){const t=Cp(e);t&&Op(t)},Tp=(e,t=(()=>graph.links??[])())=>t[e],Ip=e=>e.toLowerCase().replace(/_./g,(e=>e.replace("_","").toUpperCase())),Np=e=>"easy getNode"===e.type,Pp=e=>"easy setNode"===e.type,Dp=e=>Np(e)||Pp(e),jp=(e=(()=>graph._nodes??[])())=>e.filter((e=>Dp(e))),Mp=(e,t,n=0)=>{e.widgets_values||(e.widgets_values=[]),e.widgets_values[n]=t,e.widgets[n].value=t},Rp=e=>graph.add(e),$p=e=>graph.remove(e),Gp=(e,t=0)=>{var n,o;if("Reroute"!==e.type)return[e,t];const i=e,r=null==(o=null==(n=i.inputs)?void 0:n[0])?void 0:o.link;if(!r)return[i,t];const s=Tp(r);if(!s)return[i,t];const a=Cp(s.origin_id);return a?(setTimeout((()=>{$p(i)})),Gp(a,s.origin_slot)):[i,t]},Bp=e=>{var t,n,o;if("Reroute"!==e.type)return e;const i=e,r=null==(n=null==(t=i.outputs)?void 0:t[0])?void 0:n.links;if(!r)return i;const s=r[0];if(!s)return i;const a=Tp(s);if(!a)return i;const l=Cp(a.target_id);return l?(1===(null==(o=i.outputs[0].links)?void 0:o.length)&&setTimeout((()=>{$p(i)})),Bp(l)):i};const Fp=new class{constructor(){v(this,"element",_(`div.${L}toast`)),v(this,"children",HTMLElement),v(this,"container",document.body),this.container.appendChild(this.element)}async show(e){let t=_(`div.${L}toast-container`,[_("div",[_("span",[...e.icon?[_("i",{className:e.icon})]:[],_("span",e.content)])])]);t.setAttribute("toast-id",e.id),this.element.replaceChildren(t),this.container.appendChild(this.element),await W(64),t.style.marginTop=`-${t.offsetHeight}px`,await W(64),t.classList.add("show"),e.duration&&(await W(e.duration),this.hide(e.id))}async hide(e){const t=document.querySelector(`.${L}toast > [toast-id="${e}"]`);(null==t?void 0:t.classList.contains("show"))&&(t.classList.remove("show"),await W(750)),t&&t.remove()}async clearAllMessages(){let e=document.querySelector(`.${L}container`);e&&(e.innerHTML="")}async info(e,t=3e3,n=[]){this.show({id:"toast-info",icon:`mdi mdi-information ${L}theme`,content:e,duration:t})}async success(e,t=3e3){this.show({id:"toast-success",icon:`mdi mdi-check-circle ${L}success`,content:e,duration:t})}async error(e,t=3e3){this.show({id:"toast-error",icon:`mdi mdi-close-circle ${L}error`,content:e,duration:t})}async warn(e,t=3e3){this.show({id:"toast-warn",icon:`mdi mdi-alert-circle ${L}warning`,content:e,duration:t})}async showLoading(e,t=0){this.show({id:"toast-loading",icon:"mdi mdi-rotate-right loading",content:e,duration:t})}async hideLoading(){this.hide("toast-loading")}},Up=["rescale_after_model","rescale","lora_name","upscale_method","image_output","add_noise","info","sampler_name","ckpt_B_name","ckpt_C_name","save_model","refiner_ckpt_name","num_loras","num_controlnet","mode","toggle","resolution","ratio","target_parameter","input_count","replace_count","downscale_mode","range_mode","text_combine_mode","input_mode","lora_count","ckpt_count","conditioning_mode","preset","use_tiled","use_batch","num_embeds","easing_mode","guider","scheduler","inpaint_mode","t5_type","rem_mode"],zp=["LIGHT - SD1.5 only (low strength)","STANDARD (medium strength)","VIT-G (medium strength)","PLUS (high strength)","PLUS FACE (portraits)","FULL FACE - SD1.5 only (portraits stronger)"],Vp=["FACEID","FACEID PLUS - SD1.5 only","FACEID PLUS V2","FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"],Hp=["easy seed","easy latentNoisy","easy wildcards","easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingSdTurbo","easy preSamplingCascade","easy preSamplingDynamicCFG","easy preSamplingLayerDiffusion","easy fullkSampler","easy fullCascadeKSampler"],Wp=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy hyditLoader","easy pixArtLoader"],Yp=["easy imageSize","easy imageSizeBySide","easy imageSizeByLongerSide","easy imageSizeShow","easy imageRatio","easy imagePixelPerfect"];function Zp(e,t){const n=e.comfyClass,o=t.value;switch(t.name){case"range_mode":Sp(e,wp(e,"step"),"step"==o),Sp(e,wp(e,"num_steps"),"num_steps"==o),kp(e);break;case"text_combine_mode":Sp(e,wp(e,"replace_text"),"replace"==o);break;case"lora_name":["lora_model_strength","lora_clip_strength"].map((t=>Sp(e,wp(e,t),"None"!==o)));break;case"resolution":"自定义 x 自定义"===o&&(t.value="width x height (custom)"),["empty_latent_width","empty_latent_height"].map((t=>Sp(e,wp(e,t),"width x height (custom)"===o)));break;case"ratio":["empty_latent_width","empty_latent_height"].map((t=>Sp(e,wp(e,t),"custom"===o)));break;case"num_loras":var i=o+1,r=wp(e,"mode").value;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));for(let t=i;t<21;t++)["lora_"+t+"_name","lora_"+t+"_strength","lora_"+t+"_model_strength","lora_"+t+"_clip_strength"].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"num_controlnet":i=o+1,r=wp(e,"mode").value;for(let t=0;tSp(e,wp(e,t),!0))),["start_percent_"+t,"end_percent_"+t].map((t=>Sp(e,wp(e,t),"simple"!==r)));for(let t=i;t<21;t++)["controlnet_"+t,"controlnet_"+t+"_strength","scale_soft_weight_"+t,"start_percent_"+t,"end_percent_"+t].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"mode":switch(null==e?void 0:e.comfyClass){case"easy loraStack":i=wp(e,"num_loras").value+1,r=o;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));kp(e);break;case"easy controlnetStack":i=wp(e,"num_controlnet").value+1,r=o;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));kp(e);break;case"easy icLightApply":r=o;["lighting","remove_bg"].map((t=>Sp(e,wp(e,t),"Foreground"===r))),Sp(e,wp(e,"source"),"Foreground"!==r),kp(e)}break;case"toggle":t.type="toggle",t.options={on:"Enabled",off:"Disabled"};break;case"t5_type":["clip_name","padding"].map((t=>Sp(e,wp(e,t),"sd3"==o))),["t5_name","device","dtype"].map((t=>Sp(e,wp(e,t),"t5v11"==o))),kp(e);break;case"preset":if(zp.includes(o)){let t=wp(e,"use_tiled");Sp(e,wp(e,"lora_strength")),Sp(e,wp(e,"provider")),Sp(e,wp(e,"weight_faceidv2")),Sp(e,wp(e,"weight_kolors")),Sp(e,wp(e,"use_tiled"),!0),Sp(e,wp(e,"sharpening"),t&&t.value)}else Vp.includes(o)&&(Sp(e,wp(e,"weight_faceidv2"),!!["FACEID PLUS V2","FACEID PLUS KOLORS"].includes(o)),Sp(e,wp(e,"weight_kolors"),!!["FACEID PLUS KOLORS"].includes(t.value)),["FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"].includes(o)?Sp(e,wp(e,"lora_strength"),!1):Sp(e,wp(e,"lora_strength"),!0),Sp(e,wp(e,"provider"),!0),Sp(e,wp(e,"use_tiled")),Sp(e,wp(e,"sharpening")));kp(e);break;case"use_tiled":Sp(e,wp(e,"sharpening"),!!o),kp(e);break;case"num_embeds":i=o+1;for(let t=0;tSp(e,wp(e,t),!1)));break;case"brushnet_random":case"brushnet_segmentation":["dtype","scale","start_at","end_at"].map((t=>Sp(e,wp(e,t),!0))),["fitting","function"].map((t=>Sp(e,wp(e,t),!1)));break;case"powerpaint":["dtype","fitting","function","scale","start_at","end_at"].map((t=>Sp(e,wp(e,t),!0)))}kp(e);break;case"image_output":Sp(e,wp(e,"link_id"),!!["Sender","Sender&Save"].includes(o)),Sp(e,wp(e,"decode_vae_name"),!!["Hide","Hide&Save"].includes(o)),["save_prefix","output_path","embed_workflow","number_padding","overwrite_existing"].map((t=>Sp(e,wp(e,t),!!["Save","Hide&Save","Sender&Save"].includes(o))));break;case"add_noise":var s=wp(e,"control_before_generate"),a=wp(e,"control_after_generate")||s;"disable"===o?(Sp(e,wp(e,"seed")),a&&(a.last_value=a.value,a.value="fixed",Sp(e,a))):(Sp(e,wp(e,"seed"),!0),a&&((null==a?void 0:a.last_value)&&(a.value=a.last_value),Sp(e,a,!0))),kp(e);break;case"guider":switch(o){case"Basic":["cfg","cfg_negative"].map((t=>Sp(e,wp(e,t))));break;case"CFG":Sp(e,wp(e,"cfg"),!0),Sp(e,wp(e,"cfg_negative"));break;case"IP2P+DualCFG":case"DualCFG":["cfg","cfg_negative"].map((t=>Sp(e,wp(e,t),!0)))}kp(e);break;case"scheduler":["karrasADV","exponentialADV","polyExponential"].includes(o)?(["sigma_max","sigma_min"].map((t=>Sp(e,wp(e,t),!0))),["denoise","beta_d","beta_min","eps_s","coeff"].map((t=>Sp(e,wp(e,t))),!1),Sp(e,wp(e,"rho"),"exponentialADV"!=o)):"vp"==o?(["sigma_max","sigma_min","denoise","rho","coeff"].map((t=>Sp(e,wp(e,t)))),["beta_d","beta_min","eps_s"].map((t=>Sp(e,wp(e,t),!0)))):(["sigma_max","sigma_min","beta_d","beta_min","eps_s","rho"].map((t=>Sp(e,wp(e,t)))),Sp(e,wp(e,"coeff"),"gits"==o),Sp(e,wp(e,"denoise"),!0)),kp(e);break;case"conditioning_mode":["replace","concat","combine"].includes(o)?["average_strength","old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t)))):"average"==o?(Sp(e,wp(e,"average_strength"),!0),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t),!1)))):"timestep"==o&&(["average_strength"].map((t=>Sp(e,wp(e,t),!1))),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t)))));break;case"rescale":wp(e,"rescale_after_model").value,Sp(e,wp(e,"width"),"to Width/Height"===o),Sp(e,wp(e,"height"),"to Width/Height"===o),Sp(e,wp(e,"percent"),"by percentage"===o),Sp(e,wp(e,"longer_side"),"to longer side - maintain aspect"===o),kp(e);break;case"upscale_method":["factor","crop"].map((t=>Sp(e,wp(e,t),"None"!==o)));break;case"target_parameter":switch(n){case"easy XYInputs: Steps":["first_step","last_step"].map((t=>Sp(e,wp(e,t),"steps"==o))),["first_start_step","last_start_step"].map((t=>Sp(e,wp(e,t),"start_at_step"==o))),["first_end_step","last_end_step"].map((t=>Sp(e,wp(e,t),"end_at_step"==o)));break;case"easy XYInputs: Sampler/Scheduler":let t=wp(e,"input_count").value+1;for(let n=0;nSp(e,wp(e,t),"strength"==o))),["first_start_percent","last_start_percent"].map((t=>Sp(e,wp(e,t),"start_percent"==o))),["first_end_percent","last_end_percent"].map((t=>Sp(e,wp(e,t),"end_percent"==o))),["strength","start_percent","end_percent"].map((t=>Sp(e,wp(e,t),o!=t))),kp(e)}case"replace_count":i=o+1;for(let t=0;tSp(e,wp(e,t),!l)));for(let t=i;t<11;t++)["lora_name_"+t,"model_str_"+t,"clip_str_"+t].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"ckpt_count":i=o+1;var c=-1!=wp(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=wp(e,"input_mode").value.indexOf("VAE");for(let t=0;tSp(e,wp(e,t),!1)));kp(e);break;case"input_count":i=o+1;var d=wp(e,"target_parameter").value;for(let t=0;tSp(e,wp(e,n),!t)));["model_strength","clip_strength"].map((n=>Sp(e,wp(e,n),!t)));break;case"easy XYInputs: Checkpoint":i=wp(e,"ckpt_count").value+1,c=-1!=wp(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=wp(e,"input_mode").value.indexOf("VAE");for(let n=0;ne.name===t));if(-1!==e){for(let t=e;t{var e;const t=this.computeSize();t[0]"info"===e.name));if(-1!==e&&this.widgets[e]){this.widgets[e].value=t}}requestAnimationFrame((()=>{var e;const t=this.computeSize();t[0]"prompt"==e.name));this.addWidget("button","get values from COMBO link","",(()=>{var t,o;const i=(null==(o=null==(t=this.outputs[1])?void 0:t.links)?void 0:o.length)>0?this.outputs[1].links[0]:null,r=n.graph._nodes.find((e=>{var t;return null==(t=e.inputs)?void 0:t.find((e=>e.link==i))}));if(i&&r){const t=r.inputs.find((e=>e.link==i)).widget.name,n=r.widgets.find((e=>e.name==t));let o=(null==n?void 0:n.options.values)||null;o&&(o=o.join("\n"),e.value=o)}else Fp.error(V("No COMBO link"),3e3)}),{serialize:!1})}),Wp.includes(t.name)){let t=function(e){var t="";for(let n=0;ne.name===t+"_prompt")),o="comfy-multiline-input wildcard_"+t+"_"+this.id.toString();if(-1==n&&e){const n=document.createElement("textarea");n.className=o,n.placeholder="Wildcard Prompt ("+t+")";const i=this.addDOMWidget(t+"_prompt","customtext",n,{getValue:e=>n.value,setValue(e){n.value=e},serialize:!1});i.inputEl=n,i.inputEl.readOnly=!0,n.addEventListener("input",(()=>{var e;null==(e=i.callback)||e.call(i,i.value)})),i.value=e}else if(this.widgets[n])if(e){this.widgets[n].value=e}else{this.widgets.splice(n,1);const e=document.getElementsByClassName(o);e&&e[0]&&e[0].remove()}}};e.prototype.onExecuted=function(e){null==a||a.apply(this,arguments);const o=t(e.positive),i=t(e.negative);n.call(this,o,"positive"),n.call(this,i,"negative")}}if(["easy sv3dLoader"].includes(t.name)){let t=function(e,t,n){switch(e){case"azimuth":return n.readOnly=!0,n.style.opacity=.6,"0:(0.0,0.0)"+(t>1?`\n${t-1}:(360.0,0.0)`:"");case"elevation":return n.readOnly=!0,n.style.opacity=.6,"0:(-90.0,0.0)"+(t>1?`\n${t-1}:(90.0,0.0)`:"");case"custom":return n.readOnly=!1,n.style.opacity=1,"0:(0.0,0.0)\n9:(180.0,0.0)\n20:(360.0,0.0)"}};e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>"easing_mode"==e.name)),n=this.widgets.find((e=>"batch_size"==e.name)),o=this.widgets.find((e=>"scheduler"==e.name));setTimeout((i=>{o.value||(o.value=t(e.value,n.value,o.inputEl))}),1),e.callback=e=>{o.value=t(e,n.value,o.inputEl)},n.callback=n=>{o.value=t(e.value,n,o.inputEl)}}}if(Hp.includes(o)&&(e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),o=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));if("easy seed"==t.name){const t=this.addWidget("button","🎲 Manual Random Seed",null,(t=>{"fixed"!=o.value&&(o.value="fixed"),e.value=Math.floor(Math.random()*P),n.queuePrompt(0,1)}),{serialize:!1});e.linkedWidgets=[t,o]}},e.prototype.onAdded=async function(){i&&i.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),t=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));setTimeout((n=>{"control_before_generate"==t.name&&0===e.value&&(e.value=Math.floor(Math.random()*P))}),1)}),"easy convertAnything"==o&&(e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>"output_type"==e.name)),t=t=>{this.outputs[0].type=e.value.toUpperCase(),this.outputs[0].name=e.value,this.outputs[0].label=e.value};setTimeout((e=>t()),10),e.callback=e=>t()}),"easy imageInsetCrop"==o){let t=function(e){const t=e.widgets[0];for(let n=1;n<=4;n++)"Pixels"===t.value?(e.widgets[n].options.step=80,e.widgets[n].options.max=8192):(e.widgets[n].options.step=10,e.widgets[n].options.max=99)};e.prototype.onAdded=async function(e){const n=this.widgets[0];let o=n.callback;n.callback=(...e)=>{t(this),o&&o.apply(n,[...e])},setTimeout((e=>{t(this)}),1)}}},nodeCreated(e){if(e.comfyClass.startsWith("easy ")){if(e.widgets)for(const n of e.widgets){if(!Up.includes(n.name))continue;let t=n.value;Zp(e,n),Object.defineProperty(n,"value",{get:e=>t,set(o){o!==t&&(t=o,Zp(e,n))}})}const t=e.comfyClass;if("easy preDetailerFix"==t){const t=e.widgets.find((e=>"customtext"===e.type));if(!t)return;t.dynamicPrompts=!1,t.inputEl.placeholder="wildcard spec: if kept empty, this option will be ignored",t.serializeValue=()=>t.value}if("easy wildcards"==t){const t=e.widgets.find((e=>"text"==e.name));let n=1;Object.defineProperty(e.widgets[n],"value",{set:e=>{if((new Error).stack.includes("inner_value_change")&&"Select the LoRA to add to the text"!=e){let n=e;n.endsWith(".safetensors")&&(n=n.slice(0,-12)),t.value+=``}},get:e=>"Select the LoRA to add to the text"}),Object.defineProperty(e.widgets[n+1],"value",{set:e=>{(new Error).stack.includes("inner_value_change")&&"Select the Wildcard to add to the text"!=e&&(""!=t.value&&(t.value+=", "),t.value+=e)},get:e=>"Select the Wildcard to add to the text"}),e.widgets[n].serializeValue=e=>"Select the LoRA to add to the text",e.widgets[n+1].serializeValue=e=>"Select the Wildcard to add to the text"}if(Yp.includes(t)){const t=document.createElement("textarea");t.className="comfy-multiline-input",t.readOnly=!0;const n=e.addDOMWidget("info","customtext",t,{getValue:e=>t.value,setValue:e=>t.value=e,serialize:!1});n.inputEl=t,t.addEventListener("input",(()=>{var e;null==(e=n.callback)||e.call(n,n.value)}))}}}}),y.registerExtension({name:"easy bookmark",registerCustomNodes(){class e{constructor(){v(this,"type","easy bookmark"),v(this,"title","🔖"),v(this,"slot_start_y",-20),v(this,"___collapsed_width",0),v(this,"isVirtualNode",!0),v(this,"serialize_widgets",!0),v(this,"keypressBound",null),this.addWidget("text","shortcut_key","1",(e=>{""!==(e=e.trim()[0]||"1")&&(this.title="🔖 "+e)}),{y:8}),this.addWidget("number","zoom",1,(e=>{}),{y:8+LiteGraph.NODE_WIDGET_HEIGHT+4,max:2,min:.5,precision:2}),this.keypressBound=this.onKeypress.bind(this)}get _collapsed_width(){return this.___collapsed_width}set _collapsed_width(e){const t=y.canvas,n=t.canvas.getContext("2d");if(n){const e=n.font;n.font=t.title_text_font,this.___collapsed_width=40+n.measureText(this.title).width,n.font=e}}onAdded(){setTimeout((e=>{const t=this.widgets[0].value;t&&(this.title="🔖 "+t)}),1),window.addEventListener("keydown",this.keypressBound)}onRemoved(){window.removeEventListener("keydown",this.keypressBound)}onKeypress(e){const t=e.target;["input","textarea"].includes(t.localName)||this.widgets[0]&&e.key.toLocaleLowerCase()===this.widgets[0].value.toLocaleLowerCase()&&this.canvasToBookmark()}canvasToBookmark(){var e,t;const n=y.canvas;(null==(e=null==n?void 0:n.ds)?void 0:e.offset)&&(n.ds.offset[0]=16-this.pos[0],n.ds.offset[1]=40-this.pos[1]),null!=(null==(t=null==n?void 0:n.ds)?void 0:t.scale)&&(n.ds.scale=Number(this.widgets[1].value||1)),n.setDirty(!0,!0)}}LiteGraph.registerNodeType("easy bookmark",Object.assign(e,{title:"Bookmark 🔖"})),e.category="EasyUse/Util"}}),y.registerExtension({name:"Comfy.EasyUse.ChainNode",init(){y.canvas._mousemove_callback=e=>{if(!A("EasyUse.Nodes.ChainGetSet",null,!0))return;((e,t=!1,n={})=>{var o,i,r,s,a;if(0===e.length)return;const l=n.inputX||160,c=n.ouputX||60;if(e.filter((e=>Dp(e))).length>1)return;for(const d of e){let s=0,a=0;const u=n.inputY||10,p=n.outputY||30,f=[];if(d.graph){for(const e of d.inputs??[]){const t=e.link;if(!t)continue;const{origin_id:n,target_slot:o}=Tp(t),i=Cp(n);if(!i)continue;if(!Dp(i))continue;const r=d.getConnectionPos(!0,o);i.pos=[r[0]-l,r[1]+15+s*u],s+=1,f.push(i),i.flags.collapsed=!0}for(const e of d.outputs??[])if(e.links&&d.graph)for(const t of e.links){const{target_id:e}=Tp(t),n=Cp(e);if(!n)continue;if(!Dp(n))continue;const i=null==(o=n.outputs)?void 0:o.links;if((null==i?void 0:i.length)>1)return;const r=d.getConnectionPos(!1,0);n.pos=[r[0]+c,r[1]+15+a*p],a+=1,f.push(n),n.flags.collapsed=!0}if(t&&1===e.length){const e=[d,...f];(null==(r=null==(i=d.graph)?void 0:i.list_of_graphcanvas)?void 0:r[0]).selectNodes(e)}}}const u=e[0];if(!u)return;(null==(a=null==(s=u.graph)?void 0:s.list_of_graphcanvas)?void 0:a[0]).setDirty(!0,!0)})(Ap())};const e=LGraphCanvas.prototype.showLinkMenu;LGraphCanvas.prototype.showLinkMenu=function(t,n){return n.shiftKey?(((e,t=!1)=>{var n,o,i,r,s,a,l,c,u,d;const{type:p}=e;if("*"===p)return;let{origin_id:f,target_id:h,origin_slot:m,target_slot:g}=e,v=Cp(f),y=Cp(h);if(!v||!y)return!1;if("Reroute"===v.type){let e=0;[v,e]=Gp(v),f=null==v?void 0:v.id,m=e,void 0!==m&&-1!==m||(m=0)}if("Reroute"===y.type&&(y=Bp(y),h=null==y?void 0:y.id,g=null==y?void 0:y.inputs.findIndex((e=>e.type===p)),void 0!==g&&-1!==g||(g=0)),void 0===f||void 0===h||!v||!y)return!1;if(t&&(Dp(v)||Dp(y)))return!1;let b=Ip((null==(n=y.getInputInfo(g))?void 0:n.name)??p.toLowerCase());b||(b=Ip((null==(i=null==(o=null==v?void 0:v.outputs)?void 0:o[m])?void 0:i.name)??(null==(s=null==(r=null==v?void 0:v.outputs)?void 0:r[m])?void 0:s.type.toString())??b+`_from_${f}_to_${h}`));let _,w=!1,S=!1;if(Dp(v))b=xp(v),S=!0;else{const e=null==(l=null==(a=v.outputs)?void 0:a[m])?void 0:l.links;if(e)for(const t of e){const e=Cp((null==(c=Tp(t))?void 0:c.target_id)??-1);e&&Dp(e)&&Pp(e)&&(b=xp(e),S=!0)}if(!S){for(const e of jp()){if(b!==xp(e)||!Pp(e))continue;const t=null==(u=e.inputs[0])?void 0:u.link;(null==(d=Tp(t))?void 0:d.origin_id)===v.id?S=!0:w=!0}w&&(b+=`_from_${f}_to_${h}`)}}if(!S){_=LiteGraph.createNode("easy setNode"),_.is_auto_link=!0;const e=v.getConnectionPos(!1,m);_.pos=[e[0]+20,e[1]],_.inputs[0].name=b,_.inputs[0].type=p,_.inputs[0].widget=y.inputs[g].widget,Mp(_,b),Rp(_),_.flags.collapsed=!0;let t=[];v.widgets?t=Object.values(v.widgets).map((e=>e.value)):v.widgets_values&&(t=JSON.parse(JSON.stringify(v.widgets_values))),v.connect(m,_,0),v.widgets_values=t,"PrimitiveNode"===v.type&&setTimeout((()=>{if(v){v.connect(m,_,0);for(const[e,n]of t.entries())Mp(v,n,e);null!==_&&_.setSize(_.computeSize())}}))}const x=LiteGraph.createNode("easy getNode"),k=y.getConnectionPos(!0,g);x.pos=[k[0]-150,k[1]],x.outputs[0].name=b,x.outputs[0].type=p,x.outputs[0].widget=y.inputs[g].widget,Rp(x),Mp(x,b),null===x||(x.flags.collapsed=!0,x.setSize(x.computeSize()),x.connect(0,y,g))})(t),!1):(e.apply(this,[t,n]),!1)}}});let Kp=[];function Xp(e,t,n,o,i){var r=LGraphCanvas.active_canvas,s=r.getCanvasWindow(),a=r.graph;if(a)return function e(t,o){var l=LiteGraph.getNodeTypesCategories(r.filter||a.filter).filter((function(e){return e.startsWith(t)})),c=[];l.map((function(n){if(n){var o=new RegExp("^("+t+")"),i=n.replace(o,"").split("/")[0],r=""===t?i+"/":t+i+"/",s=i;-1!=s.indexOf("::")&&(s=s.split("::")[1]),-1===c.findIndex((function(e){return e.value===r}))&&c.push({value:r,content:s,has_submenu:!0,callback:function(t,n,o,i){e(t.value,i)}})}})),LiteGraph.getNodeTypesInCategory(t.slice(0,-1),r.filter||a.filter).map((function(e){if(!e.skip_list){var t={value:e.type,content:e.title,has_submenu:!1,callback:function(e,t,n,o){var s=o.getFirstEvent();r.graph.beforeChange();var a=LiteGraph.createNode(e.value);a&&(a.pos=r.convertEventToCanvasOffset(s),r.graph.add(a)),i&&i(a),r.graph.afterChange()}};c.push(t)}}));const u=A("EasyUse.ContextMenu.NodesSort",null,!0);""===t&&u&&(c=function(e){let t=[],n=[];return e.forEach((e=>{(null==e?void 0:e.value)&&D.includes(e.value.split("/")[0])?t.push(e):n.push(e)})),[{title:V("ComfyUI Basic"),is_category_title:!0},...t,{title:V("Others A~Z"),is_category_title:!0},...n.sort(((e,t)=>e.content.localeCompare(t.content)))]}(c)),new LiteGraph.ContextMenu(c,{event:n,parentMenu:o},s)}("",o),!1}function Qp(e,t,n){var o=this;n=n||{};var i=document.createElement("div");i.className="litemenu-entry submenu";var r=!1;function s(e){var t=this.value,i=!0;(o.current_submenu&&o.current_submenu.close(e),n.callback)&&(!0===n.callback.call(this,t,n,e,o,n.node)&&(i=!1));if(t){if(t.callback&&!n.ignore_item_callbacks&&!0!==t.disabled)!0===t.callback.call(this,t,n,e,o,n.extra)&&(i=!1);if(t.submenu){if(!t.submenu.options)throw"ContextMenu submenu needs options";new o.constructor(t.submenu.options,{callback:t.submenu.callback,event:e,parentMenu:o,ignore_item_callbacks:t.submenu.ignore_item_callbacks,title:t.submenu.title,extra:t.submenu.extra,autoopen:n.autoopen}),i=!1}}i&&!o.lock&&o.close()}return null===t?i.classList.add("separator"):t.is_category_title?(i.classList.remove("litemenu-entry"),i.classList.remove("submenu"),i.classList.add("litemenu-title"),i.innerHTML=t.title):(i.innerHTML=t&&t.title?t.title:e,i.value=t,t&&(t.disabled&&(r=!0,i.classList.add("disabled")),(t.submenu||t.has_submenu)&&i.classList.add("has_submenu")),"function"==typeof t?(i.dataset.value=e,i.onclick_callback=t):i.dataset.value=t,t.className&&(i.className+=" "+t.className)),this.root.appendChild(i),r||i.addEventListener("click",s),!r&&n.autoopen&&LiteGraph.pointerListenerAdd(i,"enter",(function(e){var t=this.value;if(!t||!t.has_submenu)return;s.call(this,e)})),i}function Jp(e){return e.substring(0,e.lastIndexOf("."))}function qp(e){return e.substring(e.lastIndexOf(".")+1)}y.registerExtension({name:"Comfy.EasyUse.ContextMenu",async setup(){LGraphCanvas.onMenuAdd=Xp;const e=await b.fetchApi("/easyuse/models/thumbnail");if(200===e.status){let t=await e.json();Kp=t}else Fp.error(V("Too many thumbnails, have closed the display"));const t=LiteGraph.ContextMenu;LiteGraph.ContextMenu=function(e,n){var o,i;if(n.parentMenu);else if(n.extra)null==(o=n.extra.constructor)||o.name;else if(n.scale){if(A("EasyUse.ContextMenu.SubDirectories",null,!0)){const o=function(e,t){const n=e,o=[...n],i={},r=[],s=[],a=["ckpt","pt","bin","pth","safetensors"];if((null==e?void 0:e.length)>0){const t=qp(e[e.length-1]);if(!a.includes(t))return null}for(const l of n){const e=l.indexOf("/")>-1?"/":"\\",t=l.split(e);if(t.length>1){const n=t.shift();i[n]=i[n]||[],i[n].push(t.join(e))}else"CHOOSE"===l||l.startsWith("DISABLE ")?r.push(l):s.push(l)}if(Object.values(i).length>0){const e=t.callback;t.callback=null;const n=(t,n)=>{["None","无","無","なし"].includes(t.content)?e("None",n):e(o.find((e=>e.endsWith(t.content)),n))},l=(e,t="")=>{const o=t?t+"\\"+Jp(e):Jp(e),i=qp(e),r=(new Date).getTime();let s,l="";if(a.includes(i))for(let n=0;n{let n=[],o=[];const r=e.map((e=>{const r={},s=e.indexOf("/")>-1?"/":"\\",a=e.split(s);if(a.length>1){const e=a.shift();r[e]=r[e]||[],r[e].push(a.join(s))}if(Object.values(i).length>0){let t=Object.keys(r)[0];t&&r[t]?n.push({key:t,value:r[t][0]}):o.push(l(e,t))}return l(e,t)}));if(n.length>0){let e={};return n.forEach((t=>{e[t.key]=e[t.key]||[],e[t.key].push(t.value)})),[...Object.entries(e).map((e=>({content:e[0],has_submenu:!0,callback:()=>{},submenu:{options:u(e[1],e[0])}}))),...o]}return r};for(const[t,o]of Object.entries(i))c.push({content:t,has_submenu:!0,callback:()=>{},submenu:{options:u(o,t)}});return c.push(...s.map((e=>l(e,"")))),r.length>0&&c.push(...r.map((e=>l(e,"")))),c}return null}(e,n);if(o)return t.call(this,o,n)}}else n.hasOwnProperty("extra")&&(e.unshift(null),i=window.location.host,["192.168.","10.","127.",/^172\.((1[6-9]|2[0-9]|3[0-1])\.)/].some((e=>"string"==typeof e?i.startsWith(e):e.test(i)))&&e.unshift({content:`${V("Reboot ComfyUI")}`,callback:e=>async function(){if(confirm(V("Are you sure you'd like to reboot the server?")))try{b.fetchApi("/easyuse/reboot")}catch(e){}}()}),e.unshift({content:`${V("Cleanup Of GPU Usage")}`,callback:e=>async function(){try{const{Running:e,Pending:t}=await b.getQueue();if(e.length>0||t.length>0)return void Fp.error(V("Clean Failed")+":"+V("Please stop all running tasks before cleaning GPU"));200==(await b.fetchApi("/easyuse/cleangpu",{method:"POST"})).status?Fp.success(V("Clean SuccessFully")):Fp.error(V("Clean Failed"))}catch(e){}}()}));return t.apply(this,[...arguments])},LiteGraph.ContextMenu.prototype=t.prototype,LiteGraph.ContextMenu.prototype.addItem=Qp}});class ef extends w{constructor(){super(),this.element.classList.add("easyuse-model-metadata")}show(e){super.show(_("div",Object.keys(e).map((t=>_("div",[_("label",{textContent:t}),_("span",{textContent:e[t]})])))))}}class tf extends w{constructor(e){super(),this.name=e,this.element.classList.add("easyuse-model-info")}get customNotes(){return this.metadata["easyuse.notes"]}set customNotes(e){this.metadata["easyuse.notes"]=e}get hash(){return this.metadata["easyuse.sha256"]}async show(e,t){this.type=e;const n=b.fetchApi("/easyuse/metadata/"+encodeURIComponent(`${e}/${t}`));this.info=_("div",{style:{flex:"auto"}}),this.imgCurrent=0,this.imgList=_("div.easyuse-preview-list",{style:{display:"none"}}),this.imgWrapper=_("div.easyuse-preview",[_("div.easyuse-preview-group",[this.imgList])]),this.main=_("main",{style:{display:"flex"}},[this.imgWrapper,this.info]),this.content=_("div.easyuse-model-content",[_("div.easyuse-model-header",[_("h2",{textContent:this.name})]),this.main]);const o=_("div",{textContent:"ℹ️ Loading...",parent:this.content});super.show(this.content),this.metadata=await(await n).json(),this.viewMetadata.style.cursor=this.viewMetadata.style.opacity="",this.viewMetadata.removeAttribute("disabled"),o.remove(),this.addInfo()}createButtons(){const e=super.createButtons();return this.viewMetadata=_("button",{type:"button",textContent:"View raw metadata",disabled:"disabled",style:{opacity:.5,cursor:"not-allowed"},onclick:e=>{this.metadata&&(new ef).show(this.metadata)}}),e.unshift(this.viewMetadata),e}parseNote(){if(!this.customNotes)return[];let e=[];const t=new RegExp("(\\bhttps?:\\/\\/[^\\s]+)","g");let n,o=0;do{let i;n=t.exec(this.customNotes);let r=0;n?(i=n.index,r=n.index+n[0].length):i=this.customNotes.length;let s=this.customNotes.substring(o,i);s&&(s=s.replaceAll("\n","
"),e.push(_("span",{innerHTML:s}))),n&&e.push(_("a",{href:n[0],textContent:n[0],target:"_blank"})),o=r}while(n);return e}addInfoEntry(e,t){return _("p",{parent:this.info},["string"==typeof e?_("label",{textContent:e+": "}):e,"string"==typeof t?_("span",{textContent:t}):t])}async getCivitaiDetails(){const e=await fetch("https://civitai.com/api/v1/model-versions/by-hash/"+this.hash);if(200===e.status)return await e.json();throw 404===e.status?new Error("Model not found"):new Error(`Error loading info (${e.status}) ${e.statusText}`)}addCivitaiInfo(){const e=this.getCivitaiDetails(),t=_("span",{textContent:"ℹ️ Loading..."});return this.addInfoEntry(_("label",[_("img",{style:{width:"18px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),_("span",{textContent:"Civitai: "})]),t),e.then((e=>{var t,n;this.imgWrapper.style.display="block";let o=this.element.querySelector(".easyuse-model-header");o&&o.replaceChildren(_("h2",{textContent:this.name}),_("div.easyuse-model-header-remark",[_("h5",{textContent:V("Updated At:")+O(new Date(e.updatedAt),"yyyy/MM/dd")}),_("h5",{textContent:V("Created At:")+O(new Date(e.updatedAt),"yyyy/MM/dd")})]));let i=null,r=this.parseNote.call(this),s=V("✏️ Edit"),a=_("div.easyuse-model-detail-textarea",[_("p",(null==r?void 0:r.length)>0?r:{textContent:V("No notes")})]);if(r&&0!=r.length?a.classList.remove("empty"):a.classList.add("empty"),this.info.replaceChildren(_("div.easyuse-model-detail",[_("div.easyuse-model-detail-head.flex-b",[_("span",V("Notes")),_("a",{textContent:s,href:"#",style:{fontSize:"12px",float:"right",color:"var(--warning-color)",textDecoration:"none"},onclick:async e=>{if(e.preventDefault(),i){if(i.value!=this.customNotes){toast.showLoading(V("Saving Notes...")),this.customNotes=i.value;const e=await b.fetchApi("/easyuse/metadata/notes/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:this.customNotes});if(toast.hideLoading(),200!==e.status)return toast.error(V("Saving Failed")),void alert(`Error saving notes (${e.status}) ${e.statusText}`);toast.success(V("Saving Succeed")),r=this.parseNote.call(this),a.replaceChildren(_("p",(null==r?void 0:r.length)>0?r:{textContent:V("No notes")})),i.value?a.classList.remove("empty"):a.classList.add("empty")}else a.replaceChildren(_("p",{textContent:V("No notes")})),a.classList.add("empty");e.target.textContent=s,i.remove(),i=null}else e.target.textContent="💾 Save",i=_("textarea",{placeholder:V("Type your notes here"),style:{width:"100%",minWidth:"200px",minHeight:"50px",height:"100px"},textContent:this.customNotes}),a.replaceChildren(i),i.focus()}})]),a]),_("div.easyuse-model-detail",[_("div.easyuse-model-detail-head",{textContent:V("Details")}),_("div.easyuse-model-detail-body",[_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Type")}),_("div.easyuse-model-detail-item-value",{textContent:e.model.type})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("BaseModel")}),_("div.easyuse-model-detail-item-value",{textContent:e.baseModel})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Download")}),_("div.easyuse-model-detail-item-value",{textContent:(null==(t=e.stats)?void 0:t.downloadCount)||0})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Trained Words")}),_("div.easyuse-model-detail-item-value",{textContent:(null==e?void 0:e.trainedWords.join(","))||"-"})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Source")}),_("div.easyuse-model-detail-item-value",[_("label",[_("img",{style:{width:"14px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),_("a",{href:"https://civitai.com/models/"+e.modelId,textContent:"View "+e.model.name,target:"_blank"})])])])])])),null==(n=e.images)?void 0:n.length){this.imgCurrent=0,this.isSaving=!1,e.images.map((e=>e.url&&this.imgList.appendChild(_("div.easyuse-preview-slide",[_("div.easyuse-preview-slide-content",[_("img",{src:e.url}),_("div.save",{textContent:"Save as preview",onclick:async()=>{if(this.isSaving)return;this.isSaving=!0,toast.showLoading(V("Saving Preview..."));const t=await(await fetch(e.url)).blob(),n="temp_preview."+new URL(e.url).pathname.split(".")[1],o=new FormData;o.append("image",new File([t],n)),o.append("overwrite","true"),o.append("type","temp");if(200!==(await b.fetchApi("/upload/image",{method:"POST",body:o})).status)return this.isSaving=!1,toast.error(V("Saving Failed")),toast.hideLoading(),void alert(`Error saving preview (${req.status}) ${req.statusText}`);await b.fetchApi("/easyuse/save/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:JSON.stringify({filename:n,type:"temp"}),headers:{"content-type":"application/json"}}).then((e=>{toast.success(V("Saving Succeed")),toast.hideLoading()})),this.isSaving=!1,app.refreshComboInNodes()}})])]))));let t=this;this.imgDistance=(-660*this.imgCurrent).toString(),this.imgList.style.display="",this.imgList.style.transform="translate3d("+this.imgDistance+"px, 0px, 0px)",this.slides=this.imgList.querySelectorAll(".easyuse-preview-slide"),this.slideLeftButton=_("button.left",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{e.images.length<=2||(t.imgList.classList.remove("no-transition"),0==t.imgCurrent?(t.imgCurrent=e.images.length/2-1,this.slides[this.slides.length-1].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d(660px, 0px, 0px)",setTimeout((e=>{this.slides[this.slides.length-1].style.transform="translate3d(0px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)):(t.imgCurrent=t.imgCurrent-1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"))}}),this.slideRightButton=_("button.right",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{if(!(e.images.length<=2))if(t.imgList.classList.remove("no-transition"),t.imgCurrent>=e.images.length/2-1){t.imgCurrent=0;const n=e.images.length/2;this.slides[0].style.transform="translate3d("+(660*n).toString()+"px, 0px, 0px)",this.slides[1].style.transform="translate3d("+(660*n).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d("+(-660*n).toString()+"px, 0px, 0px)",setTimeout((e=>{this.slides[0].style.transform="translate3d(0px, 0px, 0px)",this.slides[1].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)}else t.imgCurrent=t.imgCurrent+1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"}})}return e.description&&_("div",{parent:this.content,innerHTML:e.description,style:{marginTop:"10px"}}),e})).catch((e=>{this.imgWrapper.style.display="none",t.textContent="⚠️ "+e.message})).finally((e=>{}))}}class nf extends tf{async addInfo(){await this.addCivitaiInfo()}}class of extends tf{getTagFrequency(){if(!this.metadata.ss_tag_frequency)return[];const e=JSON.parse(this.metadata.ss_tag_frequency),t={};for(const n in e){const o=e[n];for(const e in o)e in t?t[e]+=o[e]:t[e]=o[e]}return Object.entries(t).sort(((e,t)=>t[1]-e[1]))}getResolutions(){let e=[];if(this.metadata.ss_bucket_info){const t=JSON.parse(this.metadata.ss_bucket_info);if(null==t?void 0:t.buckets)for(const{resolution:n,count:o}of Object.values(t.buckets))e.push([o,`${n.join("x")} * ${o}`])}e=e.sort(((e,t)=>t[0]-e[0])).map((e=>e[1]));let t=this.metadata.ss_resolution;if(t){const n=t.split(","),o=n[0].replace("(",""),i=n[1].replace(")","");e.push(`${o.trim()}x${i.trim()} (Base res)`)}else(t=this.metadata["modelspec.resolution"])&&e.push(t+" (Base res");return e.length||e.push("⚠️ Unknown"),e}getTagList(e){return e.map((e=>_("li.easyuse-model-tag",{dataset:{tag:e[0]},$:e=>{e.onclick=()=>{e.classList.toggle("easyuse-model-tag--selected")}}},[_("p",{textContent:e[0]}),_("span",{textContent:e[1]})])))}addTags(){let e,t=this.getTagFrequency();if(null==t?void 0:t.length){const n=t.length;let o;n>500&&(t=t.slice(0,500),e=_("p",[_("span",{textContent:"⚠️ Only showing first 500 tags "}),_("a",{href:"#",textContent:`Show all ${n}`,onclick:()=>{o.replaceChildren(...this.getTagList(this.getTagFrequency())),e.remove()}})])),o=_("ol.easyuse-model-tags-list",this.getTagList(t)),this.tags=_("div",[o])}else this.tags=_("p",{textContent:"⚠️ No tag frequency metadata found"});this.content.append(this.tags),e&&this.content.append(e)}async addInfo(){const e=this.addCivitaiInfo();this.addTags();const t=await e;t&&_("div",{parent:this.content,innerHTML:t.description,style:{maxHeight:"250px",overflow:"auto"}})}createButtons(){const e=super.createButtons();function t(e,t){const n=_("textarea",{parent:document.body,style:{position:"fixed"},textContent:t.map((e=>e.dataset.tag)).join(", ")});n.select();try{document.execCommand("copy"),e.target.dataset.text||(e.target.dataset.text=e.target.textContent),e.target.textContent="Copied "+t.length+" tags",setTimeout((()=>{e.target.textContent=e.target.dataset.text}),1e3)}catch(o){prompt("Copy to clipboard: Ctrl+C, Enter",text)}finally{document.body.removeChild(n)}}return e.unshift(_("button",{type:"button",textContent:"Copy Selected",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag--selected")])}}),_("button",{type:"button",textContent:"Copy All",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag")])}})),e}}const rf=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy kolorsLoader","easy hunyuanDiTLoader","easy pixArtLoader"],sf=["easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingLayerDiffusion","easy fullkSampler"],af=["KSamplerSelect","SamplerEulerAncestral","SamplerEulerAncestralCFG++","SamplerLMS","SamplerDPMPP_3M_SDE","SamplerDPMPP_2M_SDE","SamplerDPMPP_SDE","SamplerDPMAdaptative","SamplerLCMUpscale","SamplerTCD","SamplerTCD EulerA"],lf=["BasicScheduler","KarrasScheduler","ExponentialScheduler","PolyexponentialScheduler","VPScheduler","BetaSamplingScheduler","SDTurboScheduler","SplitSigmas","SplitSigmasDenoise","FlipSigmas","AlignYourStepsScheduler","GITSScheduler"],cf=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerLayerDiffusion"],uf=["easy controlnetLoader","easy controlnetLoaderADV","easy controlnetLoader++","easy instantIDApply","easy instantIDApplyADV"],df=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition","easy ipadapterApplyFromParams","easy pulIDApply","easy pulIDApplyADV"],pf=["easy positive","easy wildcards"],ff=["easy loadImageBase64","LoadImage","LoadImageMask"],hf=["easy applyBrushNet","easy applyPowerPaint","easy applyInpaint"],mf={positive_prompt:{text:"positive",positive:"text"},loaders:{ckpt_name:"ckpt_name",vae_name:"vae_name",clip_skip:"clip_skip",lora_name:"lora_name",resolution:"resolution",empty_latent_width:"empty_latent_width",empty_latent_height:"empty_latent_height",positive:"positive",negative:"negative",batch_size:"batch_size",a1111_prompt_style:"a1111_prompt_style"},preSampling:{steps:"steps",cfg:"cfg",cfg_scale_min:"cfg",sampler_name:"sampler_name",scheduler:"scheduler",denoise:"denoise",seed_num:"seed_num",seed:"seed"},kSampler:{image_output:"image_output",save_prefix:"save_prefix",link_id:"link_id"},controlnet:{control_net_name:"control_net_name",strength:["strength","cn_strength"],scale_soft_weights:["scale_soft_weights","cn_soft_weights"],cn_strength:["strength","cn_strength"],cn_soft_weights:["scale_soft_weights","cn_soft_weights"]},ipadapter:{preset:"preset",lora_strength:"lora_strength",provider:"provider",weight:"weight",weight_faceidv2:"weight_faceidv2",start_at:"start_at",end_at:"end_at",cache_mode:"cache_mode",use_tiled:"use_tiled",insightface:"insightface",pulid_file:"pulid_file"},load_image:{image:"image",base64_data:"base64_data",channel:"channel"},inpaint:{dtype:"dtype",fitting:"fitting",function:"function",scale:"scale",start_at:"start_at",end_at:"end_at"},sampler:{},sigmas:{}},gf={loaders:{optional_lora_stack:"optional_lora_stack",positive:"positive",negative:"negative"},preSampling:{pipe:"pipe",image_to_latent:"image_to_latent",latent:"latent"},kSampler:{pipe:"pipe",model:"model"},controlnet:{pipe:"pipe",image:"image",image_kps:"image_kps",control_net:"control_net",positive:"positive",negative:"negative",mask:"mask"},positive_prompt:{},ipadapter:{model:"model",image:"image",image_style:"image",attn_mask:"attn_mask",optional_ipadapter:"optional_ipadapter"},inpaint:{pipe:"pipe",image:"image",mask:"mask"},sampler:{},sigmas:{}},vf={loaders:{pipe:"pipe",model:"model",vae:"vae",clip:null,positive:null,negative:null,latent:null},preSampling:{pipe:"pipe"},kSampler:{pipe:"pipe",image:"image"},controlnet:{pipe:"pipe",positive:"positive",negative:"negative"},positive_prompt:{text:"positive",positive:"text"},load_image:{IMAGE:"IMAGE",MASK:"MASK"},ipadapter:{model:"model",tiles:"tiles",masks:"masks",ipadapter:"ipadapter"},inpaint:{pipe:"pipe"},sampler:{SAMPLER:"SAMPLER"},sigmas:{SIGMAS:"SIGMAS"}};function yf(e,t,n){return function(){!function(e,t,n){const o=LiteGraph.createNode(t);if(o){if(y.graph.add(o),o.pos=e.pos.slice(),o.size=e.size.slice(),e.widgets.forEach((e=>{if(mf[n][e.name]){const i=mf[n][e.name];if(i){const n=(t=i,o.widgets.find((e=>"object"==typeof t?t.includes(e.name):e.name===t)));n&&(n.value=e.value,"seed_num"==e.name&&(n.linkedWidgets[0].value=e.linkedWidgets[0].value),"converted-widget"==e.type&&Cf(o,n,e))}}var t})),e.inputs&&e.inputs.forEach(((t,i)=>{if(t&&t.link&&gf[n][t.name]){const i=gf[n][t.name];if(null===i)return;const r=o.findInputSlot(i);if(-1!==r){const n=e.graph.links[t.link];if(n){const t=e.graph.getNodeById(n.origin_id);t&&t.connect(n.origin_slot,o,r)}}}})),e.outputs&&e.outputs.forEach(((t,i)=>{if(t&&t.links&&vf[n]&&vf[n][t.name]){const i=vf[n][t.name];if(null===i)return;const r=o.findOutputSlot(i);-1!==r&&t.links.forEach((t=>{const n=e.graph.links[t];if(n){const t=e.graph.getNodeById(n.target_id);t&&o.connect(r,t,n.target_slot)}}))}})),y.graph.remove(e),"easy fullkSampler"==o.type){const e=o.outputs[0].links;if(e&&e[0]){const t=y.graph._nodes.find((t=>t.inputs&&t.inputs[0]&&t.inputs[0].link==e[0]));t&&y.graph.remove(t)}}else if(sf.includes(o.type)){const e=o.outputs[0].links;if(!e||!e[0]){const e=LiteGraph.createNode("easy kSampler");y.graph.add(e),e.pos=o.pos.slice(),e.pos[0]=e.pos[0]+o.size[0]+20;const t=o.findInputSlot("pipe");-1!==t&&o&&o.connect(0,e,t)}}o.setSize([o.size[0],o.computeSize()[1]])}}(e,t,n)}}const bf=(e,t)=>{const n=e.prototype.getExtraMenuOptions;e.prototype.getExtraMenuOptions=function(){const e=n.apply(this,arguments);return t.apply(this,arguments),e}},_f=(e,t,n,o,i=!0)=>{bf(o,(function(o,r){r.unshift({content:e,has_submenu:i,callback:(e,o,i,r,s)=>wf(e,o,i,r,s,t,n)}),"loaders"==t&&(r.unshift({content:V("💎 View Lora Info..."),callback:(e,t,n,o,i)=>{let r=i.widgets.find((e=>"lora_name"==e.name)).value;r&&"None"!=r&&new of(r).show("loras",r)}}),r.unshift({content:V("💎 View Checkpoint Info..."),callback:(e,t,n,o,i)=>{let r=i.widgets[0].value;r&&"None"!=r&&new nf(r).show("checkpoints",r)}}))}))},wf=(e,t,n,o,i,r,s)=>{const a=[];return s.map((e=>{i.type!==e&&a.push({content:`${e}`,callback:yf(i,e,r)})})),new LiteGraph.ContextMenu(a,{event:n,callback:null,parentMenu:o,node:i}),!1},Sf="converted-widget",xf=Symbol();function kf(e,t,n=""){if(t.origType=t.type,t.origComputeSize=t.computeSize,t.origSerializeValue=t.serializeValue,t.computeSize=()=>[0,-4],t.type=Sf+n,t.serializeValue=()=>{if(!e.inputs)return;let n=e.inputs.find((e=>{var n;return(null==(n=e.widget)?void 0:n.name)===t.name}));return n&&n.link?t.origSerializeValue?t.origSerializeValue():t.value:void 0},t.linkedWidgets)for(const o of t.linkedWidgets)kf(e,o,":"+t.name)}function Cf(e,t,n){kf(e,t);const{type:o}=function(e){let t=e[0];t instanceof Array&&(t="COMBO");return{type:t}}(n),i=e.size;t.options&&t.options.forceInput||e.addInput(t.name,o,{widget:{name:t.name,[xf]:()=>n}});for(const r of e.widgets)r.last_y+=LiteGraph.NODE_SLOT_HEIGHT;e.setSize([Math.max(i[0],e.size[0]),Math.max(i[1],e.size[1])])}const Af=function(e){var t,n,o,i;const r=e.constructor.type,s=e.properties.origVals||{},a=s.title||e.title,l=s.color||e.color,c=s.bgcolor||e.bgcolor,u=e,d={size:[...e.size],color:l,bgcolor:c,pos:[...e.pos]};let p=[],f=[];if(e.inputs)for(const y of e.inputs)if(y.link){const t=y.name,n=e.findInputSlot(t),o=e.getInputNode(n),i=e.getInputLink(n);p.push([i.origin_slot,o,t])}if(e.outputs)for(const y of e.outputs)if(y.links){const e=y.name;for(const t of y.links){const n=graph.links[t],o=graph._nodes_by_id[n.target_id];f.push([e,o,n.target_slot])}}y.graph.remove(e);const h=y.graph.add(LiteGraph.createNode(r,a,d));function m(){if(u.widgets)for(let e of u.widgets)if("converted-widget"===e.type){const t=h.widgets.find((t=>t.name===e.name));for(let n of u.inputs)n.name===e.name&&Cf(h,t,n.widget)}for(let e of p){const[t,n,o]=e;n.connect(t,h.id,o)}for(let e of f){const[t,n,o]=e;h.connect(t,n,o)}}let g=u.widgets_values;if(!g&&(null==(t=h.widgets)?void 0:t.length)>0)return h.widgets.forEach(((e,t)=>{const n=u.widgets[t];e.name===n.name&&e.type===n.type&&(e.value=n.value)})),void m();const v=(null==g?void 0:g.length)<=(null==(n=h.widgets)?void 0:n.length);let b=v?0:g.length-1;function _(e,t){var n,o,i,r,s,a;if(!0===e||!1===e){if((null==(n=t.options)?void 0:n.on)&&(null==(o=t.options)?void 0:o.off))return{value:e,pass:!0}}else if("number"==typeof e){if((null==(i=t.options)?void 0:i.min)<=e&&e<=(null==(r=t.options)?void 0:r.max))return{value:e,pass:!0}}else{if(null==(a=null==(s=t.options)?void 0:s.values)?void 0:a.includes(e))return{value:e,pass:!0};if(t.inputEl&&"string"==typeof e)return{value:e,pass:!0}}return{value:t.value,pass:!1}}const w=e=>{var t;const n=u.widgets[e];let o=h.widgets[e];if(o.name===n.name&&o.type===n.type){for(;v?b=0;){let{value:e,pass:t}=_(g[b],o);if(t&&null!==e){o.value=e;break}b+=v?1:-1}b++,v||(b=g.length-((null==(t=h.widgets)?void 0:t.length)-1-e))}};if(v&&(null==(o=h.widgets)?void 0:o.length)>0)for(let y=0;y0)for(let y=h.widgets.length-1;y>=0;y--)w(y);m()};y.registerExtension({name:"Comfy.EasyUse.ExtraMenu",async beforeRegisterNodeDef(e,t,n){bf(e,(function(e,n){n.unshift({content:V("🔃 Reload Node"),callback:(e,t,n,o,i)=>{let r=LGraphCanvas.active_canvas;if(!r.selected_nodes||Object.keys(r.selected_nodes).length<=1)Af(i);else for(let s in r.selected_nodes)Af(r.selected_nodes[s])}}),"easy ckptNames"==t.name&&n.unshift({content:V("💎 View Checkpoint Info..."),callback:(e,t,n,o,i)=>{i.widgets[0].value}})})),pf.includes(t.name)&&_f("↪️ Swap EasyPrompt","positive_prompt",pf,e),rf.includes(t.name)&&_f("↪️ Swap EasyLoader","loaders",rf,e),sf.includes(t.name)&&_f("↪️ Swap EasyPreSampling","preSampling",sf,e),cf.includes(t.name)&&_f("↪️ Swap EasyKSampler","preSampling",cf,e),af.includes(t.name)&&_f("↪️ Swap Custom Sampler","sampler",af,e),lf.includes(t.name)&&_f("↪️ Swap Custom Sigmas","sigmas",lf,e),uf.includes(t.name)&&_f("↪️ Swap EasyControlnet","controlnet",uf,e),df.includes(t.name)&&_f("↪️ Swap EasyAdapater","ipadapter",df,e),ff.includes(t.name)&&_f("↪️ Swap LoadImage","load_image",ff,e),hf.includes(t.name)&&_f("↪️ Swap InpaintNode","inpaint",hf,e)}});const Ef="➡️";y.registerExtension({name:"easy setNode",registerCustomNodes(){class e{constructor(){v(this,"defaultVisibility",!0),v(this,"serialize_widgets",!0),this.properties||(this.properties={previousName:""}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("text","Constant","",((e,n,o,i,r)=>{t.validateName(t.graph),""!==this.widgets[0].value&&(this.title=Ef+this.widgets[0].value),this.update(),this.properties.previousName=this.widgets[0].value}),{}),this.addInput("*","*"),this.onConnectionsChange=function(e,n,o,i,r){if(1!=e||o||(this.inputs[n].type="*",this.inputs[n].name="*",this.title="Set"),i&&t.graph&&1==e&&o){const e=t.graph._nodes.find((e=>e.id==i.origin_id)).outputs[i.origin_slot],n=e.type,o=t.is_auto_link?this.widgets[0].value:e.name;"Set"===this.title&&(this.title=Ef+o,this.widgets[0].value=o),"*"===this.widgets[0].value&&(this.widgets[0].value=o),this.validateName(t.graph),this.inputs[0].type=n,this.inputs[0].name=o,setTimeout((e=>{this.title=Ef+this.widgets[0].value}),1)}this.update()},this.validateName=function(e){let n=t.widgets[0].value;if(""!=n){let o=0,i=[];do{i=e._nodes.filter((e=>e!=this&&("easy setNode"==e.type&&e.widgets[0].value===n))),i.length>0&&(n=t.widgets[0].value+o),o++}while(i.length>0);t.widgets[0].value=n,this.update()}},this.clone=function(){const t=e.prototype.clone.apply(this);return t.inputs[0].name="*",t.inputs[0].type="*",t.properties.previousName="",t.size=t.computeSize(),t},this.onAdded=function(e){this.validateName(e)},this.update=function(){if(t.graph){this.findGetters(t.graph).forEach((e=>{e.setType(this.inputs[0].type)})),this.widgets[0].value&&this.findGetters(t.graph,!0).forEach((e=>{e.setName(this.widgets[0].value)}));t.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues()}))}},this.findGetters=function(e,t){const n=t?this.properties.previousName:this.widgets[0].value;return e._nodes.filter((e=>"easy getNode"==e.type&&e.widgets[0].value===n&&""!=n))},this.isVirtualNode=!0}onRemoved(){this.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues([this])}))}}LiteGraph.registerNodeType("easy setNode",Object.assign(e,{title:"Set"})),e.category="EasyUse/Util"}}),y.registerExtension({name:"easy getNode",registerCustomNodes(){class e{constructor(){v(this,"defaultVisibility",!0),v(this,"serialize_widgets",!0),this.properties||(this.properties={}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("combo","Constant","",(e=>{this.onRename()}),{values:()=>t.graph._nodes.filter((e=>"easy setNode"==e.type)).map((e=>e.widgets[0].value)).sort()}),this.addOutput("*","*"),this.onConnectionsChange=function(e,t,n,o,i){this.validateLinks(),2!=e||n?(this.onRename(),setTimeout((e=>{this.title="⬅️"+this.widgets[0].value}),1)):(this.outputs[t].type="*",this.outputs[t].name="*",this.title="Get")},this.setName=function(e){t.widgets[0].value=e,t.onRename(),t.serialize()},this.onRename=function(e=0){const n=this.findSetter(t.graph);if(n){const t=n.inputs[0].type,o=n.inputs[0].name;this.setType(t,o),this.outputs[e].type=t,this.outputs[e].name=o,this.title="⬅️"+n.widgets[0].value}else this.setType("*","*"),this.outputs[e].type="*",this.outputs[e].name="*"},this.clone=function(){const t=e.prototype.clone.apply(this);return t.size=t.computeSize(),t},this.validateLinks=function(){"*"!=this.outputs[0].type&&this.outputs[0].links&&this.outputs[0].links.forEach((e=>{const n=t.graph.links[e];n&&n.type!=this.outputs[0].type&&"*"!=n.type&&t.graph.removeLink(e)}))},this.setType=function(e,t){this.outputs[0].name=t,this.outputs[0].type=e,this.validateLinks()},this.findSetter=function(e){const t=this.widgets[0].value;return e._nodes.find((e=>"easy setNode"==e.type&&e.widgets[0].value===t&&""!=t))},this.isVirtualNode=!0}getInputLink(e){const t=this.findSetter(this.graph);if(t){const n=t.inputs[e];return this.graph.links[n.link]}throw new Error("No setter found for "+this.widgets[0].value+"("+this.type+")")}onAdded(e){}}LiteGraph.registerNodeType("easy getNode",Object.assign(e,{title:"Get"})),e.category="EasyUse/Util"}}),b.addEventListener("easyuse-global-seed",(function(e){let t=app.graph._nodes_by_id;for(let n in t){let o=t[n];if("easy globalSeed"==o.type){if(o.widgets){const t=o.widgets.find((e=>"value"==e.name));o.widgets.find((e=>"last_seed"==e.name)).value=t.value,t.value=e.detail.value}}else if(o.widgets){const t=o.widgets.find((e=>"seed_num"==e.name||"seed"==e.name||"noise_seed"==e.name));t&&null!=e.detail.seed_map[o.id]&&(t.value=e.detail.seed_map[o.id])}}}));const Of=b.queuePrompt;b.queuePrompt=async function(e,{output:t,workflow:n}){n.seed_widgets={};for(let o in app.graph._nodes_by_id){let e=app.graph._nodes_by_id[o].widgets;if(e)for(let t in e)"seed_num"!=e[t].name&&"seed"!=e[t].name&&"noise_seed"!=e[t].name||"converted-widget"==e[t].type||(n.seed_widgets[o]=parseInt(t))}return await Of.call(b,e,{output:t,workflow:n})};const Lf=["easy imageSave","easy fullkSampler","easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo","easy detailerFix"];y.registerExtension({name:"Comfy.EasyUse.SaveImageExtraOutput",async beforeRegisterNodeDef(e,t,n){if(Lf.includes(t.name)){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0,o=this.widgets.find((e=>"filename_prefix"===e.name||"save_prefix"===e.name));return o.serializeValue=()=>x(n,o.value),e}}else{const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0;return this.properties&&"Node name for S&R"in this.properties||this.addProperty("Node name for S&R",this.constructor.type,"string"),e}}}});const Tf=["easy wildcards","easy positive","easy negative","easy stylesSelector","easy promptConcat","easy promptReplace"],If=["easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingDynamicCFG","easy preSamplingSdTurbo","easy preSamplingLayerDiffusion"],Nf=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo"],Pf=["easy controlnetLoader","easy controlnetLoaderADV"],Df=["easy instantIDApply","easy instantIDApplyADV"],jf=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition"],Mf=["easy pipeIn","easy pipeOut","easy pipeEdit"],Rf=["easy XYPlot","easy XYPlotAdvanced"],$f=["easy setNode"],Gf=["Reroute","RescaleCFG","LoraLoaderModelOnly","LoraLoader","FreeU","FreeU_v2",...jf,...$f],Bf={"easy seed":{from:{INT:["Reroute",...If,"easy fullkSampler"]}},"easy positive":{from:{STRING:["Reroute",...Tf]}},"easy negative":{from:{STRING:["Reroute",...Tf]}},"easy wildcards":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy stylesSelector":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy promptConcat":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy promptReplace":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy fullLoader":{from:{PIPE_LINE:["Reroute",...If,"easy fullkSampler",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy a1111Loader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy comfyLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy hunyuanDiTLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy kolorsLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy pixArtLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy svdLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy zero123Loader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy sv3dLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy preSampling":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingAdvanced":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingDynamicCFG":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingCustom":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingLayerDiffusion":{from:{PIPE_LINE:["Reroute","easy kSamplerLayerDiffusion",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingNoiseIn":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy fullkSampler":{from:{PIPE_LINE:["Reroute",...Mf.reverse(),"easy preDetailerFix","easy preMaskDetailerFix",...If,...$f]}},"easy kSampler":{from:{PIPE_LINE:["Reroute",...Mf.reverse(),"easy preDetailerFix","easy preMaskDetailerFix","easy hiresFix",...If,...$f]}},"easy controlnetLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f]}},"easy controlnetLoaderADV":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f]}},"easy instantIDApply":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{COMBO:["Reroute","easy promptLine"]}},"easy instantIDApplyADV":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApply":{to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApplyADV":{to:{STRING:["Reroute","easy sliderControl",...Tf],COMBO:["Reroute","easy promptLine"]}},"easy ipadapterStyleComposition":{to:{COMBO:["Reroute","easy promptLine"]}},"easy preDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Mf,...$f]},to:{PIPE_LINE:["Reroute","easy ultralyticsDetectorPipe","easy samLoaderPipe","easy kSampler","easy fullkSampler"]}},"easy preMaskDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Mf,...$f]}},"easy samLoaderPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Mf,...$f]}},"easy ultralyticsDetectorPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Mf,...$f]}},"easy cascadeLoader":{from:{PIPE_LINE:["Reroute","easy fullCascadeKSampler","easy preSamplingCascade",...Pf,...Mf,...$f],MODEL:Gf.filter((e=>!jf.includes(e)))}},"easy fullCascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Mf,...$f]}},"easy preSamplingCascade":{from:{PIPE_LINE:["Reroute","easy cascadeKSampler",...Mf,...$f]}},"easy cascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Mf,...$f]}}};y.registerExtension({name:"Comfy.EasyUse.Suggestions",async setup(e){LGraphCanvas.prototype.createDefaultNodeForSlot=function(e){e=e||{};var t,n=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,position:[],nodeType:null,posAdd:[0,0],posSizeFix:[0,0]},e),o=n.nodeFrom&&null!==n.slotFrom,i=!o&&n.nodeTo&&null!==n.slotTo;if(!o&&!i)return!1;if(!n.nodeType)return!1;var r=o?n.nodeFrom:n.nodeTo,s=o?n.slotFrom:n.slotTo,a=r.type,l=!1;switch(typeof s){case"string":l=o?r.findOutputSlot(s,!1):r.findInputSlot(s,!1),s=o?r.outputs[s]:r.inputs[s];break;case"object":l=o?r.findOutputSlot(s.name):r.findInputSlot(s.name);break;case"number":l=s,s=o?r.outputs[s]:r.inputs[s];break;default:return!1}var c=s.type==LiteGraph.EVENT?"_event_":s.type,u=o?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in;if(u&&u[c]){s.link;let e=!1;const i=o?"from":"to";if(Bf[a]&&Bf[a][i]&&(null==(t=Bf[a][i][c])?void 0:t.length)>0){for(var d in Bf[a][i][c])if(n.nodeType==Bf[a][i][c][d]||"AUTO"==n.nodeType){e=Bf[a][i][c][d];break}}else if("object"==typeof u[c]||"array"==typeof u[c]){for(var d in u[c])if(n.nodeType==u[c][d]||"AUTO"==n.nodeType){e=u[c][d];break}}else n.nodeType!=u[c]&&"AUTO"!=n.nodeType||(e=u[c]);if(e){var p=!1;"object"==typeof e&&e.node&&(p=e,e=e.node);var f=LiteGraph.createNode(e);if(f){if(p){if(p.properties)for(var h in p.properties)f.addProperty(h,p.properties[h]);if(p.inputs)for(var h in f.inputs=[],p.inputs)f.addOutput(p.inputs[h][0],p.inputs[h][1]);if(p.outputs)for(var h in f.outputs=[],p.outputs)f.addOutput(p.outputs[h][0],p.outputs[h][1]);p.title&&(f.title=p.title),p.json&&f.configure(p.json)}return this.graph.add(f),f.pos=[n.position[0]+n.posAdd[0]+(n.posSizeFix[0]?n.posSizeFix[0]*f.size[0]:0),n.position[1]+n.posAdd[1]+(n.posSizeFix[1]?n.posSizeFix[1]*f.size[1]:0)],o?n.nodeFrom.connectByType(l,f,c):n.nodeTo.connectByTypeOutput(l,f,c),!0}}}return!1},LGraphCanvas.prototype.showConnectionMenu=function(e){e=e||{};var t,n=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,e:null},e),o=this,i=n.nodeFrom&&n.slotFrom,r=!i&&n.nodeTo&&n.slotTo;if(!i&&!r)return!1;var s=i?n.nodeFrom:n.nodeTo,a=i?n.slotFrom:n.slotTo,l=!1;switch(typeof a){case"string":l=i?s.findOutputSlot(a,!1):s.findInputSlot(a,!1),a=i?s.outputs[a]:s.inputs[a];break;case"object":l=i?s.findOutputSlot(a.name):s.findInputSlot(a.name);break;case"number":l=a,a=i?s.outputs[a]:s.inputs[a];break;default:return!1}var c=["Add Node",null];o.allow_searchbox&&(c.push("Search"),c.push(null));var u=a.type==LiteGraph.EVENT?"_event_":a.type,d=i?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in,p=s.type;if(d&&d[u]){const e=i?"from":"to";if(Bf[p]&&Bf[p][e]&&(null==(t=Bf[p][e][u])?void 0:t.length)>0)for(var f in Bf[p][e][u])c.push(Bf[p][e][u][f]);else if("object"==typeof d[u]||"array"==typeof d[u])for(var f in d[u])c.push(d[u][f]);else c.push(d[u])}var h=new LiteGraph.ContextMenu(c,{event:n.e,title:(a&&""!=a.name?a.name+(u?" | ":""):"")+(a&&u?u:""),callback:function(e,t,r){switch(e){case"Add Node":LGraphCanvas.onMenuAdd(null,null,r,h,(function(e){i?n.nodeFrom.connectByType(l,e,u):n.nodeTo.connectByTypeOutput(l,e,u)}));break;case"Search":i?o.showSearchBox(r,{node_from:n.nodeFrom,slot_from:a,type_filter_in:u}):o.showSearchBox(r,{node_to:n.nodeTo,slot_from:a,type_filter_out:u});break;default:o.createDefaultNodeForSlot(Object.assign(n,{position:[n.e.canvasX,n.e.canvasY],nodeType:e}))}}});return!1}}}),y.registerExtension({name:"Comfy.EasyUse.TimeTaken",setup(){const e=new Map;let t=0;b.addEventListener("executing",(n=>{if(!A("EasyUse.Nodes.Runtime",null,!0))return;const o=(null==n?void 0:n.node)||(null==n?void 0:n.detail)||null,i=Cp(o);i&&(i.executionDuration="");const r=e.get(t);if(e.delete(t),t&&r){const e=Date.now()-r,n=Cp(t);n&&(n.executionDuration=`${(e/1e3).toFixed(2)}${V("s")}`)}t=o,e.set(o,Date.now())}))},beforeRegisterNodeDef(e,t){const n=e.prototype.onDrawForeground;e.prototype.onDrawForeground=function(...e){const[t]=e;return function(e,t){if(!t)return;e.save(),e.fillStyle=LiteGraph.NODE_DEFAULT_BGCOLOR,function(e,t,n,o,i,r){e.beginPath(),e.moveTo(t+r,n),e.lineTo(t+o-r,n),e.arcTo(t+o,n,t+o,n+r,r),e.lineTo(t+o,n+i-r),e.arcTo(t+o,n+i,t+o-r,n+i,r),e.lineTo(t+r,n+i),e.arcTo(t,n+i,t,n+i-r,r),e.lineTo(t,n+r),e.arcTo(t,n,t+r,n,r),e.closePath()}(e,0,-LiteGraph.NODE_TITLE_HEIGHT-20,e.measureText(t).width+10,LiteGraph.NODE_TITLE_HEIGHT-10,4),e.fill(),function(e,t,n,o,i="#000",r=12,s="Inter"){e.font=`${r}px ${s}`,e.fillStyle=i,e.fillText(t,n,o)}(e,t,8,-LiteGraph.NODE_TITLE_HEIGHT-6,LiteGraph.NODE_TITLE_COLOR),e.restore()}(t,this.executionDuration||""),null==n?void 0:n.apply(this,e)}}});const Ff="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function Uf(e,t,n,o){e.addEventListener?e.addEventListener(t,n,o):e.attachEvent&&e.attachEvent("on".concat(t),n)}function zf(e,t,n,o){e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent&&e.detachEvent("on".concat(t),n)}function Vf(e,t){const n=t.slice(0,t.length-1);for(let o=0;o=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}const Wf={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Ff?173:189,"=":Ff?61:187,";":Ff?59:186,"'":222,"[":219,"]":221,"\\":220},Yf={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Zf={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Kf={16:!1,18:!1,17:!1,91:!1},Xf={};for(let by=1;by<20;by++)Wf["f".concat(by)]=111+by;let Qf=[],Jf=null,qf="all";const eh=new Map,th=e=>Wf[e.toLowerCase()]||Yf[e.toLowerCase()]||e.toUpperCase().charCodeAt(0);function nh(e){qf=e||"all"}function oh(){return qf||"all"}function ih(e){if(void 0===e)Object.keys(Xf).forEach((e=>{Array.isArray(Xf[e])&&Xf[e].forEach((e=>rh(e))),delete Xf[e]})),ch(null);else if(Array.isArray(e))e.forEach((e=>{e.key&&rh(e)}));else if("object"==typeof e)e.key&&rh(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o{let{key:t,scope:n,method:o,splitKey:i="+"}=e;Hf(t).forEach((e=>{const t=e.split(i),r=t.length,s=t[r-1],a="*"===s?"*":th(s);if(!Xf[a])return;n||(n=oh());const l=r>1?Vf(Yf,t):[],c=[];Xf[a]=Xf[a].filter((e=>{const t=(!o||e.method===o)&&e.scope===n&&function(e,t){const n=e.length>=t.length?e:t,o=e.length>=t.length?t:e;let i=!0;for(let r=0;rch(e)))}))};function sh(e,t,n,o){if(t.element!==o)return;let i;if(t.scope===n||"all"===t.scope){i=t.mods.length>0;for(const e in Kf)Object.prototype.hasOwnProperty.call(Kf,e)&&(!Kf[e]&&t.mods.indexOf(+e)>-1||Kf[e]&&-1===t.mods.indexOf(+e))&&(i=!1);(0!==t.mods.length||Kf[16]||Kf[18]||Kf[17]||Kf[91])&&!i&&"*"!==t.shortcut||(t.keys=[],t.keys=t.keys.concat(Qf),!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function ah(e,t){const n=Xf["*"];let o=e.keyCode||e.which||e.charCode;if(!lh.filter.call(this,e))return;if(93!==o&&224!==o||(o=91),-1===Qf.indexOf(o)&&229!==o&&Qf.push(o),["ctrlKey","altKey","shiftKey","metaKey"].forEach((t=>{const n=Zf[t];e[t]&&-1===Qf.indexOf(n)?Qf.push(n):!e[t]&&Qf.indexOf(n)>-1?Qf.splice(Qf.indexOf(n),1):"metaKey"===t&&e[t]&&3===Qf.length&&(e.ctrlKey||e.shiftKey||e.altKey||(Qf=Qf.slice(Qf.indexOf(n))))})),o in Kf){Kf[o]=!0;for(const e in Yf)Yf[e]===o&&(lh[e]=!0);if(!n)return}for(const a in Kf)Object.prototype.hasOwnProperty.call(Kf,a)&&(Kf[a]=e[Zf[a]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===Qf.indexOf(17)&&Qf.push(17),-1===Qf.indexOf(18)&&Qf.push(18),Kf[17]=!0,Kf[18]=!0);const i=oh();if(n)for(let a=0;a1&&(i=Vf(Yf,e)),(e="*"===(e=e[e.length-1])?"*":th(e))in Xf||(Xf[e]=[]),Xf[e].push({keyup:l,keydown:c,scope:r,mods:i,shortcut:o[a],method:n,key:o[a],splitKey:u,element:s});if(void 0!==s&&window){if(!eh.has(s)){const e=function(){return ah(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event,s)},t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event;ah(e,s),function(e){let t=e.keyCode||e.which||e.charCode;const n=Qf.indexOf(t);if(n>=0&&Qf.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&Qf.splice(0,Qf.length),93!==t&&224!==t||(t=91),t in Kf){Kf[t]=!1;for(const e in Yf)Yf[e]===t&&(lh[e]=!1)}}(e)};eh.set(s,{keydownListener:e,keyupListenr:t,capture:d}),Uf(s,"keydown",e,d),Uf(s,"keyup",t,d)}if(!Jf){const e=()=>{Qf=[]};Jf={listener:e,capture:d},Uf(window,"focus",e,d)}}}function ch(e){const t=Object.values(Xf).flat();if(t.findIndex((t=>{let{element:n}=t;return n===e}))<0){const{keydownListener:t,keyupListenr:n,capture:o}=eh.get(e)||{};t&&n&&(zf(e,"keyup",n,o),zf(e,"keydown",t,o),eh.delete(e))}if(t.length<=0||eh.size<=0){if(Object.keys(eh).forEach((e=>{const{keydownListener:t,keyupListenr:n,capture:o}=eh.get(e)||{};t&&n&&(zf(e,"keyup",n,o),zf(e,"keydown",t,o),eh.delete(e))})),eh.clear(),Object.keys(Xf).forEach((e=>delete Xf[e])),Jf){const{listener:e,capture:t}=Jf;zf(window,"focus",e,t),Jf=null}}}const uh={getPressedKeyString:function(){return Qf.map((e=>{return t=e,Object.keys(Wf).find((e=>Wf[e]===t))||(e=>Object.keys(Yf).find((t=>Yf[t]===e)))(e)||String.fromCharCode(e);var t}))},setScope:nh,getScope:oh,deleteScope:function(e,t){let n,o;e||(e=oh());for(const i in Xf)if(Object.prototype.hasOwnProperty.call(Xf,i))for(n=Xf[i],o=0;o{let{element:t}=e;return ch(t)}))}else o++;oh()===e&&nh(t||"all")},getPressedKeyCodes:function(){return Qf.slice(0)},getAllKeyCodes:function(){const e=[];return Object.keys(Xf).forEach((t=>{Xf[t].forEach((t=>{let{key:n,scope:o,mods:i,shortcut:r}=t;e.push({scope:o,shortcut:r,mods:i,keys:n.split("+").map((e=>th(e)))})}))})),e},isPressed:function(e){return"string"==typeof e&&(e=th(e)),-1!==Qf.indexOf(e)},filter:function(e){const t=e.target||e.srcElement,{tagName:n}=t;let o=!0;const i="INPUT"===n&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(i||"TEXTAREA"===n||"SELECT"===n)&&!t.readOnly)&&(o=!1),o},trigger:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(Xf).forEach((n=>{Xf[n].filter((n=>n.scope===t&&n.shortcut===e)).forEach((e=>{e&&e.method&&e.method()}))}))},unbind:ih,keyMap:Wf,modifier:Yf,modifierMap:Zf};for(const by in uh)Object.prototype.hasOwnProperty.call(uh,by)&&(lh[by]=uh[by]);if("undefined"!=typeof window){const e=window.hotkeys;lh.noConflict=t=>(t&&window.hotkeys===lh&&(window.hotkeys=e),lh),window.hotkeys=lh}let dh=null;y.registerExtension({name:"Comfy.EasyUse.HotKeys",setup(){if(void 0!==lh){lh("up,down,left,right",(function(e,t){var n,o,i,r,s,a,l,c,u,d,p,f,h,m,g;e.preventDefault();if(!A("EasyUse.Hotkeys.JumpNearestNodes",null,!0))return;const v=Ap();if(0===v.length)return;const y=v[0];switch(t.key){case"up":case"left":let e=null;if(Np(y)){const e=null==(n=y.widgets_values)?void 0:n[0],t=null==(o=y.graph)?void 0:o._nodes,i=null==t?void 0:t.find((t=>{var n;if(Pp(t)){if((null==(n=t.widgets_values)?void 0:n[0])===e)return t}return null}));i&&Op(i)}else if((null==(i=y.inputs)?void 0:i.length)>0){for(let t=0;t{var n;if(Np(t)){if((null==(n=t.widgets_values)?void 0:n[0])===e)return t}return null}));n&&Op(n)}else if((null==(d=y.outputs)?void 0:d.length)>0){for(let e=0;e0&&y.outputs[e].links[0]){t=y.outputs[e].links[0];break}if(t){const e=null==(f=y.graph)?void 0:f.links;if(e[t]){const n=null==(h=e[t])?void 0:h.target_id,o=null==(g=null==(m=y.graph)?void 0:m._nodes_by_id)?void 0:g[n];o&&Op(o)}}}}})),lh("shift+up,shift+down,shift+left,shift+right",(function(e,t){e.preventDefault();if(!A("EasyUse.Hotkeys.AlignSelectedNodes",null,!0))return;const n=Ap();if(n.length<=1)return;const o=n;switch(t.key){case"shift+up":LGraphCanvas.alignNodes(o,"top",o[0]);break;case"shift+down":LGraphCanvas.alignNodes(o,"bottom",o[0]);break;case"shift+left":LGraphCanvas.alignNodes(o,"left",o[0]);break;case"shift+right":LGraphCanvas.alignNodes(o,"right",o[0])}dh||(dh=np()),dh&&dh.update()})),lh("shift+g",(function(e,t){e.preventDefault();A("EasyUse.Hotkeys.AddGroup",null,!0)&&(fh(),dh||(dh=np()),dh&&dh.update())}));const e=[];Array.from(Array(10).keys()).forEach((t=>e.push(`alt+${t}`))),lh(e.join(","),(async function(e,t){e.preventDefault();if(!A("EasyUse.Hotkeys.NodesTemplate",null,!0))return;const n=t.key;let o=parseInt(n.split("+")[1]);const i=await b.getUserData("comfy.templates.json");let r=null;if(200==i.status)try{r=await i.json()}catch(a){Fp.error(V("Get Node Templates File Failed"))}else localStorage["Comfy.NodeTemplates"]?r=JSON.parse(localStorage["Comfy.NodeTemplates"]):Fp.warn(V("No Node Templates Found"));if(!r)return void Fp.warn(V("No Node Templates Found"));o=0===o?9:o-1;const s=r[o];if(s)try{const e=(null==s?void 0:s.name)||"Group",t=(null==s?void 0:s.data)?JSON.parse(s.data):[];ph((async()=>{await k.registerFromWorkflow(t.groupNodes,{}),localStorage.litegrapheditor_clipboard=s.data,y.canvas.pasteFromClipboard(),t.groupNodes||fh(e)}))}catch(a){Fp.error(a)}else Fp.warn(V("Node template with {key} not set").replace("{key}",n))}));const t=async function(e){if(("b"===e.key||"m"==e.key)&&(e.metaKey||e.ctrlKey)){if(0===Ap().length)return;dh||(dh=np()),dh&&dh.update()}};window.addEventListener("keydown",t,!0)}}});const ph=async e=>{const t=localStorage.litegrapheditor_clipboard;await e(),localStorage.litegrapheditor_clipboard=t},fh=e=>{const t=Ap();if(0===t.length)return;const n=t;let o=new LiteGraph.LGraphGroup;o.title=e||"Group",((e,t=[],n=20)=>{var o,i,r,s,a,l,c,u,d,p;for(var f of(i=r=s=a=-1,l=c=u=d=-1,[e._nodes,t]))for(var h in f)l=(p=f[h]).pos[0],c=p.pos[1],u=p.pos[0]+p.size[0],d=p.pos[1]+p.size[1],"Reroute"!=p.type&&(c-=LiteGraph.NODE_TITLE_HEIGHT),(null==(o=p.flags)?void 0:o.collapsed)&&(d=c+LiteGraph.NODE_TITLE_HEIGHT,(null==p?void 0:p._collapsed_width)&&(u=l+Math.round(p._collapsed_width))),(-1==i||ls)&&(s=u),(-1==a||d>a)&&(a=d);r-=Math.round(1.4*e.font_size),e.pos=[i-n,r-n],e.size=[s-i+2*n,a-r+2*n]})(o,n),y.canvas.graph.add(o)};function hh(e,t,n,o){const i=[];return e.workflow.links.forEach((e=>{n&&e[1]===t&&!i.includes(e[3])&&i.push(e[3]),o&&e[3]===t&&!i.includes(e[1])&&i.push(e[1])})),i}async function mh(e,t=!1){const n=structuredClone(await y.graphToPrompt()),o=[];if(n.workflow.nodes.forEach((e=>{o.push(e.id)})),n.workflow.links=n.workflow.links.filter((e=>o.includes(e[1])&&o.includes(e[3]))),t)for(;!y.graph._nodes_by_id[e].isChooser;)e=hh(n,e,!0,!1)[0];const i=function(e,t){const n=[],o=[t];for(;o.length>0;){const t=o.pop();n.push(t),o.push(...hh(e,t,!0,!1).filter((e=>!(n.includes(e)||o.includes(e)))))}o.push(...n.filter((e=>e!=t)));const i=[t];for(;o.length>0;){const t=o.pop();i.push(t),o.push(...hh(e,t,!1,!0).filter((e=>!(i.includes(e)||o.includes(e)))))}const r=[];return r.push(...n),r.push(...i.filter((e=>!r.includes(e)))),r}(n,e);n.workflow.nodes=n.workflow.nodes.filter((t=>(t.id===e&&t.inputs.forEach((e=>{e.link=null})),i.includes(t.id)))),n.workflow.links=n.workflow.links.filter((e=>i.includes(e[1])&&i.includes(e[3])));const r={};for(const[l,c]of Object.entries(n.output))i.includes(parseInt(l))&&(r[l]=c);const s={};for(const[l,c]of Object.entries(r[e.toString()].inputs))Array.isArray(c)||(s[l]=c);r[e.toString()].inputs=s,n.output=r;const a=y.graphToPrompt;y.graphToPrompt=()=>(y.graphToPrompt=a,n),y.queuePrompt(0)}const gh=new class{constructor(){this.current_node_id=void 0,this.class_of_current_node=null,this.current_node_is_chooser=!1}update(){var e,t;return y.runningNodeId!=this.current_node_id&&(this.current_node_id=y.runningNodeId,this.current_node_id?(this.class_of_current_node=null==(t=null==(e=y.graph)?void 0:e._nodes_by_id[y.runningNodeId.toString()])?void 0:t.comfyClass,this.current_node_is_chooser="easy imageChooser"===this.class_of_current_node):(this.class_of_current_node=void 0,this.current_node_is_chooser=!1),!0)}},vh=class e{constructor(){}static idle(){return!y.runningNodeId}static paused(){return!0}static paused_here(t){return e.here(t)}static running(){return!e.idle()}static here(e){return y.runningNodeId==e}static state(){return"Paused"}};v(vh,"cancelling",!1);let yh=vh;function bh(e,t){const n=new FormData;n.append("message",t),n.append("id",e),b.fetchApi("/easyuse/image_chooser_message",{method:"POST",body:n})}function _h(){bh(-1,"__cancel__"),yh.cancelling=!0,b.interrupt(),yh.cancelling=!1}var wh=0;function Sh(){wh+=1}const xh=["easy kSampler","easy kSamplerTiled","easy fullkSampler"];function kh(e){const t=y.graph._nodes_by_id[e.detail.id];if(t){t.selected=new Set,t.anti_selected=new Set;const n=function(e,t){var n;return e.imgs=[],t.forEach((t=>{const n=new Image;e.imgs.push(n),n.onload=()=>{y.graph.setDirtyCanvas(!0)},n.src=`/view?filename=${encodeURIComponent(t.filename)}&type=temp&subfolder=${y.getPreviewFormatParam()}`})),null==(n=e.setSizeForImage)||n.call(e),e.imgs}(t,e.detail.urls);return{node:t,image:n,isKSampler:xh.includes(t.type)}}}function Ch(e,t,n){var o;if(e.imageRects)o=e.imageRects[t];else{const t=e.imagey;o=[1,t+1,e.size[0]-2,e.size[1]-t-2]}n.strokeRect(o[0]+1,o[1]+1,o[2]-2,o[3]-2)}class Ah extends w{constructor(){super(),this.node=null,this.select_index=[],this.dialog_div=null}show(e,t){this.select_index=[],this.node=t;const n=e.map(((e,n)=>{const o=_("img",{src:e.src,onclick:e=>{this.select_index.includes(n)?(this.select_index=this.select_index.filter((e=>e!==n)),o.classList.remove("selected")):(this.select_index.push(n),o.classList.add("selected")),t.selected.has(n)?t.selected.delete(n):t.selected.add(n)}});return o}));super.show(_("div.comfyui-easyuse-chooser-dialog",[_("h5.comfyui-easyuse-chooser-dialog-title",V("Choose images to continue")),_("div.comfyui-easyuse-chooser-dialog-images",n)]))}createButtons(){const e=super.createButtons();return e[0].onclick=e=>{yh.running()&&_h(),super.close()},e.unshift(_("button",{type:"button",textContent:V("Choose Selected Images"),onclick:e=>{bh(this.node.id,[...this.node.selected,-1,...this.node.anti_selected]),yh.idle()&&(Sh(),mh(this.node.id).then((()=>{bh(this.node.id,[...this.node.selected,-1,...this.node.anti_selected])}))),super.close()}})),e}}function Eh(){const e=y.graph._nodes_by_id[this.node_id];if(e){const t=[...e.selected];(null==t?void 0:t.length)>0&&e.setProperty("values",t),bh(e.id,[...e.selected,-1,...e.anti_selected]),yh.idle()&&(Sh(),mh(e.id).then((()=>{bh(e.id,[...e.selected,-1,...e.anti_selected])})))}}function Oh(){yh.running()&&_h()}function Lh(e){Object.defineProperty(e,"clicked",{get:function(){return this._clicked},set:function(e){this._clicked=e&&""!=this.name}})}function Th(e){e.options||(e.options={}),e.options.serialize=!1}y.registerExtension({name:"Comfy.EasyUse.imageChooser",init(){window.addEventListener("beforeunload",_h,!0)},setup(e){const t=LGraphCanvas.prototype.draw;LGraphCanvas.prototype.draw=function(){gh.update()&&e.graph._nodes.forEach((e=>{e.update&&e.update()})),t.apply(this,arguments)},b.addEventListener("easyuse-image-choose",(function(e){const{node:t,image:n,isKSampler:o}=kh(e);if(o){(new Ah).show(n,t)}}));const n=b.interrupt;b.interrupt=function(){yh.cancelling||_h(),n.apply(this,arguments)},b.addEventListener("execution_start",(function(){(wh>0?(wh-=1,0):(bh(-1,"__start__"),1))&&e.graph._nodes.forEach((e=>{(e.selected||e.anti_selected)&&(e.selected.clear(),e.anti_selected.clear(),e.update())}))}))},async nodeCreated(e,t){if("easy imageChooser"==e.comfyClass){e.setProperty("values",[]),void 0===(null==e?void 0:e.imageIndex)&&Object.defineProperty(e,"imageIndex",{get:function(){return null},set:function(t){e.overIndex=t}}),void 0===(null==e?void 0:e.imagey)&&Object.defineProperty(e,"imagey",{get:function(){return null},set:function(t){return e.widgets[e.widgets.length-1].last_y+LiteGraph.NODE_WIDGET_HEIGHT}});const t=e.onMouseDown;e.onMouseDown=function(n,o,i){if(n.isPrimary){const t=function(e,t){var n,o;if((null==(n=e.imgs)?void 0:n.length)>1)for(var i=0;i0&&n0&&oe.imagey)return 0;return-1}(e,o);t>=0&&this.imageClicked(t)}return t&&t.apply(this,arguments)},e.send_button_widget=e.addWidget("button","","",Eh),e.cancel_button_widget=e.addWidget("button","","",Oh),Lh(e.cancel_button_widget),Lh(e.send_button_widget),Th(e.cancel_button_widget),Th(e.send_button_widget)}},beforeRegisterNodeDef(e,t,n){if("easy imageChooser"==(null==t?void 0:t.name)){const t=e.prototype.onDrawBackground;e.prototype.onDrawBackground=function(e){t.apply(this,arguments),function(e,t){var n,o;if(e.imgs){if(e.imageRects)for(let n=0;n{Ch(e,n,t)})),t.strokeStyle="#F88",null==(o=null==e?void 0:e.anti_selected)||o.forEach((n=>{Ch(e,n,t)}))}}(this,e)},e.prototype.imageClicked=function(t){"easy imageChooser"===(null==e?void 0:e.comfyClass)&&(this.selected.has(t)?this.selected.delete(t):this.selected.add(t),this.update())};const n=e.prototype.update;e.prototype.update=function(){var e;if(n&&n.apply(this,arguments),this.send_button_widget){this.send_button_widget.node_id=this.id;const t=(this.selected?this.selected.size:0)+(this.anti_selected?this.anti_selected.size:0),n=(null==(e=this.imgs)?void 0:e.length)||0;yh.paused_here(this.id)&&t>0?this.send_button_widget.name=t>1?"Progress selected ("+t+"/"+n+")":"Progress selected image":this.send_button_widget.name=t>0?t>1?"Progress selected ("+t+"/"+n+")":"Progress selected image as restart":""}if(this.cancel_button_widget){const e=yh.running();this.cancel_button_widget.name=e?"Cancel current run":""}this.setDirtyCanvas(!0,!0)}}}}),Number.prototype.div=function(e){return function(e,t){let n,o,i=0,r=0,s="string"==typeof e?e:e.toString(),a="string"==typeof t?t:t.toString();try{i=s.toString().split(".")[1].length}catch(l){}try{r=a.toString().split(".")[1].length}catch(l){}return n=Number(s.toString().replace(".","")),o=Number(a.toString().replace(".","")),n/o*Math.pow(10,r-i)}(this,e)};let Ih=[],Nh=0;const Ph={sd3:6.5,"sd3-turbo":4};class Dh extends w{constructor(){super(),this.lists=[],this.dialog_div=null,this.user_div=null}addItem(e,t){return _("div.easyuse-account-dialog-item",[_("input",{type:"text",placeholder:"Enter name",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Ih[t].name=e.target.value},value:Ih[e].name}),_("input.key",{type:"text",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Ih[t].key=e.target.value},placeholder:"Enter APIKEY",value:Ih[e].key}),_("button.choose",{textContent:V("Choose"),onclick:async e=>{var n,o,i;const r=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);let s=Ih[r].name,a=Ih[r].key;if(!s)return void Fp.error(V("Please enter the account name"));if(!a)return void Fp.error(V("Please enter the APIKEY"));let l=!0;for(let t=0;t{(new Dh).show(t)}},[_("div.user",[_("div.avatar",r?[_("img",{src:r})]:"😀"),_("div.info",[_("h5.name",s),_("h6.remark","Credits: "+a)])]),_("div.edit",{textContent:V("Edit")})])),Fp.success(V("Save Succeed"))}else Fp.success(V("Save Succeed"));this.close()}else Fp.error(V("Save Failed"))}}),_("button.delete",{textContent:V("Delete"),onclick:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Ih.length<=1?Fp.error(V("At least one account is required")):(Ih.splice(t,1),this.dialog_div.removeChild(e.target.parentNode))}})])}show(e){Ih.forEach(((t,n)=>{this.lists.push(this.addItem(n,e))})),this.dialog_div=_("div.easyuse-account-dialog",this.lists),super.show(_("div.easyuse-account-dialog-main",[_("div",[_("a",{href:"https://platform.stability.ai/account/keys",target:"_blank",textContent:V("Getting Your APIKEY")})]),this.dialog_div]))}createButtons(){const e=super.createButtons();return e.unshift(_("button",{type:"button",textContent:V("Save Account Info"),onclick:e=>{let t=!0;for(let n=0;n{200==e.status?Fp.success(V("Save Succeed")):Fp.error(V("Save Failed"))}))}else Fp.error(V("APIKEY is not Empty"))}})),e.unshift(_("button",{type:"button",textContent:V("Add Account"),onclick:e=>{const t="Account "+Ih.length.toString();Ih.push({name:t,key:""});const n=this.addItem(Ih.length-1);this.lists.push(n),this.dialog_div.appendChild(n)}})),e}}y.registerExtension({name:"Comfy.EasyUse.API.SD3",async beforeRegisterNodeDef(e,t,n){if("easy stableDiffusion3API"==t.name){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=async function(){var e,n,o;t&&(null==t||t.apply(this,arguments));const i=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),r=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));let s=this.widgets.find((e=>"model"==e.name));s.callback=e=>{a.value="-"+Ph[e]};const a=this.addWidget("text","cost_credit","0",(e=>{}),{serialize:!1});a.disabled=!0,setTimeout((e=>{"control_before_generate"==r.name&&0===i.value&&(i.value=Math.floor(4294967294*Math.random())),a.value="-"+Ph[s.value]}),100);let l=_("div.easyuse-account-user",[V("Loading UserInfo...")]);this.addDOMWidget("account","btn",_("div.easyuse-account",l)),b.addEventListener("stable-diffusion-api-generate-succeed",(async({detail:e})=>{var t;let n=l.querySelectorAll(".remark");if(n&&n[0]){const t=(null==e?void 0:e.model)?Ph[e.model]:0;if(t){let e=function(e,t){let n,o,i,r,s,a;s="string"==typeof e?e:e.toString(),a="string"==typeof t?t:t.toString();try{n=s.split(".")[1].length}catch(l){n=0}try{o=a.split(".")[1].length}catch(l){o=0}return i=Math.pow(10,Math.max(n,o)),r=n>=o?n:o,((e*i-t*i)/i).toFixed(r)}(parseFloat(n[0].innerText.replace(/Credits: /g,"")),t);e>0&&(n[0].innerText="Credits: "+e.toString())}}await W(1e4);const o=await b.fetchApi("/easyuse/stability/balance");if(200==o.status){const e=await o.json();if(null==e?void 0:e.balance){const o=(null==(t=e.balance)?void 0:t.credits)||0;n&&n[0]&&(n[0].innerText="Credits: "+o)}}}));const c=await b.fetchApi("/easyuse/stability/api_keys");if(200==c.status){let t=await c.json();if(Ih=t.keys,Nh=t.current,Ih.length>0&&void 0!==Nh){const t=Ih[Nh].key,i=Ih[Nh].name;if(t){const t=await b.fetchApi("/easyuse/stability/user_info");if(200==t.status){const i=await t.json();if((null==i?void 0:i.account)&&(null==i?void 0:i.balance)){const t=(null==(e=i.account)?void 0:e.profile_picture)||null,r=(null==(n=i.account)?void 0:n.email)||null,s=(null==(o=i.balance)?void 0:o.credits)||0;l.replaceChildren(_("div.easyuse-account-user-info",{onclick:e=>{(new Dh).show(l)}},[_("div.user",[_("div.avatar",t?[_("img",{src:t})]:"😀"),_("div.info",[_("h5.name",r),_("h6.remark","Credits: "+s)])]),_("div.edit",{textContent:V("Edit")})]))}}}else l.replaceChildren(_("div.easyuse-account-user-info",{onclick:e=>{(new Dh).show(l)}},[_("div.user",[_("div.avatar","😀"),_("div.info",[_("h5.name",i),_("h6.remark",V("Click to set the APIKEY first"))])]),_("div.edit",{textContent:V("Edit")})]))}}}}}});let jh=null;function Mh(){jh&&(jh.removeEventListeners(),jh.dropdown.remove(),jh=null)}function Rh(e,t,n,o=!1){Mh(),new $h(e,t,n,o)}class $h{constructor(e,t,n,o=!1){this.dropdown=document.createElement("ul"),this.dropdown.setAttribute("role","listbox"),this.dropdown.classList.add("easy-dropdown"),this.selectedIndex=-1,this.inputEl=e,this.suggestions=t,this.onSelect=n,this.isDict=o,this.focusedDropdown=this.dropdown,this.buildDropdown(),this.onKeyDownBound=this.onKeyDown.bind(this),this.onWheelBound=this.onWheel.bind(this),this.onClickBound=this.onClick.bind(this),this.addEventListeners()}buildDropdown(){this.isDict?this.buildNestedDropdown(this.suggestions,this.dropdown):this.suggestions.forEach(((e,t)=>{this.addListItem(e,t,this.dropdown)}));const e=this.inputEl.getBoundingClientRect();this.dropdown.style.top=e.top+e.height-10+"px",this.dropdown.style.left=e.left+"px",document.body.appendChild(this.dropdown),jh=this}buildNestedDropdown(e,t){let n=0;Object.keys(e).forEach((o=>{const i=e[o];if("object"==typeof i&&null!==i){const e=document.createElement("ul");e.setAttribute("role","listbox"),e.classList.add("easy-nested-dropdown");const r=document.createElement("li");r.classList.add("folder"),r.textContent=o,r.appendChild(e),r.addEventListener("mouseover",this.onMouseOver.bind(this,n,t)),t.appendChild(r),this.buildNestedDropdown(i,e),n+=1}else{const e=document.createElement("li");e.classList.add("item"),e.setAttribute("role","option"),e.textContent=o,e.addEventListener("mouseover",this.onMouseOver.bind(this,n,t)),e.addEventListener("mousedown",this.onMouseDown.bind(this,o)),t.appendChild(e),n+=1}}))}addListItem(e,t,n){const o=document.createElement("li");o.setAttribute("role","option"),o.textContent=e,o.addEventListener("mouseover",this.onMouseOver.bind(this,t)),o.addEventListener("mousedown",this.onMouseDown.bind(this,e)),n.appendChild(o)}addEventListeners(){document.addEventListener("keydown",this.onKeyDownBound),this.dropdown.addEventListener("wheel",this.onWheelBound),document.addEventListener("click",this.onClickBound)}removeEventListeners(){document.removeEventListener("keydown",this.onKeyDownBound),this.dropdown.removeEventListener("wheel",this.onWheelBound),document.removeEventListener("click",this.onClickBound)}onMouseOver(e,t){t&&(this.focusedDropdown=t),this.selectedIndex=e,this.updateSelection()}onMouseOut(){this.selectedIndex=-1,this.updateSelection()}onMouseDown(e,t){t.preventDefault(),this.onSelect(e),this.dropdown.remove(),this.removeEventListeners()}onKeyDown(e){const t=Array.from(this.focusedDropdown.children),n=t[this.selectedIndex];if(jh)if(38===e.keyCode)e.preventDefault(),this.selectedIndex=Math.max(0,this.selectedIndex-1),this.updateSelection();else if(40===e.keyCode)e.preventDefault(),this.selectedIndex=Math.min(t.length-1,this.selectedIndex+1),this.updateSelection();else if(39===e.keyCode){if(e.preventDefault(),n&&n.classList.contains("folder")){const e=n.querySelector(".easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=0,this.updateSelection())}}else if(37===e.keyCode&&this.focusedDropdown!==this.dropdown){const e=this.focusedDropdown.closest(".easy-dropdown, .easy-nested-dropdown").parentNode.closest(".easy-dropdown, .easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=Array.from(e.children).indexOf(this.focusedDropdown.parentNode),this.updateSelection())}else if((13===e.keyCode||9===e.keyCode)&&this.selectedIndex>=0){e.preventDefault(),n.classList.contains("item")&&(this.onSelect(t[this.selectedIndex].textContent),this.dropdown.remove(),this.removeEventListeners());const o=n.querySelector(".easy-nested-dropdown");o&&(this.focusedDropdown=o,this.selectedIndex=0,this.updateSelection())}else 27===e.keyCode&&(this.dropdown.remove(),this.removeEventListeners())}onWheel(e){const t=parseInt(this.dropdown.style.top);localStorage.getItem("Comfy.Settings.Comfy.InvertMenuScrolling")?this.dropdown.style.top=t+(e.deltaY<0?10:-10)+"px":this.dropdown.style.top=t+(e.deltaY<0?-10:10)+"px"}onClick(e){this.dropdown.contains(e.target)||e.target===this.inputEl||(this.dropdown.remove(),this.removeEventListeners())}updateSelection(){Array.from(this.focusedDropdown.children).forEach(((e,t)=>{t===this.selectedIndex?e.classList.add("selected"):e.classList.remove("selected")}))}}function Gh(e){const t=e.min||0,n=e.max||0,o=e.step||1;if(0===o)return[];const i=[];let r=t;for(;r<=n;){if(Number.isInteger(o))i.push(Math.round(r)+"; ");else{let e=r.toFixed(3);-0==e&&(e="0.000"),/\.\d{3}$/.test(e)||(e+="0"),i.push(e+"; ")}r+=o}return n>=0&&t>=0?i:i.reverse()}let Bh={},Fh={};function Uh(e,t){String(e.id);const n=t.name,o=t.value.replace(/^(loader|preSampling):\s/,"");Fh[n]?Fh[n]!=Bh[o]&&(Fh[n]=Bh[o]):Fh={...Fh,[n]:Bh[o]}}y.registerExtension({name:"Comfy.EasyUse.XYPlot",async beforeRegisterNodeDef(e,t,n){if("easy XYPlot"===t.name){Bh=t.input.hidden.plot_dict[0];for(const e in Bh){const t=Bh[e];if(Array.isArray(t)){let n=[];for(const e of t)n.push(e+"; ");Bh[e]=n}else Bh[e]="object"==typeof t?"seed"==e?t+"; ":Gh(t):t+"; "}Bh.None=[],Bh["---------------------"]=[]}},nodeCreated(e){"easy XYPlot"===e.comfyClass&&(function(e){if(e.widgets)for(const t of e.widgets)if("x_axis"===t.name||"y_axis"===t.name){let n=t.value;Object.defineProperty(t,"value",{get:()=>n,set(o){o!==n&&(n=o,Uh(e,t))}})}}(e),function(e){if(e.widgets){const t=e.widgets.filter((e=>"customtext"===e.type&&!1!==e.dynamicPrompts||e.dynamicPrompts));for(const e of t){let t=function(e,t,o,i){return e&&(t[o]=e),t.map((e=>n(e,i))).filter((e=>""!==e)).join("")},n=function(e,t){if(e=o(e),i(e,t))return e+"; ";let n=r(e,t);return 1===n.length||2===n.length?n[0]:i(s(e),t)?s(e)+"; ":""},o=function(e){return e.replace(/(\n|;| )/g,"")},i=function(e,t){return t.includes(e+"; ")},r=function(e,t){return t.filter((t=>t.toLowerCase().includes(e.toLowerCase())))},s=function(e){return Number(e)?Number(e).toFixed(3):["0","0.","0.0","0.00","00"].includes(e)?"0.000":e};const a=function(){const n=e.name[0]+"_axis";let o=(null==Fh?void 0:Fh[n])||[];if(0===o.length)return;const i=e.inputEl.value,r=e.inputEl.selectionStart;let s=i.split("; ");const a=i.substring(0,r).split("; ").length-1,l=s[a].replace(/\n/g,"").toLowerCase(),c=o.filter((e=>e.toLowerCase().includes(l))).map((e=>e.replace(/; /g,"")));if(c.length>0)Rh(e.inputEl,c,(n=>{const i=t(n,s,a,o);e.inputEl.value=i}));else{Mh();const n=t(null,s,a,o);e.inputEl.value=n}};e.inputEl.removeEventListener("input",a),e.inputEl.addEventListener("input",a),e.inputEl.removeEventListener("mouseup",a),e.inputEl.addEventListener("mouseup",a)}}}(e))}});const zh=_s("graphStore",{state:e=>({selectors:[],selectors_styles:{},seg_selectors:[],slider_controls:[]}),actions:{setSelectors(e){this.selectors=tp(e)},setStyles(e,t){this.selectors_styles[e]||(this.selectors_styles[e]=t)},setSegSelectors(e){this.seg_selectors=tp(e)},setSliderControls(e){this.slider_controls=tp(e)}}}),Vh=["data-id"],Hh=[Zi("i",{class:"mdi mdi-trash-can"},null,-1)],Wh=Zi("i",{class:"mdi mdi-magnify"},null,-1),Yh=["placeholder"],Zh=["onMouseenter","onMouseleave"],Kh=["onClick"],Xh=["name","checked"],Qh=["src"],Jh={key:0},qh=Zi("span",{class:"comfyui-easyuse-success"},"positive:",-1),em={key:1},tm=Zi("span",{class:"comfyui-easyuse-error"},"negative:",-1),nm="comfyui-easyuse-selector",om={__name:"stylesSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selectedStyles:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["chooseStyle"],setup(e,{emit:t}){const n=e,o=zh(),{selectors_styles:i}=ws(o),r=pn([]);bi((e=>n.type),(async e=>{r.value=[],e&&await(async e=>{if(i.value[n.type])return!0;const t=await b.fetchApi(`/easyuse/prompt/styles?name=${e}`);if(200===t.status){let e=(await t.json()).map(((e,t)=>(e.index=t,e)));return await o.setStyles(n.type,e),!0}return Fp.error(V("Get styles list Failed")),!1})(e)&&a()}),{immediate:!0});const s=t,a=e=>{const t=n.selectedStyles,o=tp(i.value[n.type]);r.value=o.sort(((e,t)=>e.index-t.index)).sort(((e,n)=>t.includes(n.name)-t.includes(e.name)))},l=pn(""),c=e=>e.toLowerCase(),u=Xt({}),d=e=>{u.src="",u.name="",u.positive="",u.negative=""},p=async e=>{const t=await b.fetchApi(`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`);if(200===t.status){const o=await t.text();if(o.startsWith("http"))return o;return`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`}},f=e=>{e.target.src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QNLaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuMSAoMjAyMzA5MDUubS4yMzE2IDk3OWM4NmQpICAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjA3NEU1QzNCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjA3NEU1QzRCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGMDc0RTVDMUI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGMDc0RTVDMkI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHB8fHx8fHx8fHx8BBwcHDQwNGBAQGBoVERUaHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fH//AABEIAIAAgAMBEQACEQEDEQH/xACLAAEAAgMBAQEAAAAAAAAAAAAABAUCAwYBBwgBAQADAQEBAAAAAAAAAAAAAAABAgMEBQYQAAEEAgECAwUHAwUAAAAAAAEAAgMEEQUhEgYxEwdBYSIyFFFxgVJyIxWRoTOxwdFiJBEBAAICAQQBBAIDAAAAAAAAAAECEQMxIUESBBOB0SIyUXGCIwX/2gAMAwEAAhEDEQA/AP1SgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDXJYgj+d4afsVopM8KWvEcy8it1pXdMcjXO/Lnn+im2u0cwV2VniW1UXEBAQEBAQEBAQEBAQRNlc+mgyDh7zhv+5WunX5Sw37fCHM2dh48r06ank7N6rn2Ja7qa4hw5BBwQV010uK+/DsO29v/J68SOI86Jxjl95HIP4gryPc0fHfHaXu+j7Py68zzHSVquV2iAgICAgICAgICDyTr6HdHz4PTnwypjnqic46OauNbY6mGX99p+L8w9xaeV6OufHt0eXtr59M9VFb194E9LmuH3kf6rv17avO2ets7YVcuuuk/uOa3PgBlxP4BdMbq9nLPqbJ5xDbSM9azFXpyujuSO+Bo5kcf0NPyj25We2YtEzaPxdfr6519Kz+UvqEIlELBKQZQ0eYRwC7HOPxXzVsZ6cPpK5x15ZKEiAgICAgICAgICCNc1tG40CzA2XHg4j4h9zhyFpr22p+s4Z7NNL/ALRlTX+1dVFBJOJrcTI2lxZHYcBx+sldWv3bzOMVn6fZy39OkRnNo+v3aoOx9JOxks8tqwHDPS+1IW8+IzGWZVrf9DZHSMR/j9yvo656zMz9V1rdLqdYwsoVIqwd87mNAc79Tvmd+JXJt332ftMy6temlP1jCasmggICAgICAgICAgwlmiib1SPDB7zhWrWZ4VtaI5QXb2l5ojYHvLjjIGB/dbR61sZlhPtVziFb3PYdd0luCvAZbXludVZ1huZQPgyTx4/atvWj4rxaZ6d/6Ye1/t1zSI6zx/bzti5YqaOpBeg8u41n/oa14cA4ccH7lPs1jZebVn8eyPUtOrXFbR+XdYx9xa90pjeXROaSCXDj+oysZ9S+Mx1bR7uvOJ6LGOWKVgfG8PafAtOQueazHLqraJjMMlCRAQEBAQEBAQRLNp4HTFx/2/4WtKR3Y32T2Udl8j3knk/aeSu6kREPPvaZlpY3DmyY8DyrzPZWv8tkvmFv7bg12RyR1DGeeMj2KnjE9JaeUx1hi1sgaet/U7JIOMcE8Dj7FMREcK2zPKMasr5XO6fmOVt5xEOadVplYU45IAOhxa72kLm2TFuXXqrNeF1WtlwDZeHfmHguO+vHDupszylLJsICAgICAg8cMjCQiYR5IVpFmc1Q5qLXHPgfbhbV2MLaYlqNQAYA4V/kV+PDA1fcp81fjYurtYMu4CmLZRNYhtZWBAI8CqzdaKN8df3LObtIokxwe5ZzZrFUloIGFnLWHqhIgICAgICAgxMbSpyjDAwAq3kr4MTWCnzR4MX02PGHDISNmETqieWba7QABwB4KJumKNgjaFXK0VZYChYQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEHzvuv1G7k1W9s6/Xamtaq15oaonmnsCR008HntaI4K8/s4HOeEGXZXqTud7uqtG7r6kNa5HdMU9aaw9zZde+FkrHsnr1+M2MZBPIKDRe9cO2K2mjs/V0m7X61lWzq32W+ZFEbfkSSO4B+GL9zw4QWm99TqFVmjsaSu7fUtxeNM2aTmSMBbHI9zWHqHVJlnDTxjPKCJL6sea502t1D7Ouhr0rNqxNM2CSNuwnkgjAi6ZOotdEc/Egibf1j/j+7JNL9DWdWg84TWn2ywtdFKyMZb5Tg0nLyG55x48IJ3bXqe/ea/a26dFtyTXtldDUqyOdNL5VqaDHS5gwXRxMe3xz1Y9iDKP1Sa7uefUnR7TyYqUVoEU5jY6pJZIz1RY4ZiMYd7TkexBA749Wr2gtCKlrIpGs17NjK29LLWmPmMsyiFkbIZsPEdKQu6y0eAQWdD1E2L93W1tzRyCDY3paev2NaxVlhIjidMfMb5vmse1kbi9pZ7MeKDt0BAQEBAQfEPU+lFY2++q2K1uSSezTnrReVsTTmiZVYHOd9LVuQyubIwANkbxz4FA7FsQ0NrrLNXX7N0eo1+3darGDYPjb5j6prxVRajjDetsRAjj4yM4CDre2uxO7q2hqtm7nua6w9rp5tfXgoSxwyTOMr42PlrPe4Nc8jJJQRDb3Oz1fYFrcV7As0mu3u7nbWkBZ9LSfG5nlxs/yySWRiNozwcBBx9EXadGTXz62+LG41+jZS6adhzS6vfnlkEjgzEZax7T8ePFBu3nbPdUXqJZsw6S5cqbCW1YdIY2lxhhfEGMjfHtoG9HxucwPEZy4/A7kMC87aq2Kmv7mdvxuqGmklFjUU4G2Yp21rdyW00t+kJkFl88pY9vDgwNDvEoK9np73FBcHdkrt2+rZd5FjQx7O0b8WvbzDKZhN1SSse573QdeAHkN+Ichj3p2rBvZq9vUnY2tcNQPqpZYZpJ44GxXqzHdVlzZZpib73mLHViI85c1BZ6OpsIe/6/XSuntevdsz6+8+pI0/yM1dtWVr2Z644P8rmyuj6S53jxkh9aQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBB/9k="};return(t,o)=>($i(),Ui("div",{class:Me(nm+` ${nm}-styles`),"data-id":e.id,onMouseleave:d},[r.value.length>0&&e.show?($i(),Ui(Ni,{key:0},[Zi("div",{class:Me(nm+"__header")},[Zi("div",{class:Me(nm+"__header_button"),onClick:o[0]||(o[0]=e=>(s("chooseStyle",[]),void(l.value="")))},Hh,2),Zi("div",{class:Me(nm+"__header_search")},[Wh,Hn(Zi("textarea",{class:"search","onUpdate:modelValue":o[1]||(o[1]=e=>l.value=e),dir:"ltr",rows:1,placeholder:hn(V)("Type here to search styles ...")},null,8,Yh),[[Zr,l.value]])],2)],2),Zi("div",{class:Me(nm+"__content"),onMouseleave:a},[($i(!0),Ui(Ni,null,bo(r.value,((t,o)=>($i(),Ui("div",{class:Me(nm+"-item"),key:o,onMouseenter:e=>(async e=>{if(!e.imageSrc){if(e.imageLoading)return;e.imageLoading=!0;const t=await p(e.imgName).finally((()=>e.imageLoading=!1));e.imageSrc=t}u.name="zh-CN"==z&&e.name_cn?e.name_cn:e.name,u.positive=e.prompt,u.negative=e.negative_prompt,u.src=e.imageSrc})(t),onMouseleave:Qr((e=>d()),["stop"])},[Zi("span",{class:Me([nm+"-item__tag",{hide:!(e.selectedStyles.includes(t.name)||-1!=c(t.name).indexOf(c(l.value))||t.name_cn&&-1!=c(t.name_cn).indexOf(c(l.value)))}]),onClick:e=>(e=>{let t=n.selectedStyles;t.includes(e.name)?t=t.filter((t=>t!==e.name)):t.push(e.name),s("chooseStyle",t)})(t)},[Zi("input",{type:"checkbox",name:t.name,checked:e.selectedStyles.includes(t.name)},null,8,Xh),Zi("span",null,Be("zh-CN"==hn(z)&&t.name_cn?t.name_cn:t.name),1)],10,Kh)],42,Zh)))),128))],34),(null==u?void 0:u.src)?($i(),Ui("div",{key:0,class:Me(nm+"-preview")},[Zi("img",{src:u.src,ref:"image",alt:"preview",onError:f},null,40,Qh),Zi("div",{class:Me(nm+"-preview__text")},[Zi("b",null,Be(u.name),1),Zi("div",{class:Me(nm+"-preview__prompt")},[u.positive?($i(),Ui("h6",Jh,[qh,Zi("span",null,Be(u.positive),1)])):Ji("",!0),u.negative?($i(),Ui("h6",em,[tm,Zi("span",null,Be(u.negative),1)])):Ji("",!0)],2)],2)],2)):Ji("",!0)],64)):Ji("",!0)],42,Vh))}},im=["data-id"],rm=["onClick"],sm=["name","checked"],am="comfyui-easyuse-selector",lm={__name:"segSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selected:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:t}){const n=e,o=pn([]);bi((e=>n.type),(async e=>{switch(e){case"selfie_multiclass_256x256":o.value=["Background","Hair","Body","Face","Clothes","Others"];break;case"human_parsing_lip":o.value=["Background","Hat","Hair","Glove","Sunglasses","Upper-clothes","Dress","Coat","Socks","Pants","Jumpsuits","Scarf","Skirt","Face","Left-arm","Right-arm","Left-leg","Right-leg","Left-shoe","Right-shoe"]}}),{immediate:!0});const i=t;return(t,r)=>{var s;return $i(),Ui("div",{class:Me(am+` ${am}-seg`),"data-id":e.id},[(null==(s=o.value)?void 0:s.length)>0&&e.show?($i(!0),Ui(Ni,{key:0},bo(o.value,((t,o)=>($i(),Ui("div",{class:Me(am+"-item"),key:o},[Zi("span",{class:Me(am+"-item__tag"),onClick:e=>(e=>{let t=tp(n.selected);t.includes(e)?t=t.filter((t=>t!==e)):t.push(e),i("select",t)})(t)},[Zi("input",{type:"checkbox",name:t,checked:e.selected.includes(t)},null,8,sm),Zi("span",null,Be(hn(V)(t)),1)],10,rm)],2)))),128)):Ji("",!0)],10,im)}}},cm=["data-id"],um=["onMousedown","onDblclick"],dm="comfyui-easyuse-slider",pm="ipadapter layer weights",fm={__name:"sliderControl",props:{id:{type:String|Number,default:""},mode:{type:String,default:""},type:{type:String,default:""},values:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["changeValues","showSlider"],setup(e,{emit:t}){const n=e,o=t,i=(e,t,n)=>(e-t)/(n-t)*100,r=(e,t,o=void 0)=>{if(n.mode===pm){let n={3:2.5,6:1}[t]||0;return{default:12==e?n:0,min:-1,max:3,step:.05,value:void 0!==o?o:12==e?n:0,top:void 0!==o?100-i(o,-1,3)+"%":null,height:void 0!==o?i(o,-1,3)+"%":null}}};bi((e=>n.mode),(async(e,t)=>{var i;if(e!==t&&e===pm)if(!t&&(null==(i=n.values)?void 0:i.length)>0){const e=n.values.map((e=>{const t=e.split(":");return r(n.values.length,t[0],parseFloat(t[1]))}));await o("changeValues",e)}else{let e="sd1"==n.type?16:12,t=Array.from({length:e},((t,n)=>r(e,n)));await o("changeValues",t)}o("showSlider")}),{immediate:!0}),bi((e=>n.type),((e,t)=>{if(e!=t&&n.mode==pm){let e="sd1"==n.type?16:12,t=Array.from({length:e},((t,n)=>r(e,n)));o("changeValues",t)}}));const s=pn(null),a=pn(null);return oo((()=>{document.onmouseup=e=>document.onmousemove=null})),(t,r)=>{var l;return $i(),Ui("div",{class:Me(dm),"data-id":e.id},[(null==(l=e.values)?void 0:l.length)>0&&e.show?($i(!0),Ui(Ni,{key:0},bo(e.values,((t,r)=>($i(),Ui("div",{class:Me([dm+"-item",{positive:3==r&&"sdxl"==e.type&&e.mode==pm},{negative:6==r&&"sdxl"==e.type&&e.mode==pm}]),key:r},[Zi("div",{class:Me(dm+"-item-input")},Be(t.value),3),Zi("div",{class:Me(dm+"-item-scroll"),ref_for:!0,ref_key:"scroll",ref:s},[Zi("div",{class:Me(dm+"-item-bar"),ref_for:!0,ref_key:"bar",ref:a,style:Ie({top:t.top||100-i(t.default,t.min,t.max)+"%"}),onMousedown:e=>((e,t,i)=>{let r=e||window.event,l=s.value[i],c=a.value[i],u=tp(n.values),d=r.clientY-c.offsetTop;document.onmousemove=e=>{let n=(e||window.event).clientY-d;n<0?n=0:n>l.offsetHeight-c.offsetHeight&&(n=l.offsetHeight-c.offsetHeight);let r=(t.max-t.min)/t.step,s=(l.offsetHeight-c.offsetHeight)/r;n=Math.round(n/s)*s;const a=Math.floor(n/(l.offsetHeight-c.offsetHeight)*100)+"%",p=Math.floor((l.offsetHeight-c.offsetHeight-n)/(l.offsetHeight-c.offsetHeight)*100)+"%",f=parseFloat(parseFloat(t.max-(t.max-t.min)*(n/(l.offsetHeight-c.offsetHeight))).toFixed(2));u[i]={...u[i],top:a,height:p,value:f},o("changeValues",u),window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}})(e,t,r),onDblclick:e=>((e,t,i)=>{let r=tp(n.values);r[i]={...r[i],top:null,height:null,value:t.default},o("changeValues",r)})(0,t,r)},null,46,um),Zi("div",{class:Me(dm+"-item-area"),style:Ie({height:t.height||i(t.default,t.min,t.max)+"%"})},null,6)],2),Zi("div",{class:Me(dm+"-item-label")},[Zi("span",null,Be(t.label),1)],2)],2)))),128)):Ji("",!0)],8,cm)}}},hm={__name:"index",setup(e){const t=zh(),{selectors:n,seg_selectors:o,slider_controls:i}=ws(t),r=pn({}),s=async e=>{var o,i,s,a,l,c;await W(1);const u=wp(e,"styles"),d=(null==(o=e.properties.values)?void 0:o.length)>0?e.properties.values:[];let p=tp(n.value);p.push({id:e.id,type:u.value,value:d,show:!1});const f=p.length-1;await t.setSelectors(p);let h=null==(a=null==(s=null==(i=r.value[e.id])?void 0:i._)?void 0:s.vnode)?void 0:a.el;if(!h)return;let m=e.addDOMWidget("select_styles","btn",h);e.properties.values||e.setProperty("values",[]),p[f].show=!0,await t.setSelectors(p);let g=u.value;Object.defineProperty(u,"value",{set:n=>{g=n,p[f].type=n,e.properties.values=[],p[f].value=[],t.setSelectors(p)},get:e=>g}),Object.defineProperty(m,"value",{set:e=>{setTimeout((n=>{p[f].value=e.split(","),t.setSelectors(p)}),150)},get:t=>{var o,i;return e.properties.values=(null==(i=null==(o=n.value)?void 0:o[f])?void 0:i.value)||[],e.properties.values.join(",")}}),((null==(l=e.size)?void 0:l[0])<150||(null==(c=e.size)?void 0:c[1])<150)&&e.setSize([425,500]);const v=e.onRemoved;e.onRemoved=function(){if(v&&(null==v||v.apply(this,arguments)),void 0!==n.value.findIndex((t=>t.id==e.id))){let e=tp(n.value);e.splice(f,1),t.setSelectors(e)}return v}},a=pn({}),l=async e=>{var n,i,r,s;await W(1);const l=wp(e,"method"),c=(null==(n=e.properties.values)?void 0:n.length)>0?e.properties.values:[];let u=tp(o.value);u.push({id:e.id,type:l.value,value:c,show:!1});const d=u.length-1;await t.setSegSelectors(u);let p=null==(s=null==(r=null==(i=a.value[e.id])?void 0:i._)?void 0:r.vnode)?void 0:s.el;if(!p)return;let f=e.addDOMWidget("mask_components","btn",p);e.properties.values||e.setProperty("values",[]),u[d].show=!0,await t.setSegSelectors(u);let h=l.value;Object.defineProperty(l,"value",{set:n=>{h=n,u[d].type=n,e.properties.values=[],u[d].value=[],Sp(e,wp(e,"confidence"),"selfie_multiclass_256x256"===h),e.setSize([300,"selfie_multiclass_256x256"===h?260:500]),t.setSegSelectors(u)},get:e=>h}),Object.defineProperty(f,"value",{set:e=>{setTimeout((n=>{u[d].value=e.split(","),t.setSegSelectors(u)}),150)},get:t=>{var n;return e.properties.values=(null==(n=o.value)?void 0:n[d].value)||[],e.properties.values.join(",")}}),Sp(e,wp(e,"confidence"),"selfie_multiclass_256x256"===h),e.setSize([300,"selfie_multiclass_256x256"===h?260:500]);const m=e.onRemoved;e.onRemoved=function(){if(m&&(null==m||m.apply(this,arguments)),void 0!==o.value.findIndex((t=>t.id==e.id))){let e=tp(o.value);e.splice(d,1),t.setSegSelectors(e)}return m}},c=pn({}),u=async e=>{var n,o,r,s;await W(1);const a=wp(e,"mode"),l=wp(e,"model_type"),u=(null==(n=e.properties.values)?void 0:n.length)>0?e.properties.values:[];let d=tp(i.value);d.push({id:e.id,type:l.value,mode:a.value,value:u,show:!1});const p=d.length-1;await t.setSliderControls(d);let f=null==(s=null==(r=null==(o=c.value[e.id])?void 0:o._)?void 0:r.vnode)?void 0:s.el;if(!f)return;let h=e.addDOMWidget("values","btn",f);e.properties.values||e.setProperty("values",[]),Object.defineProperty(h,"value",{set:function(){},get:t=>{var n;const o=(null==(n=i.value)?void 0:n[p].value)||[];return e.properties.values=o.map(((e,t)=>`${t}:${e.value}`)),e.properties.values.join(",")}}),e.setSize("sdxl"==l.value?[375,320]:[455,320]),l.callback=n=>{d=tp(i.value),d[p].type!=n&&(e.setSize("sdxl"==n?[375,320]:[455,320]),d[p].value=[],d[p].type=n,t.setSliderControls(d))};const m=e.onRemoved;e.onRemoved=function(){if(m&&(null==m||m.apply(this,arguments)),void 0!==i.value.findIndex((t=>t.id==e.id))){let e=tp(i.value);e.splice(p,1),t.setSliderControls(e)}return m}};return oo((e=>{y.registerExtension({name:"Comfy.EasyUse.Components",async beforeRegisterNodeDef(e,t){const n=e.prototype.onNodeCreated;"easy stylesSelector"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await s(this),n}),"easy humanSegmentation"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await l(this),n}),"easy sliderControl"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await u(this),n})}})})),(e,s)=>($i(),Ui(Ni,null,[($i(!0),Ui(Ni,null,bo(hn(n),((e,o)=>($i(),zi(om,{ref_for:!0,ref:t=>{t&&(r.value[e.id]=t)},type:e.type,key:o,id:e.id,show:e.show,selectedStyles:e.value,onChooseStyle:e=>((e,o)=>{let i=tp(n.value);i[o].value=e,t.setSelectors(i)})(e,o)},null,8,["type","id","show","selectedStyles","onChooseStyle"])))),128)),($i(!0),Ui(Ni,null,bo(hn(o),((e,n)=>($i(),zi(lm,{ref_for:!0,ref:t=>{t&&(a.value[e.id]=t)},type:e.type,key:n,id:e.id,show:e.show,selected:e.value,onSelect:e=>((e,n)=>{let i=tp(o.value);i[n].value=e,t.setSegSelectors(i)})(e,n)},null,8,["type","id","show","selected","onSelect"])))),128)),($i(!0),Ui(Ni,null,bo(hn(i),((e,n)=>($i(),zi(fm,{ref_for:!0,ref:t=>{t&&(c.value[e.id]=t)},type:e.type,key:n,id:e.id,show:e.show,mode:e.mode,values:e.value,onChangeValues:e=>((e,n)=>{let o=tp(i.value);o[n].value=e,t.setSliderControls(o)})(e,n),onShowSlider:e=>(e=>{let n=tp(i.value);n[e].show=!0,t.setSliderControls(n)})(n)},null,8,["type","id","show","mode","values","onChangeValues","onShowSlider"])))),128))],64))}};var mm=Object.defineProperty,gm=Object.getOwnPropertySymbols,vm=Object.prototype.hasOwnProperty,ym=Object.prototype.propertyIsEnumerable,bm=(e,t,n)=>t in e?mm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function _m(e){return null==e||""===e||Array.isArray(e)&&0===e.length||!(e instanceof Date)&&"object"==typeof e&&0===Object.keys(e).length}function wm(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Sm(e){return!_m(e)}function xm(e,t=!0){return e instanceof Object&&e.constructor===Object&&(t||0!==Object.keys(e).length)}function km(e,...t){return wm(e)?e(...t):e}function Cm(e,t=!0){return"string"==typeof e&&(t||""!==e)}function Am(e){return Cm(e)?e.replace(/(-|_)/g,"").toLowerCase():e}function Em(e,t="",n={}){const o=Am(t).split("."),i=o.shift();return i?xm(e)?Em(km(e[Object.keys(e).find((e=>Am(e)===i))||""],n),o.join("."),n):void 0:km(e,n)}function Om(e,t=!0){return Array.isArray(e)&&(t||0!==e.length)}function Lm(e){return Sm(e)&&!isNaN(e)}function Tm(e,t){if(t){const n=t.test(e);return t.lastIndex=0,n}return!1}function Im(...e){const t=(e={},n={})=>{const o=((e,t)=>{for(var n in t||(t={}))vm.call(t,n)&&bm(e,n,t[n]);if(gm)for(var n of gm(t))ym.call(t,n)&&bm(e,n,t[n]);return e})({},e);return Object.keys(n).forEach((i=>{xm(n[i])&&i in e&&xm(e[i])?o[i]=t(e[i],n[i]):o[i]=n[i]})),o};return e.reduce(((e,n,o)=>0===o?n:t(e,n)),{})}function Nm(e){return e?e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":"):e}function Pm(e){return Cm(e)?e.replace(/(_)/g,"-").replace(/[A-Z]/g,((e,t)=>0===t?e:"-"+e.toLowerCase())).toLowerCase():e}function Dm(e){return Cm(e)?e.replace(/[A-Z]/g,((e,t)=>0===t?e:"."+e.toLowerCase())).toLowerCase():e}function jm(){const e=new Map;return{on(t,n){let o=e.get(t);return o?o.push(n):o=[n],e.set(t,o),this},off(t,n){let o=e.get(t);return o&&o.splice(o.indexOf(n)>>>0,1),this},emit(t,n){let o=e.get(t);o&&o.slice().map((e=>{e(n)}))},clear(){e.clear()}}}var Mm=Object.defineProperty,Rm=Object.defineProperties,$m=Object.getOwnPropertyDescriptors,Gm=Object.getOwnPropertySymbols,Bm=Object.prototype.hasOwnProperty,Fm=Object.prototype.propertyIsEnumerable,Um=(e,t,n)=>t in e?Mm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zm=(e,t)=>{for(var n in t||(t={}))Bm.call(t,n)&&Um(e,n,t[n]);if(Gm)for(var n of Gm(t))Fm.call(t,n)&&Um(e,n,t[n]);return e},Vm=(e,t)=>Rm(e,$m(t)),Hm=(e,t)=>{var n={};for(var o in e)Bm.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&Gm)for(var o of Gm(e))t.indexOf(o)<0&&Fm.call(e,o)&&(n[o]=e[o]);return n},Wm=jm();function Ym(e,t){Om(e)?e.push(...t||[]):xm(e)&&Object.assign(e,t)}function Zm(e,t=""){if(!["opacity","z-index","line-height","font-weight","flex","flex-grow","flex-shrink","order"].some((e=>t.endsWith(e)))){return`${e}`.trim().split(" ").map((e=>Lm(e)?`${e}px`:e)).join(" ")}return e}function Km(e="",t=""){return function(e){return e.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}(`${Cm(e,!1)&&Cm(t,!1)?`${e}-`:e}${t}`)}function Xm(e="",t=""){return`--${Km(e,t)}`}function Qm(e,t="",n="",o=[],i){if(Cm(e)){const r=/{([^}]*)}/g,s=e.trim();if(Tm(s,r)){const e=s.replaceAll(r,(e=>{const t=e.replace(/{|}/g,"").split(".").filter((e=>!o.some((t=>Tm(e,t)))));return`var(${Xm(n,Pm(t.join("-")))}${Sm(i)?`, ${i}`:""})`})),t=/(\d+\s+[\+\-\*\/]\s+\d+)/g,a=/var\([^)]+\)/g;return Tm(e.replace(a,"0"),t)?`calc(${e})`:e}return Zm(s,t)}if(Lm(e))return Zm(e,t)}function Jm(e,t){return e?`${e}{${t}}`:""}var qm=(...e)=>eg(og.getTheme(),...e),eg=(e={},t,n,o="variable")=>{if(t){const{variable:i,options:r}=og.defaults||{},{prefix:s,transform:a}=(null==e?void 0:e.options)||r||{},l=Tm(t,/{([^}]*)}/g)?t:`{${t}}`;return"value"===o||"strict"===a?og.getTokenValue(t):Qm(l,void 0,s,[i.excludedKeyRegex],n)}return""};function tg(e,t={}){const n=og.defaults.variable,{prefix:o=n.prefix,selector:i=n.selector,excludedKeyRegex:r=n.excludedKeyRegex}=t,s=(e,t="")=>Object.entries(e).reduce(((e,[n,i])=>{const a=Tm(n,r)?Km(t):Km(t,Pm(n)),l=function(e){return xm(e)&&e.hasOwnProperty("value")&&e.hasOwnProperty("type")?e.value:e}(i);if(xm(l)){const{variables:t,tokens:n}=s(l,a);Ym(e.tokens,n),Ym(e.variables,t)}else e.tokens.push((o?a.replace(`${o}-`,""):a).replaceAll("-",".")),function(e,t,n){Cm(t,!1)&&e.push(`${t}:${n};`)}(e.variables,Xm(a),Qm(l,a,o,[r]));return e}),{variables:[],tokens:[]}),{variables:a,tokens:l}=s(e,o);return{value:a,tokens:l,declarations:a.join(""),css:Jm(i,a.join(""))}}var ng={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(e){return{type:"class",selector:e,matched:this.pattern.test(e.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(e){return{type:"attr",selector:`:root${e}`,matched:this.pattern.test(e.trim())}}},media:{pattern:/^@media (.*)$/,resolve(e){return{type:"media",selector:`${e}{:root{[CSS]}}`,matched:this.pattern.test(e.trim())}}},system:{pattern:/^system$/,resolve(e){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(e.trim())}}},custom:{resolve:e=>({type:"custom",selector:e,matched:!0})}},resolve(e){const t=Object.keys(this.rules).filter((e=>"custom"!==e)).map((e=>this.rules[e]));return[e].flat().map((e=>{var n;return null!=(n=t.map((t=>t.resolve(e))).find((e=>e.matched)))?n:this.rules.custom.resolve(e)}))}},_toVariables:(e,t)=>tg(e,{prefix:null==t?void 0:t.prefix}),getCommon({name:e="",theme:t={},params:n,set:o,defaults:i}){var r,s,a,l;const{preset:c,options:u}=t;let d,p,f,h;if(Sm(c)){const{primitive:t,semantic:n}=c,m=n||{},{colorScheme:g}=m,v=Hm(m,["colorScheme"]),y=g||{},{dark:b}=y,_=Hm(y,["dark"]),w=Sm(t)?this._toVariables({primitive:t},u):{},S=Sm(v)?this._toVariables({semantic:v},u):{},x=Sm(_)?this._toVariables({light:_},u):{},k=Sm(b)?this._toVariables({dark:b},u):{},[C,A]=[null!=(r=w.declarations)?r:"",w.tokens],[E,O]=[null!=(s=S.declarations)?s:"",S.tokens||[]],[L,T]=[null!=(a=x.declarations)?a:"",x.tokens||[]],[I,N]=[null!=(l=k.declarations)?l:"",k.tokens||[]];d=this.transformCSS(e,C,"light","variable",u,o,i),p=A;f=`${this.transformCSS(e,`${E}${L}color-scheme:light`,"light","variable",u,o,i)}${this.transformCSS(e,`${I}color-scheme:dark`,"dark","variable",u,o,i)}`,h=[...new Set([...O,...T,...N])]}return{primitive:{css:d,tokens:p},semantic:{css:f,tokens:h}}},getPreset({name:e="",preset:t={},options:n,params:o,set:i,defaults:r,selector:s}){var a,l,c;const u=e.replace("-directive",""),d=t,{colorScheme:p}=d,f=Hm(d,["colorScheme"]),h=p||{},{dark:m}=h,g=Hm(h,["dark"]),v=Sm(f)?this._toVariables({[u]:f},n):{},y=Sm(g)?this._toVariables({[u]:g},n):{},b=Sm(m)?this._toVariables({[u]:m},n):{},[_,w]=[null!=(a=v.declarations)?a:"",v.tokens||[]],[S,x]=[null!=(l=y.declarations)?l:"",y.tokens||[]],[k,C]=[null!=(c=b.declarations)?c:"",b.tokens||[]],A=[...new Set([...w,...x,...C])];return{css:`${this.transformCSS(u,`${_}${S}`,"light","variable",n,i,r,s)}${this.transformCSS(u,k,"dark","variable",n,i,r,s)}`,tokens:A}},getPresetC({name:e="",theme:t={},params:n,set:o,defaults:i}){var r;const{preset:s,options:a}=t,l=null==(r=null==s?void 0:s.components)?void 0:r[e];return this.getPreset({name:e,preset:l,options:a,params:n,set:o,defaults:i})},getPresetD({name:e="",theme:t={},params:n,set:o,defaults:i}){var r;const s=e.replace("-directive",""),{preset:a,options:l}=t,c=null==(r=null==a?void 0:a.directives)?void 0:r[s];return this.getPreset({name:s,preset:c,options:l,params:n,set:o,defaults:i})},getColorSchemeOption(e,t){var n;return this.regex.resolve(null!=(n=e.darkModeSelector)?n:t.options.darkModeSelector)},getLayerOrder(e,t={},n,o){const{cssLayer:i}=t;if(i){return`@layer ${km(i.order||"primeui",n)}`}return""},getCommonStyleSheet({name:e="",theme:t={},params:n,props:o={},set:i,defaults:r}){const s=this.getCommon({name:e,theme:t,params:n,set:i,defaults:r}),a=Object.entries(o).reduce(((e,[t,n])=>e.push(`${t}="${n}"`)&&e),[]).join(" ");return Object.entries(s||{}).reduce(((e,[t,n])=>{if(null==n?void 0:n.css){const o=Nm(null==n?void 0:n.css),i=`${t}-variables`;e.push(``)}return e}),[]).join("")},getStyleSheet({name:e="",theme:t={},params:n,props:o={},set:i,defaults:r}){var s;const a={name:e,theme:t,params:n,set:i,defaults:r},l=null==(s=e.includes("-directive")?this.getPresetD(a):this.getPresetC(a))?void 0:s.css,c=Object.entries(o).reduce(((e,[t,n])=>e.push(`${t}="${n}"`)&&e),[]).join(" ");return l?``:""},createTokens(e={},t,n="",o="",i={}){return Object.entries(e).forEach((([e,r])=>{const s=Tm(e,t.variable.excludedKeyRegex)?n:n?`${n}.${Dm(e)}`:Dm(e),a=o?`${o}.${e}`:e;xm(r)?this.createTokens(r,t,s,a,i):(i[s]||(i[s]={paths:[],computed(e,t={}){if(e){const n=this.paths.find((t=>t.scheme===e))||this.paths.find((e=>"none"===e.scheme));return null==n?void 0:n.computed(e,t.binding)}return this.paths.map((e=>e.computed(e.scheme,t[e.scheme])))}}),i[s].paths.push({path:a,value:r,scheme:a.includes("colorScheme.light")?"light":a.includes("colorScheme.dark")?"dark":"none",computed(e,t={}){const n=/{([^}]*)}/g;let o=r;if(t.name=this.path,t.binding||(t.binding={}),Tm(r,n)){const s=r.trim().replaceAll(n,(n=>{var o,r;const s=n.replace(/{|}/g,"");return null==(r=null==(o=i[s])?void 0:o.computed(e,t))?void 0:r.value})),a=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,l=/var\([^)]+\)/g;o=Tm(s.replace(l,"0"),a)?`calc(${s})`:s}return _m(t.binding)&&delete t.binding,{colorScheme:e,path:this.path,paths:t,value:o.includes("undefined")?void 0:o}}}))})),i},getTokenValue(e,t,n){var o;const i=t.split(".").filter((e=>!Tm(e.toLowerCase(),n.variable.excludedKeyRegex))).join(".");const r=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,s=[null==(o=e[i])?void 0:o.computed(r)].flat().filter((e=>e));return 1===s.length?s[0].value:s.reduce(((e={},t)=>{const n=t,{colorScheme:o}=n,i=Hm(n,["colorScheme"]);return e[o]=i,e}),void 0)},transformCSS(e,t,n,o,i={},r,s,a){if(Sm(t)){const{cssLayer:l}=i;if("style"!==o){const e=this.getColorSchemeOption(i,s),o=a?Jm(a,t):t;t="dark"===n?e.reduce(((e,{selector:t})=>(Sm(t)&&(e+=t.includes("[CSS]")?t.replace("[CSS]",o):Jm(t,o)),e)),""):Jm(null!=a?a:":root",t)}if(l){const n={name:"primeui",order:"primeui"};xm(l)&&(n.name=km(l.name,{name:e,type:o})),Sm(n.name)&&(t=Jm(`@layer ${n.name}`,t),null==r||r.layerNames(n.name))}return t}return""}},og={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(e={}){const{theme:t}=e;t&&(this._theme=Vm(zm({},t),{options:zm(zm({},this.defaults.options),t.options)}),this._tokens=ng.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var e;return(null==(e=this.theme)?void 0:e.preset)||{}},get options(){var e;return(null==(e=this.theme)?void 0:e.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(e){this.update({theme:e}),Wm.emit("theme:change",e)},getPreset(){return this.preset},setPreset(e){this._theme=Vm(zm({},this.theme),{preset:e}),this._tokens=ng.createTokens(e,this.defaults),this.clearLoadedStyleNames(),Wm.emit("preset:change",e),Wm.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(e){this._theme=Vm(zm({},this.theme),{options:e}),this.clearLoadedStyleNames(),Wm.emit("options:change",e),Wm.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(e){this._layerNames.add(e)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(e){return this._loadedStyleNames.has(e)},setLoadedStyleName(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(e){return ng.getTokenValue(this.tokens,e,this.defaults)},getCommon(e="",t){return ng.getCommon({name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPresetC(n)},getDirective(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPresetD(n)},getCustomPreset(e="",t,n,o){const i={name:e,preset:t,options:this.options,selector:n,params:o,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPreset(i)},getLayerOrderCSS(e=""){return ng.getLayerOrder(e,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(e="",t,n="style",o){return ng.transformCSS(e,t,o,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(e="",t,n={}){return ng.getCommonStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(e,t,n={}){return ng.getStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(e){this._loadingStyles.add(e)},onStyleUpdated(e){this._loadingStyles.add(e)},onStyleLoaded(e,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),Wm.emit(`theme:${t}:load`,e),!this._loadingStyles.size&&Wm.emit("theme:load"))}};function ig(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className))}function rg(e,t){if(e&&t){const n=t=>{ig(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)};[t].flat().filter(Boolean).forEach((e=>e.split(" ").forEach(n)))}}function sg(e,t){if(e&&t){const n=t=>{e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")};[t].flat().filter(Boolean).forEach((e=>e.split(" ").forEach(n)))}}function ag(e,t){if(e instanceof HTMLElement){return e.offsetWidth}return 0}function lg(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function cg(e,t={}){if(lg(e)){const n=(t,o)=>{var i,r;const s=(null==(i=null==e?void 0:e.$attrs)?void 0:i[t])?[null==(r=null==e?void 0:e.$attrs)?void 0:r[t]]:[];return[o].flat().reduce(((e,o)=>{if(null!=o){const i=typeof o;if("string"===i||"number"===i)e.push(o);else if("object"===i){const i=Array.isArray(o)?n(t,o):Object.entries(o).map((([e,n])=>"style"!==t||!n&&0!==n?n?e:void 0:`${e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${n}`));e=i.length?e.concat(i.filter((e=>!!e))):e}}return e}),s)};Object.entries(t).forEach((([t,o])=>{if(null!=o){const i=t.match(/^on(.+)/);i?e.addEventListener(i[1].toLowerCase(),o):"p-bind"===t?cg(e,o):(o="class"===t?[...new Set(n("class",o))].join(" ").trim():"style"===t?n("style",o).join(";").trim():o,(e.$attrs=e.$attrs||{})&&(e.$attrs[t]=o),e.setAttribute(t,o))}}))}}function ug(e,t={},...n){if(e){const o=document.createElement(e);return cg(o,t),o.append(...n),o}}function dg(e,t){return lg(e)?e.matches(t)?e:e.querySelector(t):null}function pg(e,t){if(lg(e)){const n=e.getAttribute(t);return isNaN(n)?"true"===n||"false"===n?"true"===n:n:+n}}function fg(e){if(e){let t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),t}return 0}function hg(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function mg(e,t){if(e){return e.offsetHeight}return 0}function gg(e,t=[]){const n=hg(e);return null===n?t:gg(n,t.concat([n]))}function vg(e){let t=[];if(e){let n=gg(e);const o=/(auto|scroll)/,i=e=>{try{let t=window.getComputedStyle(e,null);return o.test(t.getPropertyValue("overflow"))||o.test(t.getPropertyValue("overflowX"))||o.test(t.getPropertyValue("overflowY"))}catch(t){return!1}};for(let e of n){let n=1===e.nodeType&&e.dataset.scrollselectors;if(n){let o=n.split(",");for(let n of o){let o=dg(e,n);o&&i(o)&&t.push(o)}}9!==e.nodeType&&i(e)&&t.push(e)}}return t}function yg(e){return!(null==e||!e.nodeName||!hg(e))}function bg(e){if(e){let t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth),t}return 0}var _g={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(e){return this._loadedStyleNames.has(e)},setLoadedStyleName:function(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName:function(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};function wg(e){return(wg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function xg(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=pn(!1),o=pn(e),i=pn(null),r="undefined"!=typeof window&&window.document&&window.document.createElement?window.document:void 0,s=t.document,a=void 0===s?r:s,l=t.immediate,c=void 0===l||l,u=t.manual,d=void 0!==u&&u,p=t.name,f=void 0===p?"style_".concat(++Cg):p,h=t.id,m=void 0===h?void 0:h,g=t.media,v=void 0===g?void 0:g,y=t.nonce,b=void 0===y?void 0:y,_=t.first,w=void 0!==_&&_,S=t.onMounted,x=void 0===S?void 0:S,k=t.onUpdated,C=void 0===k?void 0:k,A=t.onLoad,E=void 0===A?void 0:A,O=t.props,L=void 0===O?{}:O,T=function(){},I=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(a){var s=xg(xg({},L),r),l=s.name||f,c=s.id||m,u=s.nonce||b;i.value=a.querySelector('style[data-primevue-style-id="'.concat(l,'"]'))||a.getElementById(c)||a.createElement("style"),i.value.isConnected||(o.value=t||e,cg(i.value,{type:"text/css",id:c,media:v,nonce:u}),w?a.head.prepend(i.value):a.head.appendChild(i.value),function(e,t="",n){lg(e)&&null!=n&&e.setAttribute(t,n)}(i.value,"data-primevue-style-id",l),cg(i.value,s),i.value.onload=function(e){return null==E?void 0:E(e,{name:l})},null==x||x(l)),n.value||(T=bi(o,(function(e){i.value.textContent=e,null==C||C(l)}),{immediate:!0}),n.value=!0)}};return c&&!d&&function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ar()?oo(e):t?e():Pn(e)}(I),{id:m,name:f,el:i,css:o,unload:function(){a&&n.value&&(T(),yg(i.value)&&a.head.removeChild(i.value),n.value=!1)},load:I,isLoaded:Qt(n)}}function Eg(e){return(Eg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Og(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,s,a=[],l=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t);else for(;!(l=(o=r.call(n)).done)&&(a.push(o.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Lg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return e})(km(e,{dt:qm}));return n?Ag(Nm(n),Ig({name:this.name},t)):{}},loadCSS:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.load(this.css,e)},loadTheme:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.load(this.theme,t,(function(n){return og.transformCSS(t.name||e.name,n)}))},getCommonTheme:function(e){return og.getCommon(this.name,e)},getComponentTheme:function(e){return og.getComponent(this.name,e)},getDirectiveTheme:function(e){return og.getDirective(this.name,e)},getPresetTheme:function(e,t,n){return og.getCustomPreset(this.name,e,t,n)},getLayerOrderThemeCSS:function(){return og.getLayerOrderCSS(this.name)},getStyleSheet:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.css){var n=km(this.css,{dt:qm}),o=Nm("".concat(n).concat(e)),i=Object.entries(t).reduce((function(e,t){var n=Og(t,2),o=n[0],i=n[1];return e.push("".concat(o,'="').concat(i,'"'))&&e}),[]).join(" ");return'")}return""},getCommonThemeStyleSheet:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return og.getCommonStyleSheet(this.name,e,t)},getThemeStyleSheet:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[og.getStyleSheet(this.name,e,t)];if(this.theme){var o="base"===this.name?"global-style":"".concat(this.name,"-style"),i=km(this.theme,{dt:qm}),r=Nm(og.transformCSS(o,i)),s=Object.entries(t).reduce((function(e,t){var n=Og(t,2),o=n[0],i=n[1];return e.push("".concat(o,'="').concat(i,'"'))&&e}),[]).join(" ");n.push('"))}return n.join("")},extend:function(e){return Ig(Ig({},this),{},{css:void 0,theme:void 0},e)}},Dg={};var jg=function(){let e=[];const t=(t,n,o=0)=>[...e].reverse().find((e=>!0))||{key:t,value:o},n=e=>e&&parseInt(e.style.zIndex,10)||0;return{get:n,set:(n,o,i)=>{o&&(o.style.zIndex=String(((n,o,i=999)=>{const r=t(n,o,i),s=r.value+(r.key===n?0:i)+1;return e.push({key:n,value:s}),s})(n,!0,i)))},clear:t=>{var o;t&&(o=n(t),e=e.filter((e=>e.value!==o)),t.style.zIndex="")},getCurrent:e=>(e=>t(e).value)(e)}}();function Mg(e){return(Mg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rg(e,t,n){return t&&function(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:function(){};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.listener=n}),[{key:"bindScrollListener",value:function(){this.scrollableParents=vg(this.element);for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:"pv_id_")}var Fg=Pg.extend({name:"common"});function Ug(e){return(Ug="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zg(e){return Zg(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wg(e)||Hg()}function Vg(e,t){return Zg(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,s,a=[],l=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=r.call(n)).done)&&(a.push(o.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Wg(e,t)||Hg()}function Hg(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Wg(e,t){if(e){if("string"==typeof e)return Yg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yg(e,t):void 0}}function Yg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:function(){};_g.clearLoadedStyleNames(),Wm.on("theme:change",e)},_getHostInstance:function(e){return e?this.$options.hostName?e.$.type.name===this.$options.hostName?e:this._getHostInstance(e.$parentInstance):e.$parentInstance:void 0},_getPropValue:function(e){var t;return this[e]||(null===(t=this._getHostInstance(this))||void 0===t?void 0:t[e])},_getOptionValue:function(e){return Em(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})},_getPTValue:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=/./g.test(n)&&!!o[n.split(".")[0]],s=this._getPropValue("ptOptions")||(null===(e=this.$primevueConfig)||void 0===e?void 0:e.ptOptions)||{},a=s.mergeSections,l=void 0===a||a,c=s.mergeProps,u=void 0!==c&&c,d=i?r?this._useGlobalPT(this._getPTClassValue,n,o):this._useDefaultPT(this._getPTClassValue,n,o):void 0,p=r?void 0:this._getPTSelf(t,this._getPTClassValue,n,Xg(Xg({},o),{},{global:d||{}})),f=this._getPTDatasets(n);return l||!l&&p?u?this._mergeProps(u,d,p,f):Xg(Xg(Xg({},d),p),f):Xg(Xg({},p),f)},_getPTSelf:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=new Array(t>1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:"",o="data-pc-",i="root"===n&&Sm(null===(e=this.pt)||void 0===e?void 0:e["data-pc-section"]);return"transition"!==n&&Xg(Xg({},"root"===n&&Xg(Qg({},"".concat(o,"name"),Am(i?null===(t=this.pt)||void 0===t?void 0:t["data-pc-section"]:this.$.type.name)),i&&Qg({},"".concat(o,"extend"),Am(this.$.type.name)))),{},Qg({},"".concat(o,"section"),Am(n)))},_getPTClassValue:function(){var e=this._getOptionValue.apply(this,arguments);return Cm(e)||Om(e)?{class:e}:e},_getPT:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2?arguments[2]:void 0,i=function(e){var i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=o?o(e):e,a=Am(n),l=Am(t.$name);return null!==(i=r?a!==l?null==s?void 0:s[a]:void 0:null==s?void 0:s[a])&&void 0!==i?i:s};return null!=e&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:i(e.originalValue),value:i(e.value)}:i(e,!0)},_usePT:function(e,t,n,o){var i=function(e){return t(e,n,o)};if(null!=e&&e.hasOwnProperty("_usept")){var r,s=e._usept||(null===(r=this.$primevueConfig)||void 0===r?void 0:r.ptOptions)||{},a=s.mergeSections,l=void 0===a||a,c=s.mergeProps,u=void 0!==c&&c,d=i(e.originalValue),p=i(e.value);if(void 0===d&&void 0===p)return;return Cm(p)?p:Cm(d)?d:l||!l&&p?u?this._mergeProps(u,d,p):Xg(Xg({},d),p):p}return i(e)},_useGlobalPT:function(e,t,n){return this._usePT(this.globalPT,e,t,n)},_useDefaultPT:function(e,t,n){return this._usePT(this.defaultPT,e,t,n)},ptm:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._getPTValue(this.pt,e,Xg(Xg({},this.$params),t))},ptmi:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nr(this.$_attrsWithoutPT,this.ptm(e,t))},ptmo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._getPTValue(e,t,Xg({instance:this},n),!1)},cx:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,e,Xg(Xg({},this.$params),t))},sx:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var n=this._getOptionValue(this.$style.inlineStyles,e,Xg(Xg({},this.$params),t));return[this._getOptionValue(Fg.inlineStyles,e,Xg(Xg({},this.$params),t)),n]}}},computed:{globalPT:function(){var e,t=this;return this._getPT(null===(e=this.$primevueConfig)||void 0===e?void 0:e.pt,void 0,(function(e){return km(e,{instance:t})}))},defaultPT:function(){var e,t=this;return this._getPT(null===(e=this.$primevueConfig)||void 0===e?void 0:e.pt,void 0,(function(e){return t._getOptionValue(e,t.$name,Xg({},t.$params))||km(e,Xg({},t.$params))}))},isUnstyled:function(){var e;return void 0!==this.unstyled?this.unstyled:null===(e=this.$primevueConfig)||void 0===e?void 0:e.unstyled},$theme:function(){var e;return null===(e=this.$primevueConfig)||void 0===e?void 0:e.theme},$style:function(){return Xg(Xg({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var e;return{nonce:null===(e=this.$primevueConfig)||void 0===e||null===(e=e.csp)||void 0===e?void 0:e.nonce}},$primevueConfig:function(){var e;return null===(e=this.$primevue)||void 0===e?void 0:e.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var e=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:e,props:null==e?void 0:e.$props,state:null==e?void 0:e.$data,attrs:null==e?void 0:e.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter((function(e){var t=Vg(e,1)[0];return null==t?void 0:t.startsWith("pt:")})).reduce((function(e,t){var n=Vg(t,2),o=n[0],i=n[1],r=zg(o.split(":")).slice(1);return null==r||r.reduce((function(e,t,n,o){return!e[t]&&(e[t]=n===o.length-1?i:{}),e[t]}),e),e}),{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter((function(e){var t=Vg(e,1)[0];return!(null!=t&&t.startsWith("pt:"))})).reduce((function(e,t){var n=Vg(t,2),o=n[0],i=n[1];return e[o]=i,e}),{})},$attrSelector:function(){return Bg("pc")}}},qg=Pg.extend({name:"baseicon",css:"\n.p-icon {\n display: inline-block;\n vertical-align: baseline;\n}\n\n.p-icon-spin {\n -webkit-animation: p-icon-spin 2s infinite linear;\n animation: p-icon-spin 2s infinite linear;\n}\n\n@-webkit-keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n@keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n"});function ev(e){return(ev="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function nv(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,o=Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=function(){var e=gv._getOptionValue.apply(gv,arguments);return Cm(e)||Om(e)?{class:e}:e},l=(null===(e=n.binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.ptOptions)||(null===(t=n.$primevueConfig)||void 0===t?void 0:t.ptOptions)||{},c=l.mergeSections,u=void 0===c||c,d=l.mergeProps,p=void 0!==d&&d,f=s?gv._useDefaultPT(n,n.defaultPT(),a,i,r):void 0,h=gv._usePT(n,gv._getPT(o,n.$name),a,i,hv(hv({},r),{},{global:f||{}})),m=gv._getPTDatasets(n,i);return u||!u&&h?p?gv._mergeProps(n,p,f,h,m):hv(hv(hv({},f),h),m):hv(hv({},h),m)},_getPTDatasets:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="data-pc-";return hv(hv({},"root"===t&&mv({},"".concat(n,"name"),Am(e.$name))),{},mv({},"".concat(n,"section"),Am(t)))},_getPT:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,o=function(e){var o,i=n?n(e):e,r=Am(t);return null!==(o=null==i?void 0:i[r])&&void 0!==o?o:i};return null!=e&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:o(e.originalValue),value:o(e.value)}:o(e)},_usePT:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=function(e){return n(e,o,i)};if(null!=t&&t.hasOwnProperty("_usept")){var s,a=t._usept||(null===(s=e.$primevueConfig)||void 0===s?void 0:s.ptOptions)||{},l=a.mergeSections,c=void 0===l||l,u=a.mergeProps,d=void 0!==u&&u,p=r(t.originalValue),f=r(t.value);if(void 0===p&&void 0===f)return;return Cm(f)?f:Cm(p)?p:c||!c&&f?d?gv._mergeProps(e,d,p,f):hv(hv({},p),f):f}return r(t)},_useDefaultPT:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return gv._usePT(e,t,n,o,i)},_loadStyles:function(e,t,n){var o,i=gv._getConfig(t,n),r={nonce:null==i||null===(o=i.csp)||void 0===o?void 0:o.nonce};gv._loadCoreStyles(e.$instance,r),gv._loadThemeStyles(e.$instance,r),gv._loadScopedThemeStyles(e.$instance,r),gv._themeChangeListener((function(){return gv._loadThemeStyles(e.$instance,r)}))},_loadCoreStyles:function(){var e,t,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;!_g.isStyleNameLoaded(null===(e=o.$style)||void 0===e?void 0:e.name)&&null!==(t=o.$style)&&void 0!==t&&t.name&&(Pg.loadCSS(i),o.isUnstyled()&&(null===(n=o.$style)||void 0===n||n.loadCSS(i)),_g.setLoadedStyleName(o.$style.name))},_loadThemeStyles:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(null==n||!n.isUnstyled()){if(!og.isStyleNameLoaded("common")){var i,r,s=(null===(i=n.$style)||void 0===i||null===(r=i.getCommonTheme)||void 0===r?void 0:r.call(i))||{},a=s.primitive,l=s.semantic;Pg.load(null==a?void 0:a.css,hv({name:"primitive-variables"},o)),Pg.load(null==l?void 0:l.css,hv({name:"semantic-variables"},o)),Pg.loadTheme(hv({name:"global-style"},o)),og.setLoadedStyleName("common")}if(!og.isStyleNameLoaded(null===(e=n.$style)||void 0===e?void 0:e.name)&&null!==(t=n.$style)&&void 0!==t&&t.name){var c,u,d,p,f=((null===(c=n.$style)||void 0===c||null===(u=c.getDirectiveTheme)||void 0===u?void 0:u.call(c))||{}).css;null===(d=n.$style)||void 0===d||d.load(f,hv({name:"".concat(n.$style.name,"-variables")},o)),null===(p=n.$style)||void 0===p||p.loadTheme(hv({name:"".concat(n.$style.name,"-style")},o)),og.setLoadedStyleName(n.$style.name)}if(!og.isStyleNameLoaded("layer-order")){var h,m,g=null===(h=n.$style)||void 0===h||null===(m=h.getLayerOrderThemeCSS)||void 0===m?void 0:m.call(h);Pg.load(g,hv({name:"layer-order",first:!0},o)),og.setLoadedStyleName("layer-order")}}},_loadScopedThemeStyles:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e.preset();if(n&&e.$attrSelector){var o,i,r,s=((null===(o=e.$style)||void 0===o||null===(i=o.getPresetTheme)||void 0===i?void 0:i.call(o,n,"[".concat(e.$attrSelector,"]")))||{}).css,a=null===(r=e.$style)||void 0===r?void 0:r.load(s,hv({name:"".concat(e.$attrSelector,"-").concat(e.$style.name)},t));e.scopedStyleEl=a.el}},_themeChangeListener:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};_g.clearLoadedStyleNames(),Wm.on("theme:change",e)},_hook:function(e,t,n,o,i,r){var s,a,l,c="on".concat(Cm(l=t,!1)?l[0].toUpperCase()+l.slice(1):l),u=gv._getConfig(o,i),d=null==n?void 0:n.$instance,p=gv._usePT(d,gv._getPT(null==o||null===(s=o.value)||void 0===s?void 0:s.pt,e),gv._getOptionValue,"hooks.".concat(c)),f=gv._useDefaultPT(d,null==u||null===(a=u.pt)||void 0===a||null===(a=a.directives)||void 0===a?void 0:a[e],gv._getOptionValue,"hooks.".concat(c)),h={el:n,binding:o,vnode:i,prevVnode:r};null==p||p(d,h),null==f||f(d,h)},_mergeProps:function(){for(var e=arguments.length>1?arguments[1]:void 0,t=arguments.length,n=new Array(t>2?t-2:0),o=2;o1&&void 0!==arguments[1]?arguments[1]:{},n=function(n,o,i,r,s){var a,l,c;o._$instances=o._$instances||{};var u=gv._getConfig(i,r),d=o._$instances[e]||{},p=_m(d)?hv(hv({},t),null==t?void 0:t.methods):{};o._$instances[e]=hv(hv({},d),{},{$name:e,$host:o,$binding:i,$modifiers:null==i?void 0:i.modifiers,$value:null==i?void 0:i.value,$el:d.$el||o||void 0,$style:hv({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},null==t?void 0:t.style),$primevueConfig:u,$attrSelector:o.$attrSelector,defaultPT:function(){return gv._getPT(null==u?void 0:u.pt,void 0,(function(t){var n;return null==t||null===(n=t.directives)||void 0===n?void 0:n[e]}))},isUnstyled:function(){var e,t;return void 0!==(null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.unstyled)?null===(t=o.$instance)||void 0===t||null===(t=t.$binding)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.unstyled:null==u?void 0:u.unstyled},theme:function(){var e;return null===(e=o.$instance)||void 0===e||null===(e=e.$primevueConfig)||void 0===e?void 0:e.theme},preset:function(){var e;return null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.dt},ptm:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gv._getPTValue(o.$instance,null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.pt,t,hv({},n))},ptmo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return gv._getPTValue(o.$instance,e,t,n,!1)},cx:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null!==(e=o.$instance)&&void 0!==e&&e.isUnstyled()?void 0:gv._getOptionValue(null===(t=o.$instance)||void 0===t||null===(t=t.$style)||void 0===t?void 0:t.classes,n,hv({},i))},sx:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?gv._getOptionValue(null===(e=o.$instance)||void 0===e||null===(e=e.$style)||void 0===e?void 0:e.inlineStyles,t,hv({},n)):void 0}},p),o.$instance=o._$instances[e],null===(a=(l=o.$instance)[n])||void 0===a||a.call(l,o,i,r,s),o["$".concat(e)]=o.$instance,gv._hook(e,n,o,i,r,s),o.$pd||(o.$pd={}),o.$pd[e]=hv(hv({},null===(c=o.$pd)||void 0===c?void 0:c[e]),{},{name:e,instance:o.$instance})};return{created:function(e,t,o,i){n("created",e,t,o,i)},beforeMount:function(e,t,o,i){e.$attrSelector=Bg("pd"),gv._loadStyles(e,t,o),n("beforeMount",e,t,o,i),function(e){var t,n,o,i,r,s=null===(t=e.$instance)||void 0===t?void 0:t.watch;null==s||null===(n=s.config)||void 0===n||n.call(e.$instance,null===(o=e.$instance)||void 0===o?void 0:o.$primevueConfig),cv.on("config:change",(function(t){var n,o=t.newValue,i=t.oldValue;return null==s||null===(n=s.config)||void 0===n?void 0:n.call(e.$instance,o,i)})),null==s||null===(i=s["config.ripple"])||void 0===i||i.call(e.$instance,null===(r=e.$instance)||void 0===r||null===(r=r.$primevueConfig)||void 0===r?void 0:r.ripple),cv.on("config:ripple:change",(function(t){var n,o=t.newValue,i=t.oldValue;return null==s||null===(n=s["config.ripple"])||void 0===n?void 0:n.call(e.$instance,o,i)}))}(e)},mounted:function(e,t,o,i){gv._loadStyles(e,t,o),n("mounted",e,t,o,i)},beforeUpdate:function(e,t,o,i){n("beforeUpdate",e,t,o,i)},updated:function(e,t,o,i){gv._loadStyles(e,t,o),n("updated",e,t,o,i)},beforeUnmount:function(e,t,o,i){n("beforeUnmount",e,t,o,i)},unmounted:function(e,t,o,i){var r;null===(r=e.$instance)||void 0===r||null===(r=r.scopedStyleEl)||void 0===r||null===(r=r.value)||void 0===r||r.remove(),n("unmounted",e,t,o,i)}}},extend:function(){var e=dv(gv._getMeta.apply(gv,arguments),2),t=e[0],n=e[1];return hv({extend:function(){var e=dv(gv._getMeta.apply(gv,arguments),2),t=e[0],o=e[1];return gv.extend(t,hv(hv(hv({},n),null==n?void 0:n.methods),o))}},gv._extend(t,n))}},vv=Pg.extend({name:"ripple-directive",theme:function(e){var t=e.dt;return"\n.p-ink {\n display: block;\n position: absolute;\n background: ".concat(t("ripple.background"),";\n border-radius: 100%;\n transform: scale(0);\n pointer-events: none;\n}\n\n.p-ink-active {\n animation: ripple 0.4s linear;\n}\n\n@keyframes ripple {\n 100% {\n opacity: 0;\n transform: scale(2.5);\n }\n}\n")},classes:{root:"p-ink"}});function yv(e){return(yv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bv(e){return function(e){if(Array.isArray(e))return _v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return _v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_v(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);ne.length)&&(t=e.length);for(var n=0,o=Array(t);n0||navigator.msMaxTouchPoints>0||o.hide(e),window.removeEventListener("resize",t)})),n.addEventListener("mouseleave",(function t(){o.hide(e),n.removeEventListener("mouseleave",t)})),this.bindScrollListener(e),jg.set("tooltip",n,e.$_ptooltipZIndex)}},show:function(e,t,n){var o=this;void 0!==n?this.timer=setTimeout((function(){return o.tooltipActions(e,t)}),n):this.tooltipActions(e,t)},tooltipRemoval:function(e){this.remove(e),this.unbindScrollListener(e)},hide:function(e,t){var n=this;clearTimeout(this.timer),void 0!==t?setTimeout((function(){return n.tooltipRemoval(e)}),t):this.tooltipRemoval(e)},getTooltipElement:function(e){return document.getElementById(e.$_ptooltipId)},create:function(e){var t=e.$_ptooltipModifiers,n=ug("div",{class:!this.isUnstyled()&&this.cx("arrow"),"p-bind":this.ptm("arrow",{context:t})}),o=ug("div",{class:!this.isUnstyled()&&this.cx("text"),"p-bind":this.ptm("text",{context:t})});e.$_ptooltipEscape?(o.innerHTML="",o.appendChild(document.createTextNode(e.$_ptooltipValue))):o.innerHTML=e.$_ptooltipValue;var i=ug("div",Iv(Iv({id:e.$_ptooltipIdAttr,role:"tooltip",style:{display:"inline-block",width:e.$_ptooltipFitContent?"fit-content":void 0,pointerEvents:!this.isUnstyled()&&e.$_ptooltipAutoHide&&"none"},class:[!this.isUnstyled()&&this.cx("root"),e.$_ptooltipClass]},this.$attrSelector,""),"p-bind",this.ptm("root",{context:t})),n,o);return document.body.appendChild(i),e.$_ptooltipId=i.id,this.$el=i,i},remove:function(e){if(e){var t=this.getTooltipElement(e);t&&t.parentElement&&(jg.clear(t),document.body.removeChild(t)),e.$_ptooltipId=null}},align:function(e){var t=e.$_ptooltipModifiers;t.top?(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignTop(e))):t.left?(this.alignLeft(e),this.isOutOfBounds(e)&&(this.alignRight(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignLeft(e))))):t.bottom?(this.alignBottom(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&this.alignBottom(e))):(this.alignRight(e),this.isOutOfBounds(e)&&(this.alignLeft(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignRight(e)))))},getHostOffset:function(e){var t=e.getBoundingClientRect();return{left:t.left+function(){let e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}(),top:t.top+function(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}()}},alignRight:function(e){this.preAlign(e,"right");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+ag(e),i=n.top+(mg(e)-mg(t))/2;t.style.left=o+"px",t.style.top=i+"px"},alignLeft:function(e){this.preAlign(e,"left");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left-ag(t),i=n.top+(mg(e)-mg(t))/2;t.style.left=o+"px",t.style.top=i+"px"},alignTop:function(e){this.preAlign(e,"top");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+(ag(e)-ag(t))/2,i=n.top-mg(t);t.style.left=o+"px",t.style.top=i+"px"},alignBottom:function(e){this.preAlign(e,"bottom");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+(ag(e)-ag(t))/2,i=n.top+mg(e);t.style.left=o+"px",t.style.top=i+"px"},preAlign:function(e,t){var n=this.getTooltipElement(e);n.style.left="-999px",n.style.top="-999px",sg(n,"p-tooltip-".concat(n.$_ptooltipPosition)),!this.isUnstyled()&&rg(n,"p-tooltip-".concat(t)),n.$_ptooltipPosition=t,n.setAttribute("data-p-position",t);var o=dg(n,'[data-pc-section="arrow"]');o.style.top="bottom"===t?"0":"right"===t||"left"===t||"right"!==t&&"left"!==t&&"top"!==t&&"bottom"!==t?"50%":null,o.style.bottom="top"===t?"0":null,o.style.left="right"===t||"right"!==t&&"left"!==t&&"top"!==t&&"bottom"!==t?"0":"top"===t||"bottom"===t?"50%":null,o.style.right="left"===t?"0":null},isOutOfBounds:function(e){var t=this.getTooltipElement(e),n=t.getBoundingClientRect(),o=n.top,i=n.left,r=ag(t),s=mg(t),a=function(){let e=window,t=document,n=t.documentElement,o=t.getElementsByTagName("body")[0];return{width:e.innerWidth||n.clientWidth||o.clientWidth,height:e.innerHeight||n.clientHeight||o.clientHeight}}();return i+r>a.width||i<0||o<0||o+s>a.height},getTarget:function(e){return ig(e,"p-inputwrapper")?dg(e,"input"):e},getModifiers:function(e){return e.modifiers&&Object.keys(e.modifiers).length?e.modifiers:e.arg&&"object"===Nv(e.arg)?Object.entries(e.arg).reduce((function(e,t){var n=Lv(t,2),o=n[0],i=n[1];return"event"!==o&&"position"!==o||(e[i]=!0),e}),{}):{}}}}),Dv={name:"Card",extends:{name:"BaseCard",extends:Jg,style:Pg.extend({name:"card",theme:function(e){var t=e.dt;return"\n.p-card {\n background: ".concat(t("card.background"),";\n color: ").concat(t("card.color"),";\n box-shadow: ").concat(t("card.shadow"),";\n border-radius: ").concat(t("card.border.radius"),";\n display: flex;\n flex-direction: column;\n}\n\n.p-card-caption {\n display: flex;\n flex-direction: column;\n gap: ").concat(t("card.caption.gap"),";\n}\n\n.p-card-body {\n padding: ").concat(t("card.body.padding"),";\n display: flex;\n flex-direction: column;\n gap: ").concat(t("card.body.gap"),";\n}\n\n.p-card-title {\n font-size: ").concat(t("card.title.font.size"),";\n font-weight: ").concat(t("card.title.font.weight"),";\n}\n\n.p-card-subtitle {\n color: ").concat(t("card.subtitle.color"),";\n}\n")},classes:{root:"p-card p-component",header:"p-card-header",body:"p-card-body",caption:"p-card-caption",title:"p-card-title",subtitle:"p-card-subtitle",content:"p-card-content",footer:"p-card-footer"}}),provide:function(){return{$pcCard:this,$parentInstance:this}}},inheritAttrs:!1};Dv.render=function(e,t,n,o,i,r){return $i(),Ui("div",nr({class:e.cx("root")},e.ptmi("root")),[e.$slots.header?($i(),Ui("div",nr({key:0,class:e.cx("header")},e.ptm("header")),[_o(e.$slots,"header")],16)):Ji("",!0),Zi("div",nr({class:e.cx("body")},e.ptm("body")),[e.$slots.title||e.$slots.subtitle?($i(),Ui("div",nr({key:0,class:e.cx("caption")},e.ptm("caption")),[e.$slots.title?($i(),Ui("div",nr({key:0,class:e.cx("title")},e.ptm("title")),[_o(e.$slots,"title")],16)):Ji("",!0),e.$slots.subtitle?($i(),Ui("div",nr({key:1,class:e.cx("subtitle")},e.ptm("subtitle")),[_o(e.$slots,"subtitle")],16)):Ji("",!0)],16)):Ji("",!0),Zi("div",nr({class:e.cx("content")},e.ptm("content")),[_o(e.$slots,"content")],16),e.$slots.footer?($i(),Ui("div",nr({key:1,class:e.cx("footer")},e.ptm("footer")),[_o(e.$slots,"footer")],16)):Ji("",!0)],16)],16)};const jv={class:"no-result-placeholder"},Mv={class:"no-result-placeholder-content"},Rv={key:0},$v={__name:"noResultsPlaceholder",props:{icon:{type:String,default:"",required:!1},iconSize:{type:String,default:"3rem",required:!1},title:{type:String,required:!0},message:{type:String,required:!1},buttonLabel:{type:String,default:"",required:!1}},emits:["action"],setup:e=>(t,n)=>($i(),Ui("div",jv,[Ki(hn(Dv),null,{content:Vn((()=>[Zi("div",Mv,[Zi("i",{class:Me(e.icon),style:Ie({"font-size":e.iconSize,"margin-bottom":".5rem"})},null,6),Zi("h3",null,Be(e.title),1),e.message?($i(),Ui("p",Rv,Be(e.message),1)):Ji("",!0),e.buttonLabel?($i(),zi(hn(Ev),{key:1,label:e.buttonLabel,onClick:n[0]||(n[0]=e=>t.$emit("action")),class:"p-button-text"},null,8,["label"])):Ji("",!0)])])),_:1})]))};var Gv=Pg.extend({name:"inputtext",theme:function(e){var t=e.dt;return"\n.p-inputtext {\n font-family: inherit;\n font-feature-settings: inherit;\n font-size: 1rem;\n color: ".concat(t("inputtext.color"),";\n background: ").concat(t("inputtext.background"),";\n padding: ").concat(t("inputtext.padding.y")," ").concat(t("inputtext.padding.x"),";\n border: 1px solid ").concat(t("inputtext.border.color"),";\n transition: background ").concat(t("inputtext.transition.duration"),", color ").concat(t("inputtext.transition.duration"),", border-color ").concat(t("inputtext.transition.duration"),", outline-color ").concat(t("inputtext.transition.duration"),", box-shadow ").concat(t("inputtext.transition.duration"),";\n appearance: none;\n border-radius: ").concat(t("inputtext.border.radius"),";\n outline-color: transparent;\n box-shadow: ").concat(t("inputtext.shadow"),";\n}\n\n.p-inputtext:enabled:hover {\n border-color: ").concat(t("inputtext.hover.border.color"),";\n}\n\n.p-inputtext:enabled:focus {\n border-color: ").concat(t("inputtext.focus.border.color"),";\n box-shadow: ").concat(t("inputtext.focus.ring.shadow"),";\n outline: ").concat(t("inputtext.focus.ring.width")," ").concat(t("inputtext.focus.ring.style")," ").concat(t("inputtext.focus.ring.color"),";\n outline-offset: ").concat(t("inputtext.focus.ring.offset"),";\n}\n\n.p-inputtext.p-invalid {\n border-color: ").concat(t("inputtext.invalid.border.color"),";\n}\n\n.p-inputtext.p-variant-filled {\n background: ").concat(t("inputtext.filled.background"),";\n}\n\n.p-inputtext.p-variant-filled:enabled:focus {\n background: ").concat(t("inputtext.filled.focus.background"),";\n}\n\n.p-inputtext:disabled {\n opacity: 1;\n background: ").concat(t("inputtext.disabled.background"),";\n color: ").concat(t("inputtext.disabled.color"),";\n}\n\n.p-inputtext::placeholder {\n color: ").concat(t("inputtext.placeholder.color"),";\n}\n\n.p-inputtext-sm {\n font-size: ").concat(t("inputtext.sm.font.size"),";\n padding: ").concat(t("inputtext.sm.padding.y")," ").concat(t("inputtext.sm.padding.x"),";\n}\n\n.p-inputtext-lg {\n font-size: ").concat(t("inputtext.lg.font.size"),";\n padding: ").concat(t("inputtext.lg.padding.y")," ").concat(t("inputtext.lg.padding.x"),";\n}\n\n.p-inputtext-fluid {\n width: 100%;\n}\n")},classes:{root:function(e){var t=e.instance,n=e.props;return["p-inputtext p-component",{"p-filled":t.filled,"p-inputtext-sm":"small"===n.size,"p-inputtext-lg":"large"===n.size,"p-invalid":n.invalid,"p-variant-filled":n.variant?"filled"===n.variant:"filled"===t.$primevue.config.inputStyle||"filled"===t.$primevue.config.inputVariant,"p-inputtext-fluid":t.hasFluid}]}}}),Bv={name:"InputText",extends:{name:"BaseInputText",extends:Jg,props:{modelValue:null,size:{type:String,default:null},invalid:{type:Boolean,default:!1},variant:{type:String,default:null},fluid:{type:Boolean,default:null}},style:Gv,provide:function(){return{$pcInputText:this,$parentInstance:this}}},inheritAttrs:!1,emits:["update:modelValue"],inject:{$pcFluid:{default:null}},methods:{getPTOptions:function(e){return("root"===e?this.ptmi:this.ptm)(e,{context:{filled:this.filled,disabled:this.$attrs.disabled||""===this.$attrs.disabled}})},onInput:function(e){this.$emit("update:modelValue",e.target.value)}},computed:{filled:function(){return null!=this.modelValue&&this.modelValue.toString().length>0},hasFluid:function(){return _m(this.fluid)?!!this.$pcFluid:this.fluid}}},Fv=["value","aria-invalid"];Bv.render=function(e,t,n,o,i,r){return $i(),Ui("input",nr({type:"text",class:e.cx("root"),value:e.modelValue,"aria-invalid":e.invalid||void 0,onInput:t[0]||(t[0]=function(){return r.onInput&&r.onInput.apply(r,arguments)})},r.getPTOptions("root")),null,16,Fv)};const Uv={class:"left flex-1"},zv={key:1,class:"edit"},Vv={key:2,class:"label"},Hv={class:"right toolbar"},Wv={key:0,class:"nodes"},Yv={__name:"group",props:{item:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup(e){const t=e,n=np(),o=pn(!1),i=pn(null),r=pn(""),s=e=>{var o,i;let r=t.item;if(!(null==(o=r.info)?void 0:o.is_edit)&&(null==(i=r.children)?void 0:i.length)>0){let e=y.canvas.graph._groups.find((e=>e.pos[0]==r.info.pos[0]&&e.pos[1]==r.info.pos[1]));e&&(e.show_nodes=!e.show_nodes,n.setGroups(y.canvas.graph._groups))}},a=async()=>{let e=t.item,i=y.canvas.graph._groups.find((t=>t.pos[0]==e.info.pos[0]&&t.pos[1]==e.info.pos[1]));i?(i.is_edit=!1,i.title=r.value,await n.setGroups(y.canvas.graph._groups),o.value=!1):o.value=!1};return(l,c)=>{var u,d,p;return $i(),Ui(Ni,null,[Zi("div",{class:Me("comfyui-easyuse-map-nodes-group"),onClick:s},[Zi("div",Uv,[e.item.children?($i(),Ui("i",{key:0,class:Me(["icon",e.item.info.show_nodes?"pi pi-folder-open":"pi pi-folder"]),style:Ie({color:e.item.info.color})},null,6)):Ji("",!0),(null==(u=e.item.info)?void 0:u.is_edit)?($i(),Ui("div",zv,[Ki(hn(Bv),{ref_key:"modifyRef",ref:i,modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=e=>r.value=e),variant:"outline",size:"small",type:"text",onBlur:a,onKeydown:[qr(a,["enter"]),qr(a,["esc"])],style:{width:"100%"}},null,8,["modelValue"])])):($i(),Ui("div",Vv,[Zi("span",{onDblclick:c[1]||(c[1]=Qr((s=>(async()=>{var e,s;if(o.value)return;let a=t.item,l=y.canvas.graph._groups.find((e=>e.pos[0]==a.info.pos[0]&&e.pos[1]==a.info.pos[1]));l&&(l.is_edit=!l.is_edit,r.value=l.is_edit?a.info.title:"",await n.setGroups(y.canvas.graph._groups),o.value=!0,null==(s=null==(e=i.value)?void 0:e[0])||s.$el.focus())})(e.item)),["stop"]))},Be(e.item.info.title),33)]))]),Zi("div",Hv,[(null==(d=e.item.children)?void 0:d.length)>0?($i(),zi(hn(Ev),{key:0,size:"small",icon:e.item.children.find((e=>e.mode==hn(j).ALWAYS))?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:c[2]||(c[2]=Qr((e=>l.$emit("changeMode")),["stop"])),onMousedown:c[3]||(c[3]=Qr((e=>l.$emit("mousedown")),["stop"])),onMouseup:c[4]||(c[4]=Qr((e=>l.$emit("mouseup")),["stop"]))},null,8,["icon"])):Ji("",!0)])]),(null==(p=e.item.children)?void 0:p.length)>0&&e.item.info.show_nodes?($i(),Ui("div",Wv,[_o(l.$slots,"default")])):Ji("",!0)],64)}}},Zv={key:1,class:"label error"},Kv={class:"right toolbar"},Xv={__name:"node",props:{node:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup:e=>(t,n)=>($i(),Ui("div",{class:Me(["comfyui-easyuse-map-nodes-node",{never:void 0!==e.node.mode&&e.node.mode==hn(j).NEVER},{bypass:void 0!==e.node.mode&&e.node.mode==hn(j).BYPASS}])},[void 0!==e.node.title?($i(),Ui("span",{key:0,class:"label",onDblclick:n[0]||(n[0]=Qr((t=>hn(Lp)(e.node.id)),["stop"]))},Be(e.node.title),33)):($i(),Ui("span",Zv,Be(e.node.type),1)),Zi("div",Kv,[Ki(hn(Ev),{size:"small",icon:e.node.mode==hn(j).ALWAYS?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:n[1]||(n[1]=Qr((e=>t.$emit("changeMode")),["stop"])),onMousedown:n[2]||(n[2]=Qr((e=>t.$emit("mousedown")),["stop"])),onMouseup:n[3]||(n[3]=Qr((e=>t.$emit("mouseup")),["stop"]))},null,8,["icon"])])],2))},Qv={class:"title"},Jv={class:"toolbar"},qv={key:0},ey={key:1,class:"no_result",style:{height:"100%"}},ty="comfyui-easyuse-map-nodes",ny={__name:"nodesMap",setup(e){const t=np(),{groups_nodes:n,groups:o}=ws(t),i=pn(!1),r=e=>{i.value=!i.value,y.canvas.graph._groups.forEach((e=>{e.show_nodes=i.value})),t.setGroups(y.canvas.graph._groups)};let s,a=0,l=0,c=!1;const u=(e,n=!1)=>{if(c)return void(c=!1);const o=e.children.find((e=>e.mode==j.ALWAYS)),i=e.children.map((e=>e.id));y.canvas.graph._nodes.forEach((e=>{i.includes(e.id)&&(e.mode=o?n?j.NEVER:j.BYPASS:j.ALWAYS,e.graph.change())})),t.setNodes(y.canvas.graph._nodes)},d=(e,n=!1)=>{if(c)return void(c=!1);const o=e.mode==j.ALWAYS,i=y.canvas.graph._nodes.find((t=>t.id==e.id));i&&(i.mode=o?n?j.NEVER:j.BYPASS:j.ALWAYS,i.graph.change(),t.setNodes(y.canvas.graph._nodes))},p=(e,t="group")=>{a=(new Date).getTime(),clearTimeout(s),s=setTimeout((n=>{"group"==t?u(e,!0):d(e,!0)}),500)},f=e=>{l=(new Date).getTime(),l-a>500&&(c=!0),clearTimeout(s)};return(e,t)=>{var s,a;return $i(),Ui("div",{class:Me(ty)},[Zi("div",{class:Me(ty+"__header")},[Zi("div",Qv,Be(hn(V)("Nodes Map",!0)),1),Zi("div",Jv,[(null==(s=hn(o))?void 0:s.length)>0?Hn(($i(),zi(hn(Ev),{key:0,icon:i.value?"pi pi-angle-double-down":"pi pi-angle-double-up",text:"",rounded:"",severity:"secondary",onClick:r,size:"small"},null,8,["icon"])),[[hn(Pv),i.value?hn(V)("Collapse All"):hn(V)("Expand All"),void 0,{right:!0}]]):Ji("",!0)])],2),Zi("div",{class:Me(ty+"__content")},[(null==(a=hn(n))?void 0:a.length)>0?($i(),Ui("ol",qv,[($i(!0),Ui(Ni,null,bo(hn(n),((e,t)=>($i(),Ui("li",{key:t},[void 0!==e.children?($i(),zi(Yv,{key:0,item:e,onChangeMode:t=>u(e),onMousedown:t=>p(e,"group"),onMouseup:f},{default:Vn((()=>[($i(!0),Ui(Ni,null,bo(e.children,((e,t)=>($i(),zi(Xv,{key:t,node:e,onChangeMode:t=>d(e),onMousedown:t=>p(e,"node"),onMouseup:f},null,8,["node","onChangeMode","onMousedown"])))),128))])),_:2},1032,["item","onChangeMode","onMousedown"])):($i(),zi(Xv,{key:1,node:e.info,onChangeMode:t=>d(e.info),onMousedown:t=>p(e.info,"node"),onMouseup:f},null,8,["node","onChangeMode","onMousedown"]))])))),128))])):($i(),Ui("div",ey,[Ki($v,{icon:"pi pi-sitemap",title:hn(V)("No Nodes",!0),message:hn(V)("No nodes found in the map",!0)},null,8,["title","message"])]))],2)])}}},oy={__name:"index",setup(e){const t=np();return oo((e=>{t.watchGraph()})),ao((e=>{})),(e,t)=>($i(),Ui("div",{class:Me("comfyui-easyuse-map")},[Ki(ny)]))}},iy={__name:"App",setup(e){const t=e=>{y.extensionManager.registerSidebarTab({id:M,icon:"pi pi-sitemap",title:V("Nodes Map",!0),tooltip:V("Nodes Map",!0),type:"custom",render:e=>{e.style.height="100%",((...e)=>{ns().render(...e)})(function(e,t,n){const o=arguments.length;return 2===o?ue(t)&&!ie(t)?Vi(t)?Ki(e,null,[t]):Ki(e,t):Ki(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):3===o&&Vi(n)&&(n=[n]),Ki(e,t,n))}(oy,{}),e)}})};return oo((e=>{try{t()}catch(n){}})),(e,t)=>($i(),zi(hm))}};var ry="equals",sy="notEquals";function ay(e){return(ay="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function cy(e){for(var t=1;t{const t=ns().createApp(...e),{mount:n}=t;return t.mount=e=>{const o=function(e){if(le(e)){return document.querySelector(e)}return e}(e);if(!o)return;const i=t._component;ae(i)||i.render||i.template||(i.template=o.innerHTML),o.innerHTML="";const r=n(o,!1,function(e){if(e instanceof SVGElement)return"svg";if("function"==typeof MathMLElement&&e instanceof MathMLElement)return"mathml"}(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t})(iy);yy.use(my),yy.use(function(){const e=We(!0),t=e.run((()=>pn({})));let n=[],o=[];const i=rn({install(e){is(i),i._a=e,e.provide(rs,i),e.config.globalProperties.$pinia=i,o.forEach((e=>n.push(e))),o=[]},use(e){return this._a?n.push(e):o.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}()),yy.mount("#"+vy.id); From 763cff49e40384d56ad555f3bfb9b25a5c105936 Mon Sep 17 00:00:00 2001 From: yolain Date: Fri, 16 Aug 2024 01:03:01 +0800 Subject: [PATCH 3/4] Add a notice about remove the poseEditor node --- web_version/v2/easyuse.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/web_version/v2/easyuse.js b/web_version/v2/easyuse.js index 4ad07ba..39dda3d 100644 --- a/web_version/v2/easyuse.js +++ b/web_version/v2/easyuse.js @@ -1,30 +1,30 @@ -!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('@charset "UTF-8";.easyuse-model-info{color:#fff;max-width:90vw;font-family:var(--font-family)}.easyuse-model-content{display:flex;flex-direction:column;overflow:hidden}.easyuse-model-header{margin:0 0 15px}.easyuse-model-header-remark{display:flex;align-items:center;margin-top:5px}.easyuse-model-info h2{text-align:left;margin:0}.easyuse-model-info h5{text-align:left;margin:0 15px 0 0;font-weight:400;color:var(--descrip-text)}.easyuse-model-info p{margin:5px 0}.easyuse-model-info a{color:var(--theme-color-light)}.easyuse-model-info a:hover{text-decoration:underline}.easyuse-model-tags-list{display:flex;flex-wrap:wrap;list-style:none;gap:10px;max-height:200px;overflow:auto;margin:10px 0;padding:0}.easyuse-model-tag{background-color:var(--comfy-input-bg);border:2px solid var(--border-color);color:var(--input-text);display:flex;align-items:center;gap:5px;border-radius:5px;padding:2px 5px;cursor:pointer}.easyuse-model-tag--selected span:before{content:"✅";position:absolute;background-color:var(--theme-color-light);left:0;top:0;right:0;bottom:0;text-align:center}.easyuse-model-tag:hover{border:2px solid var(--theme-color-light)}.easyuse-model-tag p{margin:0}.easyuse-model-tag span{text-align:center;border-radius:5px;background-color:var(--theme-color-light);padding:2px;position:relative;min-width:20px;overflow:hidden;color:#fff}.easyuse-model-metadata .comfy-modal-content{max-width:100%}.easyuse-model-metadata label{margin-right:1ch;color:#ccc}.easyuse-model-metadata span{color:var(--theme-color-light)}.easyuse-preview{max-width:660px;margin-right:15px;position:relative}.easyuse-preview-group{position:relative;overflow:hidden;border-radius:.5rem;width:660px}.easyuse-preview-list{display:flex;flex-wrap:nowrap;width:100%;transition:all .5s ease-in-out}.easyuse-preview-list.no-transition{transition:none}.easyuse-preview-slide{display:flex;flex-basis:calc(50% - 5px);flex-grow:0;flex-shrink:0;position:relative;justify-content:center;align-items:center;padding-right:5px;padding-left:0}.easyuse-preview-slide:nth-child(2n){padding-left:5px;padding-right:0}.easyuse-preview-slide-content{position:relative;min-height:150px;width:100%}.easyuse-preview-slide-content .save{position:absolute;right:6px;z-index:12;bottom:6px;display:flex;align-items:center;height:26px;padding:0 9px;color:var(--input-text);font-size:12px;line-height:26px;background:#00000080;border-radius:13px;cursor:pointer;min-width:80px;text-align:center}.easyuse-preview-slide-content .save:hover{filter:brightness(120%);will-change:auto}.easyuse-preview-slide-content img{border-radius:14px;object-position:center center;max-width:100%;max-height:700px;border-style:none;vertical-align:middle}.easyuse-preview button{position:absolute;z-index:10;top:50%;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:15px;border:1px solid rgba(66,63,78,.15);background-color:#423f4e80;color:#fffc;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transform:translateY(-50%)}.easyuse-preview button.left{left:10px}.easyuse-preview button.right{right:10px}.easyuse-model-detail{margin-top:16px;overflow:hidden;border:1px solid var(--border-color);border-radius:8px;width:300px}.easyuse-model-detail-head{height:40px;padding:0 10px;font-weight:500;font-size:14px;font-style:normal;line-height:40px}.easyuse-model-detail-body{box-sizing:border-box;font-size:12px}.easyuse-model-detail-item{display:flex;justify-content:flex-start;border-top:1px solid var(--border-color)}.easyuse-model-detail-item-label{flex-shrink:0;width:88px;padding-top:5px;padding-bottom:5px;padding-left:10px;border-right:1px solid var(--border-color);color:var(--input-text);font-weight:400}.easyuse-model-detail-item-value{display:flex;flex-wrap:wrap;padding:5px 10px;color:var(--input-text)}.easyuse-model-detail-textarea{border-top:1px solid var(--border-color);padding:10px;height:100px;overflow-y:auto;font-size:12px}.easyuse-model-detail-textarea textarea{width:100%;height:100%;border:0;background-color:transparent;color:var(--input-text)}.easyuse-model-detail-textarea textarea::placeholder{color:var(--descrip-text)}.easyuse-model-detail-textarea.empty{display:flex;justify-content:center;align-items:center;color:var(--descrip-text)}.easyuse-model-notes{background-color:#00000040;padding:5px;margin-top:5px}.easyuse-model-notes:empty{display:none}.easyuse-account-user{font-size:10px;color:var(--descrip-text);text-align:center}.easyuse-account-user-info{display:flex;justify-content:space-between;align-items:center;padding-bottom:10px;cursor:pointer}.easyuse-account-user-info .user{display:flex;align-items:center}.easyuse-account-user-info .edit{padding:5px 10px;background:var(--comfy-menu-bg);border-radius:4px}.easyuse-account-user-info:hover{filter:brightness(110%)}.easyuse-account-user-info h5{margin:0;font-size:10px;text-align:left}.easyuse-account-user-info h6{margin:0;font-size:8px;text-align:left;font-weight:300}.easyuse-account-user-info .remark{margin-top:4px}.easyuse-account-user-info .avatar{width:36px;height:36px;background:var(--comfy-input-bg);border-radius:50%;margin-right:5px;display:flex;justify-content:center;align-items:center;font-size:16px;overflow:hidden}.easyuse-account-user-info .avatar img{width:100%;height:100%}.easyuse-account-dialog{width:600px}.easyuse-account-dialog-main a,.easyuse-account-dialog-main a:visited{font-weight:400;color:var(--theme-color-light)}.easyuse-account-dialog-item{display:flex;justify-content:flex-start;align-items:center;padding:10px 0;border-bottom:1px solid var(--border-color)}.easyuse-account-dialog-item input{padding:5px;margin-right:5px}.easyuse-account-dialog-item input.key{flex:1}.easyuse-account-dialog-item button{cursor:pointer;margin-left:5px!important;padding:5px!important;font-size:16px!important}.easyuse-account-dialog-item button:hover{filter:brightness(120%)}.easyuse-account-dialog-item button.choose{background:var(--theme-color)}.easyuse-account-dialog-item button.delete{background:var(--error-color)}.easy-dropdown,.easy-nested-dropdown{position:relative;box-sizing:border-box;background-color:#171717;box-shadow:0 4px 4px #ffffff40;padding:0;margin:0;list-style:none;z-index:1000;overflow:visible;max-height:fit-content;max-width:fit-content}.easy-dropdown{position:absolute;border-radius:0}.easy-dropdown li.item,.easy-nested-dropdown li.item{font-weight:400;min-width:max-content}.easy-dropdown li.folder,.easy-nested-dropdown li.folder{cursor:default;position:relative;border-right:3px solid cyan}.easy-dropdown li.folder:after,.easy-nested-dropdown li.folder:after{content:">";position:absolute;right:2px;font-weight:400}.easy-dropdown li,.easy-nested-dropdown li{padding:4px 10px;cursor:pointer;font-family:system-ui;font-size:.7rem;position:relative}.easy-nested-dropdown{position:absolute;top:0;left:100%;margin:0;border:none;display:none}.easy-dropdown li.selected>.easy-nested-dropdown,.easy-nested-dropdown li.selected>.easy-nested-dropdown{display:block;border:none}.easy-dropdown li.selected,.easy-nested-dropdown li.selected{background-color:#e5e5e5;border:none}:root{--theme-color:var(--primary-bg);--theme-color-light: var(--primary-hover-bg);--success-color: #52c41a;--error-color: #ff4d4f;--warning-color: #faad14;--font-family: Inter, -apple-system, BlinkMacSystemFont, Helvetica Neue, sans-serif;--p-inputtext-background: var(--p-form-field-background);--p-inputtext-disabled-background: var(--p-form-field-disabled-background);--p-inputtext-filled-background: var(--p-form-field-filled-background);--p-inputtext-filled-focus-background: var(--p-form-field-filled-focus-background);--p-inputtext-border-color: var(--p-form-field-border-color);--p-inputtext-hover-border-color: var(--p-form-field-hover-border-color);--p-inputtext-focus-border-color: var(--p-form-field-focus-border-color);--p-inputtext-invalid-border-color: var(--p-form-field-invalid-border-color);--p-inputtext-color: var(--p-form-field-color);--p-inputtext-disabled-color: var(--p-form-field-disabled-color);--p-inputtext-placeholder-color: var(--p-form-field-placeholder-color);--p-inputtext-shadow: var(--p-form-field-shadow);--p-inputtext-padding-x: var(--p-form-field-padding-x);--p-inputtext-padding-y: var(--p-form-field-padding-y);--p-inputtext-border-radius: var(--p-form-field-border-radius);--p-inputtext-focus-ring-width: var(--p-form-field-focus-ring-width);--p-inputtext-focus-ring-style: var(--p-form-field-focus-ring-style);--p-inputtext-focus-ring-color: var(--p-form-field-focus-ring-color);--p-inputtext-focus-ring-offset: var(--p-form-field-focus-ring-offset);--p-inputtext-focus-ring-shadow: var(--p-form-field-focus-ring-shadow);--p-inputtext-transition-duration: var(--p-form-field-transition-duration);--p-inputtext-sm-font-size: .875rem;--p-inputtext-sm-padding-x: .625rem;--p-inputtext-sm-padding-y: .375rem;--p-inputtext-lg-font-size: 1.125rem;--p-inputtext-lg-padding-x: .875rem;--p-inputtext-lg-padding-y: .625rem;--p-tag-font-size: .875rem;--p-tag-font-weight: 700;--p-tag-padding: .25rem .5rem;--p-tag-gap: .25rem;--p-tag-border-radius: var(--p-content-border-radius);--p-tag-rounded-border-radius: var(--p-border-radius-xl);--p-tag-icon-size: .75rem;--p-tag-primary-background: var(--p-primary-100);--p-tag-primary-color: var(--p-primary-700);--p-tag-secondary-background: var(--p-surface-100);--p-tag-secondary-color: var(--p-surface-600);--p-tag-success-background: var(--p-green-100);--p-tag-success-color: var(--p-green-700);--p-tag-info-background: var(--p-sky-100);--p-tag-info-color: var(--p-sky-700);--p-tag-warn-background: var(--p-orange-100);--p-tag-warn-color: var(--p-orange-700);--p-tag-danger-background: var(--p-red-100);--p-tag-danger-color: var(--p-red-700);--p-tag-contrast-background: var(--p-surface-950);--p-tag-contrast-color: var(--p-surface-0)}:root .dark-theme{--p-tag-font-size: .875rem;--p-tag-font-weight: 700;--p-tag-padding: .25rem .5rem;--p-tag-gap: .25rem;--p-tag-border-radius: var(--p-content-border-radius);--p-tag-rounded-border-radius: var(--p-border-radius-xl);--p-tag-icon-size: .75rem;--p-tag-primary-background: color-mix(in srgb, var(--p-primary-500), transparent 84%);--p-tag-primary-color: var(--p-primary-300);--p-tag-secondary-background: var(--p-surface-800);--p-tag-secondary-color: var(--p-surface-300);--p-tag-success-background: color-mix(in srgb, var(--p-green-500), transparent 84%);--p-tag-success-color: var(--p-green-300);--p-tag-info-background: color-mix(in srgb, var(--p-sky-500), transparent 84%);--p-tag-info-color: var(--p-sky-300);--p-tag-warn-background: color-mix(in srgb, var(--p-orange-500), transparent 84%);--p-tag-warn-color: var(--p-orange-300);--p-tag-danger-background: color-mix(in srgb, var(--p-red-500), transparent 84%);--p-tag-danger-color: var(--p-red-300);--p-tag-contrast-background: var(--p-surface-0);--p-tag-contrast-color: var(--p-surface-950)}.comfyui-easyuse-theme,.comfyui-easyuse-primary{color:var(--theme-color-light)}.comfyui-easyuse-theme.point:hover,.comfyui-easyuse-primary.point:hover{opacity:.8}.comfyui-easyuse-success{color:var(--success-color)}.comfyui-easyuse-success.point:hover{opacity:.8}.comfyui-easyuse-error{color:var(--error-color)}.comfyui-easyuse-error.point:hover{opacity:.8}.comfyui-easyuse-warning,.comfyui-easyuse--warn{color:var(--warning-color)}.comfyui-easyuse-warning.point:hover,.comfyui-easyuse--warn.point:hover{opacity:.8}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.grid{display:grid}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-10{gap:2.5rem}.gap-12{gap:3rem}.gap-2{gap:.5rem}.gap-2\\.5{gap:.625rem}.gap-20{gap:5rem}.gap-3{gap:.75rem}.gap-3\\.5{gap:.875rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-7{gap:1.75rem}.gap-8{gap:2rem}.gap-\\[0\\.28rem\\]{gap:.28rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.gap-y-6{row-gap:1.5rem}@media (min-width: 576px){.sm\\:col-span-4{grid-column:span 4/span 4}.sm\\:col-span-6{grid-column:span 6/span 6}.sm\\:ml-8{margin-left:2rem}.sm\\:mt-0{margin-top:0}.sm\\:flex{display:flex}.sm\\:h-60{height:15rem}.sm\\:\\!w-64{width:16rem!important}.sm\\:w-40{width:10rem}.sm\\:w-44{width:11rem}.sm\\:w-56{width:14rem}.sm\\:w-60{width:15rem}.sm\\:w-64{width:16rem}.sm\\:w-80{width:20rem}.sm\\:w-96{width:24rem}.sm\\:w-\\[30rem\\]{width:30rem}.sm\\:w-auto{width:auto}.sm\\:min-w-\\[30rem\\]{min-width:30rem}.sm\\:flex-row{flex-direction:row}.sm\\:flex-col{flex-direction:column}.sm\\:flex-nowrap{flex-wrap:nowrap}.sm\\:items-start{align-items:flex-start}.sm\\:items-end{align-items:flex-end}.sm\\:items-center{align-items:center}.sm\\:justify-center{justify-content:center}.sm\\:justify-between{justify-content:space-between}.sm\\:gap-2{gap:.5rem}.sm\\:p-20{padding:5rem}.sm\\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\\:py-10{padding-bottom:2.5rem;padding-top:2.5rem}.sm\\:py-5{padding-bottom:1.25rem;padding-top:1.25rem}.sm\\:pt-32{padding-top:8rem}.sm\\:text-left{text-align:left}.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\\:-bottom-12{bottom:-3rem}.md\\:-bottom-28{bottom:-7rem}.md\\:-bottom-8{bottom:-2rem}.md\\:-bottom-\\[26rem\\]{bottom:-26rem}.md\\:-left-12{left:-3rem}.md\\:-left-28{left:-7rem}.md\\:-left-32{left:-8rem}.md\\:-left-4{left:-1rem}.md\\:-left-48{left:-12rem}.md\\:-left-\\[22rem\\]{left:-22rem}.md\\:bottom-0{bottom:0}.md\\:left-10{left:2.5rem}.md\\:left-\\[32rem\\]{left:32rem}.md\\:left-\\[42rem\\]{left:42rem}.md\\:top-1\\/2{top:50%}.md\\:top-32{top:8rem}.md\\:top-8{top:2rem}.md\\:col-span-2{grid-column:span 2/span 2}.md\\:col-span-4{grid-column:span 4/span 4}.md\\:col-span-6{grid-column:span 6/span 6}.md\\:ml-auto{margin-left:auto}.md\\:block{display:block}.md\\:flex{display:flex}.md\\:hidden{display:none}.md\\:h-\\[20rem\\]{height:20rem}.md\\:h-\\[32rem\\]{height:32rem}.md\\:\\!w-80{width:20rem!important}.md\\:w-2\\/12{width:16.666667%}.md\\:w-40{width:10rem}.md\\:w-5\\/12{width:41.666667%}.md\\:w-56{width:14rem}.md\\:w-6\\/12{width:50%}.md\\:w-60{width:15rem}.md\\:w-8\\/12{width:66.666667%}.md\\:w-80{width:20rem}.md\\:w-\\[100rem\\]{width:100rem}.md\\:w-\\[26rem\\]{width:26rem}.md\\:w-\\[30rem\\]{width:30rem}.md\\:w-\\[50rem\\]{width:50rem}.md\\:w-\\[52rem\\]{width:52rem}.md\\:w-\\[60rem\\]{width:60rem}.md\\:w-\\[95rem\\]{width:95rem}.md\\:w-screen{width:100vw}.md\\:flex-initial{flex:0 1 auto}.md\\:-translate-y-1\\/2{--tw-translate-y: -50% }.md\\:-translate-y-1\\/2,.md\\:translate-x-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-x-0{--tw-translate-x: 0px }.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:flex-row{flex-direction:row}.md\\:flex-col{flex-direction:column}.md\\:items-end{align-items:flex-end}.md\\:items-center{align-items:center}.md\\:justify-start{justify-content:flex-start}.md\\:justify-center{justify-content:center}.md\\:gap-20{gap:5rem}.md\\:gap-4{gap:1rem}.md\\:p-5{padding:1.25rem}.md\\:p-8{padding:2rem}}@media (min-width: 992px){.lg\\:left-20{left:5rem}.lg\\:left-\\[36rem\\]{left:36rem}.lg\\:left-\\[50rem\\]{left:50rem}.lg\\:col-span-1{grid-column:span 1/span 1}.lg\\:col-span-2{grid-column:span 2/span 2}.lg\\:col-span-4{grid-column:span 4/span 4}.lg\\:col-span-6{grid-column:span 6/span 6}.lg\\:mb-0{margin-bottom:0}.lg\\:mt-0{margin-top:0}.lg\\:mt-20{margin-top:5rem}.lg\\:flex{display:flex}.lg\\:hidden{display:none}.lg\\:h-10{height:2.5rem}.lg\\:h-32{height:8rem}.lg\\:h-\\[28rem\\]{height:28rem}.lg\\:\\!w-\\[30rem\\]{width:30rem!important}.lg\\:w-3\\/12{width:25%}.lg\\:w-32{width:8rem}.lg\\:w-\\[28rem\\]{width:28rem}.lg\\:w-\\[64rem\\]{width:64rem}.lg\\:w-fit{width:-moz-fit-content;width:fit-content}.lg\\:max-w-6xl{max-width:72rem}.lg\\:flex-row{flex-direction:row}.lg\\:gap-0{gap:0}.lg\\:rounded-2xl{border-radius:1rem}.lg\\:rounded-3xl{border-radius:1.5rem}.lg\\:rounded-xl{border-radius:.75rem}.lg\\:p-7{padding:1.75rem}.lg\\:px-2{padding-left:.5rem;padding-right:.5rem}.lg\\:px-20{padding-left:5rem;padding-right:5rem}.lg\\:px-56{padding-left:14rem;padding-right:14rem}.lg\\:px-8{padding-left:2rem;padding-right:2rem}.lg\\:px-9{padding-left:2.25rem;padding-right:2.25rem}.lg\\:py-20{padding-bottom:5rem;padding-top:5rem}.lg\\:py-7{padding-bottom:1.75rem;padding-top:1.75rem}.lg\\:pt-0{padding-top:0}.lg\\:text-2xl{font-size:1.5rem;line-height:2rem}.lg\\:text-5xl{font-size:3rem;line-height:1}.lg\\:text-base{font-size:1rem;line-height:1.5rem}.lg\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1200px){.xl\\:-left-12{left:-3rem}.xl\\:-left-28{left:-7rem}.xl\\:bottom-0{bottom:0}.xl\\:left-36{left:9rem}.xl\\:left-\\[42rem\\]{left:42rem}.xl\\:left-\\[60rem\\]{left:60rem}.xl\\:col-span-3{grid-column:span 3/span 3}.xl\\:col-span-4{grid-column:span 4/span 4}.xl\\:col-span-6{grid-column:span 6/span 6}.xl\\:block{display:block}.xl\\:flex{display:flex}.xl\\:hidden{display:none}.xl\\:h-\\[36\\.25rem\\]{height:36.25rem}.xl\\:\\!w-40{width:10rem!important}.xl\\:w-3\\/12{width:25%}.xl\\:w-6\\/12{width:50%}.xl\\:w-96{width:24rem}.xl\\:w-\\[29rem\\]{width:29rem}.xl\\:max-w-36{max-width:9rem}.xl\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\\:flex-row{flex-direction:row}.xl\\:items-start{align-items:flex-start}.xl\\:items-center{align-items:center}.xl\\:gap-1{gap:.25rem}.xl\\:gap-6{gap:1.5rem}.xl\\:text-left{text-align:left}}.comfyui-easyuse-toast{position:fixed;z-index:99999;top:0;left:0;height:0;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:start}.comfyui-easyuse-toast-container{position:relative;height:fit-content;padding:4px;margin-top:-100px;opacity:0;z-index:3;-webkit-transition:all .3s ease-in-out;-khtml-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-ms-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.comfyui-easyuse-toast-container:last-child{z-index:1}.comfyui-easyuse-toast-container.show{opacity:1;margin-top:0!important;transform:translateY(0)}.comfyui-easyuse-toast-container:not(.show){z-index:1}.comfyui-easyuse-toast-container>div{position:relative;background:var(--comfy-menu-bg);color:var(--input-text);height:fit-content;box-shadow:0 0 10px #000000e0;padding:9px 12px;border-radius:var(--border-radius);font-size:14px;pointer-events:all;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-toast-container>div>span{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-toast-container>div>span i{font-size:16px;margin-right:8px}.comfyui-easyuse-toast-container>div>span i.loading{animation:loading-rotate 1s linear infinite}.comfyui-easyuse-toast-container a{cursor:pointer;text-decoration:underline;color:var(--theme-color-light);margin-left:4px;display:inline-block;line-height:1}.comfyui-easyuse-toast-container a:hover{color:var(--theme-color-light);text-decoration:none}@keyframes loading-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.comfyui-easyuse-selector{position:relative}.comfyui-easyuse-selector.hide{display:none}.comfyui-easyuse-selector__header{--height:26px;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;height:var(--height);padding-bottom:10px;border-bottom:1px solid var(--border-color-solid)}.comfyui-easyuse-selector__header_button{height:var(--height);width:var(--height);border-radius:var(--border-radius);border:1px solid var(--border-color);font-size:11px;background:var(--bg-color);box-shadow:none;cursor:pointer;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-selector__header_button:hover{filter:brightness(1.2)}.comfyui-easyuse-selector__header_button:hover i{color:var(--error-color)}.comfyui-easyuse-selector__header_button i{font-size:16px;color:var(--input-text);-webkit-transition:all .3s ease-in-out;-khtml-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-ms-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.comfyui-easyuse-selector__header_search{flex:1;margin-left:10px;border-radius:var(--border-radius);border:1px solid var(--border-color);font-size:11px;background:var(--bg-color);padding:0 8px;height:var(--height);display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-selector__header_search i{font-size:16px}.comfyui-easyuse-selector__header_search .search{vertical-align:middle;margin-left:5px;outline:none;resize:none;border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;overflow-y:scroll;background:transparent;width:100%;line-height:var(--height);font-size:12px;color:var(--input-text);-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1}.comfyui-easyuse-selector__content{list-style:none;padding:0;margin:0;min-height:150px;height:calc(100% - 28px);overflow-y:auto;overflow-x:hidden}.comfyui-easyuse-selector-item{display:inline-block;position:relative}.comfyui-easyuse-selector-item__tag{display:inline-block;vertical-align:middle;margin-top:8px;margin-right:8px;padding:4px;color:var(--input-text);background-color:var(--bg-color);border-radius:var(--border-radius);border:1px solid var(--border-color);font-size:11px;cursor:pointer;overflow:hidden;position:relative}.comfyui-easyuse-selector-item__tag:hover{filter:brightness(1.2)}.comfyui-easyuse-selector-item__tag.hide{display:none}.comfyui-easyuse-selector-item__tag input{--ring-color: transparent;position:relative;box-shadow:none;border:1px solid var(--border-color);border-radius:2px;background:linear-gradient(135deg,var(--comfy-menu-bg) 0%,var(--comfy-input-bg) 60%)}.comfyui-easyuse-selector-item__tag input[type=checkbox]{display:inline-block;flex-shrink:0;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid var(--border-color);background-origin:border-box;padding:0;width:1rem;height:1rem;border-radius:4px;color:var(--theme-color-light);-webkit-user-select:none;user-select:none}.comfyui-easyuse-selector-item__tag input[type=checkbox]:checked{border:1px solid var(--theme-color-light);background-color:var(--theme-color-light);background-image:url("data:image/svg+xml,%3csvg viewBox=\'0 0 16 16\' fill=\'white\' xmlns=\'http://www.w3.org/2000/svg\'%3e%3cpath d=\'M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z\'/%3e%3c/svg%3e")}.comfyui-easyuse-selector-item__tag input span{margin:0 4px;vertical-align:middle}.comfyui-easyuse-selector-preview{position:absolute;left:-180px;top:-110px;z-index:2;border:1px solid var(--border-color);border-radius:var(--border-radius);background:var(--comfy-menu-bg);-webkit-backdrop-filter:saturate(180%) blur(40px);-khtml-backdrop-filter:saturate(180%) blur(40px);-moz-backdrop-filter:saturate(180%) blur(40px);-ms-backdrop-filter:saturate(180%) blur(40px);-o-backdrop-filter:saturate(180%) blur(40px);backdrop-filter:saturate(180%) blur(40px);overflow:hidden}.comfyui-easyuse-selector-preview img{width:150px;height:150px}.comfyui-easyuse-selector-preview__text{font-size:12px;padding:5px 10px;max-width:130px;color:var(--input-text)}.comfyui-easyuse-selector-preview__text h6{line-height:1.15;font-size:10px;margin:10px 0}.comfyui-easyuse-dialog{max-width:600px}.comfyui-easyuse-dialog-title{font-size:18px;font-weight:700;text-align:center;color:var(--input-text);margin:0}.comfyui-easyuse-dialog-images{margin-top:10px;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box}.comfyui-easyuse-dialog-images img{width:50%;height:auto;cursor:pointer;box-sizing:border-box;filter:brightness(80%)}.comfyui-easyuse-dialog-images img:hover{filter:brightness(100%)}.comfyui-easyuse-dialog-images.selected{border:4px solid var(--success-color)}.comfyui-easyuse-dialog-hidden{display:none;height:0}.comfyui-easyuse-contextmenu{--height: 26px;--padding: 8px;font-family:var(--font-family);position:fixed;top:0;left:0;width:100%;max-width:200px;min-width:100px;min-height:100px;padding:var(--padding) 0;box-shadow:0 0 10px #00000040;background-color:var(--tr-odd-bg-color);border-radius:var(--border-radius);z-index:10;will-change:transform}.comfyui-easyuse-contextmenu-item-divider{height:1px;width:100%;background-color:var(--border-color);margin:var(--padding) 0}.comfyui-easyuse-contextmenu-item-content{height:var(--height);padding:0 12px;cursor:pointer;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-contextmenu-item-content span{font-size:11px;color:var(--input-text);display:-webkit-box;-webkit-line-clamp:1;overflow:hidden;word-break:break-all;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1}.comfyui-easyuse-contextmenu-item-content i{color:var(--input-text);margin-left:4px;display:block;width:0;height:0;border-width:4px 4px 0;border-style:solid;border-color:var(--descrip-text) transparent transparent;-webkit-transform:scaleY(.8) rotate(-90deg);-khtml-transform:scaleY(.8) rotate(-90deg);-moz-transform:scaleY(.8) rotate(-90deg);-ms-transform:scaleY(.8) rotate(-90deg);-o-transform:scaleY(.8) rotate(-90deg);transform:scaleY(.8) rotate(-90deg)}.comfyui-easyuse-contextmenu-item-content:hover{background:var(--theme-color)}.comfyui-easyuse-contextmenu-item.disabled .comfyui-easyuse-contextmenu-item-content span{color:var(--border-color);cursor:default}.comfyui-easyuse-contextmenu-item.disabled .comfyui-easyuse-contextmenu-item-content:hover{background:transparent}.comfyui-easyuse-contextmenu-submenu{font-family:var(--font-family);position:absolute;top:0;left:200px;max-width:200px;width:200px;min-width:100px;min-height:--height;padding:var(--padding) 0;box-shadow:0 0 10px #00000040;background-color:var(--tr-odd-bg-color);border-radius:var(--border-radius);z-index:10;will-change:transform}.comfyui-easyuse-contextmenu-model{position:relative}.comfyui-easyuse-contextmenu-model:hover img{display:block;opacity:1}.comfyui-easyuse-contextmenu-model img{position:absolute;z-index:1;right:-175px;top:-75px;width:150px;height:auto;display:none;filter:brightness(70%);-webkit-filter:brightness(70%);opacity:0;-webkit-transition:all .5s cubic-bezier(.55,0,.1,1);-khtml-transition:all .5s cubic-bezier(.55,0,.1,1);-moz-transition:all .5s cubic-bezier(.55,0,.1,1);-ms-transition:all .5s cubic-bezier(.55,0,.1,1);-o-transition:all .5s cubic-bezier(.55,0,.1,1);transition:all .5s cubic-bezier(.55,0,.1,1)}.comfyui-easyuse-slider{width:100%;height:100%;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-slider-item{height:inherit;min-width:25px;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-webkit-flex-direction:column;-khtml-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;-o-flex-direction:column;flex-direction:column}.comfyui-easyuse-slider-item-input{height:15px;font-size:10px;color:var(--input-text)}.comfyui-easyuse-slider-item-label{height:15px;border:none;color:var(--descrip-text);font-size:8px}.comfyui-easyuse-slider-item-scroll{width:5px;height:calc(100% - 30px);background:var(--comfy-input-bg);border-radius:10px;position:relative}.comfyui-easyuse-slider-item-bar{width:10px;height:10px;background:linear-gradient(to bottom,var(--input-text),var(--descrip-text));border-radius:100%;box-shadow:0 2px 10px var(--bg-color);position:absolute;top:0;left:-2.5px;cursor:pointer;z-index:1}.comfyui-easyuse-slider-item-area{width:100%;border-radius:20px;position:absolute;bottom:0;background:var(--input-text);z-index:0}.comfyui-easyuse-slider-item.positive .comfyui-easyuse-slider-item-label{color:var(--success-color)}.comfyui-easyuse-slider-item.positive .comfyui-easyuse-slider-item-area{background:var(--success-color)}.comfyui-easyuse-slider-item.negative .comfyui-easyuse-slider-item-label{color:var(--error-color)}.comfyui-easyuse-slider-item.negative .comfyui-easyuse-slider-item-area{background:var(--error-color)}.comfyui-easyuse-map{height:100%;background:var(--comfy-menu-bg)}.comfyui-easyuse-map .p-splitter-gutter-handle{height:1px!important}.comfyui-easyuse-map-nodes{height:100%;position:relative}.comfyui-easyuse-map-nodes__header{position:absolute;z-index:2;top:0;left:0;width:100%;padding:.25rem 0 .25rem 1rem;height:2.7rem;background:var(--comfy-menu-bg);border-bottom:1px solid var(--border-color);display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-webkit-backdrop-filter:saturate(180%) blur(40px);-khtml-backdrop-filter:saturate(180%) blur(40px);-moz-backdrop-filter:saturate(180%) blur(40px);-ms-backdrop-filter:saturate(180%) blur(40px);-o-backdrop-filter:saturate(180%) blur(40px);backdrop-filter:saturate(180%) blur(40px)}.comfyui-easyuse-map-nodes__header .title{font-size:13px;color:var(--input-text);font-weight:400;line-height:1.5}.comfyui-easyuse-map-nodes__header .toolbar{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-map-nodes__header .toolbar .icon{font-size:.85rem;margin-left:.25rem;cursor:pointer}.comfyui-easyuse-map-nodes__content{position:relative;padding:2.7rem 0 0;height:100%;overflow:auto}.comfyui-easyuse-map-nodes__content dl .label{padding-left:1rem}.comfyui-easyuse-map-nodes__content ol,.comfyui-easyuse-map-nodes__content dl{list-style-type:none;padding:0;margin:0}.comfyui-easyuse-map-nodes__content ol .toolbar span,.comfyui-easyuse-map-nodes__content dl .toolbar span{font-size:13px}.comfyui-easyuse-map-nodes__content ol .toolbar span.pi-eye,.comfyui-easyuse-map-nodes__content dl .toolbar span.pi-eye{color:var(--input-text)}.comfyui-easyuse-map-nodes__content ol .toolbar span.pi-eye-slash,.comfyui-easyuse-map-nodes__content dl .toolbar span.pi-eye-slash{color:var(--descrip-text)}.comfyui-easyuse-map-nodes__content ol .toolbar span.pi-eye-slash.never,.comfyui-easyuse-map-nodes__content dl .toolbar span.pi-eye-slash.never{opacity:.5}.comfyui-easyuse-map-nodes__content .no_result{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;text-align:center}.comfyui-easyuse-map-nodes-group{position:relative;overflow:hidden;width:100%;height:2rem;cursor:default;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-map-nodes-group .left,.comfyui-easyuse-map-nodes-group .right{height:100%;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-map-nodes-group .left{padding-left:.5rem;margin-right:.25rem;-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1}.comfyui-easyuse-map-nodes-group .icon{font-size:.85rem;margin-right:.25rem}.comfyui-easyuse-map-nodes-group .label{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;height:100%;width:100%;min-width:80px}.comfyui-easyuse-map-nodes-group .label span{font-size:14px;color:var(--input-text);font-weight:400;line-height:1.5;display:-webkit-box;-webkit-line-clamp:1;overflow:hidden;word-break:break-all;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.comfyui-easyuse-map-nodes-group:hover{background:var(--content-hover-bg)!important}.comfyui-easyuse-map-nodes-group.active{background:var(--theme-color)!important}.comfyui-easyuse-map-nodes-group.active .label{color:#fff;cursor:default}.comfyui-easyuse-map-nodes-group.never .label{color:var(--descrip-text);opacity:.4}.comfyui-easyuse-map-nodes-group.bypass .label{color:var(--descrip-text)}.comfyui-easyuse-map-nodes-node{height:2rem;cursor:default;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;position:relative;overflow:hidden}.comfyui-easyuse-map-nodes-node .label{text-indent:.5rem;font-size:13px;color:var(--input-text);font-weight:400;line-height:1.5;-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;margin-right:.25rem;height:2rem;line-height:2rem;width:100%;display:-webkit-box;-webkit-line-clamp:1;overflow:hidden;word-break:break-all;text-overflow:ellipsis;-webkit-box-orient:vertical}.comfyui-easyuse-map-nodes-node .label.error{color:var(--error-color)}.comfyui-easyuse-map-nodes-node:hover{background:var(--content-hover-bg)!important}.comfyui-easyuse-map-nodes-node.never .label{color:var(--descrip-text);opacity:.5}.comfyui-easyuse-map-nodes-node.bypass .label{color:#f0f;opacity:.5}.comfyui-easyuse-map-nodes .nodes .label{text-indent:1rem}.no-result-placeholder{display:flex;justify-content:center;align-items:center;height:100%}.no-result-placeholder-content{text-align:center;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-khtml-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;-o-flex-direction:column;flex-direction:column;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between}.no-result-placeholder .p-card{background-color:transparent!important;box-shadow:none;text-align:center}.no-result-placeholder h3{color:var(--input-text);margin-bottom:.5rem}.no-result-placeholder p{color:var(--descrip-text);margin-bottom:1rem;margin-top:0}#comfyui-easyuse-components{position:absolute;top:0;left:0;z-index:2}.comfyui-easyuse{--p-datatable-header-cell-padding: .15rem 1rem;--p-datatable-body-cell-padding: .15rem 1rem;--p-primary-color: var(--theme-color-light)!important;--border-color-solid: var(--border-color);--border-radius: 8px}.comfyui-easyuse.dark-theme{--fg-color: #fff;--bg-color: #242427;--content-bg:#18181b;--content-fg:#fff;--content-hover-bg: #27272a;--comfy-menu-bg: rgba(24,24,27,.9);--comfy-input-bg: #242427;--input-text: #ffffff;--descrip-text: #71717a;--drag-text: #ccc;--error-text: #ff4444;--border-color: #3f3f46;--border-color-solid: #2a2a2e;--tr-even-bg-color: rgba(28,28,28,.9);--tr-odd-bg-color: rgba(19,19,19,.9)}.comfyui-easyuse ::-webkit-scrollbar{width:0em}.comfyui-easyuse ::-webkit-scrollbar-track{background-color:transparent}.comfyui-easyuse ::-webkit-scrollbar-thumb{background-color:transparent;border-radius:2px}.comfyui-easyuse ::-webkit-scrollbar-thumb:hover{background-color:transparent}.comfyui-easyuse body{font-family:var(--font-family)!important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.comfyui-easyuse textarea{font-family:var(--font-family)!important}.comfyui-easyuse hr{border:1px solid var(--border-color)}.comfyui-easyuse .comfy-multiline-input{background-color:transparent;border:1px solid var(--border-color-solid);border-radius:var(--border-radius);padding:8px;font-size:12px}.comfyui-easyuse #comfy-settings-dialog{border:1px solid var(--border-color);background:transparent;-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%);box-shadow:none}.comfyui-easyuse .comfy-modal{border:1px solid var(--border-color);box-shadow:none;-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .cm-title{background-color:transparent!important}.comfyui-easyuse .cm-notice-board{border-radius:10px!important;border:1px solid var(--border-color)!important}.comfyui-easyuse .cm-menu-container{margin-bottom:50px!important}.comfyui-easyuse .cn-manager-custom_milk_white .tg-column-name,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-column-name{color:var(--input-text)}.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-message,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-message{text-align:center;color:var(--descrip-text)!important}.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-frame .tg-cell,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-frame .tg-cell{color:var(--input-text)}.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-frame .cn-node-name a,.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-frame .cmm-node-name a,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-frame .cn-node-name a,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-frame .cmm-node-name a{color:var(--theme-color)!important}.comfyui-easyuse .comfy-menu{border-radius:16px;box-shadow:0 0 1px var(--descrip-text);-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .comfy-menu button.comfy-settings-btn{font-size:12px}.comfyui-easyuse .comfy-menu-btns{margin-bottom:4px}.comfyui-easyuse .comfy-menu button,.comfyui-easyuse .comfy-modal button{font-size:14px;padding:4px 0;margin-bottom:4px}.comfyui-easyuse .comfy-menu-btns button,.comfyui-easyuse .comfy-list-actions button{font-size:10px}.comfyui-easyuse .comfy-menu>button,.comfyui-easyuse .comfy-menu-btns button,.comfyui-easyuse .comfy-menu .comfy-list button,.comfyui-easyuse .comfy-modal button{border-width:1px}.comfyui-easyuse #comfy-dev-save-api-button{justify-content:center}.comfyui-easyuse #queue-button{position:relative;overflow:hidden;min-height:30px;z-index:1}.comfyui-easyuse #queue-button:after{clear:both;content:attr(data-attr);background:green;color:#fff;width:var(--process-bar-width);height:100%;position:absolute;top:0;left:0;z-index:0;text-align:center;display:flex;justify-content:center;align-items:center}.comfyui-easyuse #shareButton{background:linear-gradient(to left,var(--theme-color),var(--theme-color-light))!important;color:#fff!important}.comfyui-easyuse .litegraph.litecontextmenu{--height: 24px;--padding: 6px;font-family:var(--font-family);padding:var(--padding) 0;border-radius:var(--border-radius);-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .litegraph.litecontextmenu .litemenu-title{padding:var(--padding)}.comfyui-easyuse .litegraph.litecontextmenu>div:first-child.litemenu-title{margin-top:-6px}.comfyui-easyuse .litegraph.litecontextmenu .submenu{height:var(--height);line-height:var(--height);padding:0 18px 0 12px;margin:0;background:transparent!important}.comfyui-easyuse .litegraph.litecontextmenu .submenu.has_submenu{border-right:none;position:relative}.comfyui-easyuse .litegraph.litecontextmenu .submenu.has_submenu:after{content:"";display:block;width:0;height:0;border-width:4px 4px 0;border-style:solid;border-color:var(--input-text) transparent transparent;transform:translateY(-50%) rotate(-90deg);top:50%;position:absolute}.comfyui-easyuse .litegraph.litecontextmenu .submenu.separator{height:1px;width:100%;background-color:var(--border-color)!important;margin:var(--padding) 0;border:none}.comfyui-easyuse .litegraph.litecontextmenu .submenu:last-child.separator{display:none}.comfyui-easyuse .litegraph.litecontextmenu .submenu:hover:not(.separator){background:var(--theme-color)!important}.comfyui-easyuse .litegraph.lite-search-item{background-color:var(--comfy-input-bg)!important;filter:brightness(100%)}.comfyui-easyuse .litegraph.lite-search-item:hover{filter:brightness(120%);color:var(--input-text)}.comfyui-easyuse .graphdialog{-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .graphdialog button{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse .comfyui-menu{border-bottom:1px solid var(--bg-color)}.comfyui-easyuse .side-tool-bar-container{border-right:1px solid var(--bg-color)}.comfyui-easyuse .comfy-modal-content{width:100%}#comfyui-menu-monitor{width:120px}#comfyui-menu-monitor #crystools-monitor-container{margin:0 auto!important}#comfyui-menu-monitor #crystools-monitor-container>div{margin:2px 0!important}#comfyui-menu-monitor #crystools-monitor-container>div>div>div{padding:0 4px!important}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}(); -var e,t,n,o,i,r,s,a,l,c,u,d,p,f,h,m,g=Object.defineProperty,v=(e,t,n)=>((e,t,n)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let y=(null==(t=null==(e=window.comfyAPI)?void 0:e.app)?void 0:t.app)||null,b=(null==(o=null==(n=window.comfyAPI)?void 0:n.api)?void 0:o.api)||null,_=(null==(r=null==(i=window.comfyAPI)?void 0:i.ui)?void 0:r.$el)||null,w=(null==(a=null==(s=window.comfyAPI)?void 0:s.dialog)?void 0:a.ComfyDialog)||null,S=(null==(c=null==(l=window.comfyAPI)?void 0:l.widgets)?void 0:c.ComfyWidgets)||null,x=(null==(d=null==(u=window.comfyAPI)?void 0:u.utils)?void 0:d.applyTextReplacements)||null,k=(null==(f=null==(p=window.comfyAPI)?void 0:p.groupNode)?void 0:f.GroupNodeConfig)||null;const C=(e,t=void 0)=>{var n,o;return e?null==(o=null==(n=null==y?void 0:y.ui)?void 0:n.settings)?void 0:o.getSettingValue(e,t):null};function A(e,t=null,n=void 0){try{let o=e?C(e,n):null;return void 0===o&&t&&(o=localStorage[e]),o}catch(o){return null}}async function E(e,t,n=null){var o,i;try{(null==(i=null==(o=null==y?void 0:y.ui)?void 0:o.settings)?void 0:i.setSettingValue)?y.ui.settings.setSettingValue(e,t):await b.storeSetting(e,t),n&&(localStorage[n]="object"==typeof t?JSON.stringify(t):t)}catch(r){}}function O(e,t){if(e="number"==typeof e?e:e instanceof Date?e.getTime():parseInt(e),isNaN(e))return null;let n=new Date(e);(e=n.toString().split(/[\s\:]/g).slice(0,-2))[1]=["01","02","03","04","05","06","07","08","09","10","11","12"][n.getMonth()];let o={MM:1,dd:2,yyyy:3,hh:4,mm:5,ss:6};return t.replace(/([Mmdhs]|y{2})\1/g,(t=>e[o[t]]))}const L="comfyui-easyuse-",T="dark-theme",I="#236692",N={PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},P=0x4000000000000,D=["loaders","latent","image","mask","sampling","_for_testing","advanced","utils","api"],j={ALWAYS:0,NEVER:2,BYPASS:4},M="easyuse_nodes_map",R=LGraphCanvas.node_colors.bgcolor,$={ColorPalette:{version:104,id:"obsidian",name:"Obsidian",colors:{node_slot:{CLIP:"#FFD500",CLIP_VISION:"#A8DADC",CLIP_VISION_OUTPUT:"#ad7452",CONDITIONING:"#FFA931",CONTROL_NET:"#6EE7B7",IMAGE:"#64B5F6",LATENT:"#FF9CF9",MASK:"#81C784",MODEL:"#B39DDB",STYLE_MODEL:"#C2FFAE",VAE:"#FF6E6E",TAESD:"#DCC274",PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},litegraph_base:{BACKGROUND_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQBJREFUeNrs1rEKwjAUhlETUkj3vP9rdmr1Ysammk2w5wdxuLgcMHyptfawuZX4pJSWZTnfnu/lnIe/jNNxHHGNn//HNbbv+4dr6V+11uF527arU7+u63qfa/bnmh8sWLBgwYJlqRf8MEptXPBXJXa37BSl3ixYsGDBMliwFLyCV/DeLIMFCxYsWLBMwSt4Be/NggXLYMGCBUvBK3iNruC9WbBgwYJlsGApeAWv4L1ZBgsWLFiwYJmCV/AK3psFC5bBggULloJX8BpdwXuzYMGCBctgwVLwCl7Be7MMFixYsGDBsu8FH1FaSmExVfAxBa/gvVmwYMGCZbBg/W4vAQYA5tRF9QYlv/QAAAAASUVORK5CYII=",CLEAR_BACKGROUND_COLOR:"#09090b",NODE_TITLE_COLOR:"#d4d4d8",NODE_SELECTED_TITLE_COLOR:"#ffffff",NODE_TEXT_SIZE:14,NODE_TEXT_COLOR:"#ffffff",NODE_SUBTEXT_SIZE:12,NODE_DEFAULT_COLOR:"#09090b",NODE_DEFAULT_BGCOLOR:"rgba(24,24,27,.9)",NODE_DEFAULT_BOXCOLOR:"rgba(255,255,255,.75)",NODE_DEFAULT_SHAPE:"box",NODE_BOX_OUTLINE_COLOR:I,DEFAULT_SHADOW_COLOR:"rgba(0,0,0,0)",DEFAULT_GROUP_FONT:24,WIDGET_BGCOLOR:"#242427",WIDGET_OUTLINE_COLOR:"#3f3f46",WIDGET_TEXT_COLOR:"#d4d4d8",WIDGET_SECONDARY_TEXT_COLOR:"#d4d4d8",LINK_COLOR:"#9A9",EVENT_LINK_COLOR:"#A86",CONNECTING_LINK_COLOR:"#AFA"},comfy_base:{"fg-color":"#fff","bg-color":"#09090b","comfy-menu-bg":"rgba(24,24,24,.9)","comfy-input-bg":"#262626","input-text":"#ddd","descrip-text":"#999","drag-text":"#ccc","error-text":"#ff4444","border-color":"#29292c","tr-even-bg-color":"rgba(28,28,28,.9)","tr-odd-bg-color":"rgba(19,19,19,.9)"}}},NODE_COLORS:{red:{color:"#af3535",bgcolor:R,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:R,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:R,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:R,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:R,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:R,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:R,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:R,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:R,groupcolor:"#444"}}};let G=JSON.parse(JSON.stringify($));delete G.NODE_COLORS,G.ColorPalette.id="obsidian_dark",G.ColorPalette.name="Obsidian Dark",G.ColorPalette.colors.litegraph_base.BACKGROUND_IMAGE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGlmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDEgNzkuMTQ2Mjg5OSwgMjAyMy8wNi8yNS0yMDowMTo1NSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAyMy0xMS0xM1QwMDoxODowMiswMTowMCIgeG1wOk1vZGlmeURhdGU9IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIHhtcDpNZXRhZGF0YURhdGU9IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmIyYzRhNjA5LWJmYTctYTg0MC1iOGFlLTk3MzE2ZjM1ZGIyNyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjk0ZmNlZGU4LTE1MTctZmQ0MC04ZGU3LWYzOTgxM2E3ODk5ZiIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjIzMWIxMGIwLWI0ZmItMDI0ZS1iMTJlLTMwNTMwM2NkMDdjOCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6MjMxYjEwYjAtYjRmYi0wMjRlLWIxMmUtMzA1MzAzY2QwN2M4IiBzdEV2dDp3aGVuPSIyMDIzLTExLTEzVDAwOjE4OjAyKzAxOjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjUuMSAoV2luZG93cykiLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjQ4OWY1NzlmLTJkNjUtZWQ0Zi04OTg0LTA4NGE2MGE1ZTMzNSIgc3RFdnQ6d2hlbj0iMjAyMy0xMS0xNVQwMjowNDo1OSswMTowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIiBzdEV2dDpjaGFuZ2VkPSIvIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpiMmM0YTYwOS1iZmE3LWE4NDAtYjhhZS05NzMxNmYzNWRiMjciIHN0RXZ0OndoZW49IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCAyNS4xIChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4OTe6GAAAAx0lEQVR42u3WMQoAIQxFwRzJys77X8vSLiRgITif7bYbgrwYc/mKXyBoY4VVBgsWLFiwYFmOlTv+9jfDOjHmr8u6eVkGCxYsWLBgmc5S8ApewXvgYRksWLBgKXidpeBdloL3wMOCBctgwVLwCl7BuyyDBQsWLFiwTGcpeAWv4D3wsAwWLFiwFLzOUvAuS8F74GHBgmWwYCl4Ba/gXZbBggULFixYprMUvIJX8B54WAYLFixYCl5nKXiXpeA98LBgwTJYsGC9tg1o8f4TTtqzNQAAAABJRU5ErkJggg==",G.ColorPalette.colors.litegraph_base.CLEAR_BACKGROUND_COLOR="#000";const B=LGraphCanvas.node_colors.bgcolor,F={ColorPalette:{id:"milk_white",name:"Milk White",colors:{node_slot:{CLIP:"#FFA726",CLIP_VISION:"#5C6BC0",CLIP_VISION_OUTPUT:"#8D6E63",CONDITIONING:"#EF5350",CONTROL_NET:"#66BB6A",IMAGE:"#42A5F5",LATENT:"#AB47BC",MASK:"#9CCC65",MODEL:"#7E57C2",STYLE_MODEL:"#D4E157",VAE:"#FF7043",PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},litegraph_base:{BACKGROUND_IMAGE:"data:image/gif;base64,R0lGODlhZABkALMAAAAAAP///+vr6+rq6ujo6Ofn5+bm5uXl5d3d3f///wAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAkALAAAAABkAGQAAAT/UMhJq7046827HkcoHkYxjgZhnGG6si5LqnIM0/fL4qwwIMAg0CAsEovBIxKhRDaNy2GUOX0KfVFrssrNdpdaqTeKBX+dZ+jYvEaTf+y4W66mC8PUdrE879f9d2mBeoNLfH+IhYBbhIx2jkiHiomQlGKPl4uZe3CaeZifnnijgkESBqipqqusra6vsLGys62SlZO4t7qbuby7CLa+wqGWxL3Gv3jByMOkjc2lw8vOoNSi0czAncXW3Njdx9Pf48/Z4Kbbx+fQ5evZ4u3k1fKR6cn03vHlp7T9/v8A/8Gbp4+gwXoFryXMB2qgwoMMHyKEqA5fxX322FG8tzBcRnMW/zlulPbRncmQGidKjMjyYsOSKEF2FBlJQMCbOHP6c9iSZs+UnGYCdbnSo1CZI5F64kn0p1KnTH02nSoV3dGTV7FFHVqVq1dtWcMmVQZTbNGu72zqXMuW7danVL+6e4t1bEy6MeueBYLXrNO5Ze36jQtWsOG97wIj1vt3St/DjTEORss4nNq2mDP3e7w4r1bFkSET5hy6s2TRlD2/mSxXtSHQhCunXo26NevCpmvD/UU6tuullzULH76q92zdZG/Ltv1a+W+osI/nRmyc+fRi1Xdbh+68+0vv10dH3+77KD/i6IdnX669/frn5Zsjh4/2PXju8+8bzc9/6fj27LFnX11/+IUnXWl7BJfegm79FyB9JOl3oHgSklefgxAC+FmFGpqHIYcCfkhgfCohSKKJVo044YUMttggiBkmp6KFXw1oII24oYhjiDByaKOOHcp3Y5BD/njikSkO+eBREQAAOw==",CLEAR_BACKGROUND_COLOR:"lightgray",NODE_TITLE_COLOR:"#222",NODE_SELECTED_TITLE_COLOR:"#000",NODE_TEXT_SIZE:14,NODE_TEXT_COLOR:"#444",NODE_SUBTEXT_SIZE:12,NODE_DEFAULT_COLOR:"#F7F7F7",NODE_DEFAULT_BGCOLOR:"#F5F5F5",NODE_DEFAULT_BOXCOLOR:"#555",NODE_DEFAULT_SHAPE:"box",NODE_BOX_OUTLINE_COLOR:"#000",DEFAULT_SHADOW_COLOR:"rgba(0,0,0,0.1)",DEFAULT_GROUP_FONT:24,WIDGET_BGCOLOR:"#D4D4D4",WIDGET_OUTLINE_COLOR:"#999",WIDGET_TEXT_COLOR:"#222",WIDGET_SECONDARY_TEXT_COLOR:"#555",LINK_COLOR:"#9A9",EVENT_LINK_COLOR:"#FF9800",CONNECTING_LINK_COLOR:"#222"},comfy_base:{"fg-color":"#222","bg-color":"#DDD","comfy-menu-bg":"#F5F5F5","comfy-input-bg":"#C9C9C9","input-text":"#222","descrip-text":"#444","drag-text":"#555","error-text":"#F44336","border-color":"#bbb","tr-even-bg-color":"#f9f9f9","tr-odd-bg-color":"#fff","content-bg":"#e0e0e0","content-fg":"#222","content-hover-bg":"#adadad","content-hover-fg":"#222"}}},NODE_COLORS:{red:{color:"#af3535",bgcolor:B,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:B,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:B,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:B,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:B,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:B,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:B,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:B,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:B,groupcolor:"#444"}}},U={"Workflow created by":"工作流创建者","Watch more video content":"观看更多视频内容","Workflow Guide":"工作流指南","💎 View Checkpoint Info...":"💎 查看 Checkpoint 信息...","💎 View Lora Info...":"💎 查看 Lora 信息...","🔃 Reload Node":"🔃 刷新节点","Updated At:":"最近更新:","Created At:":"首次发布:","✏️ Edit":"✏️ 编辑","💾 Save":"💾 保存","No notes":"当前还没有备注内容","Saving Notes...":"正在保存备注...","Type your notes here":"在这里输入备注内容",ModelName:"模型名称","Models Required":"所需模型","Download Model":"下载模型","Source Url":"模型源地址",Notes:"备注",Type:"类型","Trained Words":"训练词",BaseModel:"基础算法",Details:"详情",Description:"描述",Download:"下载量",Source:"来源","Saving Preview...":"正在保存预览图...","Saving Succeed":"保存成功","Clean SuccessFully":"清理成功","Clean Failed":"清理失败","Saving Failed":"保存失败","No COMBO link":"沒有找到COMBO连接","Reboot ComfyUI":"重启ComfyUI","Are you sure you'd like to reboot the server?":"是否要重启ComfyUI?","Nodes Map":"管理节点组","No Nodes":"未找到节点","No nodes found in the map":"在工作流程中没有找到节点","Expand All":"展开所有组","Collapse All":"折叠所有组",Queue:"队列","Cleanup Of GPU Usage":"清理GPU占用","Please stop all running tasks before cleaning GPU":"请在清理GPU之前停止所有运行中的任务",Always:"启用中",Bypass:"已忽略",Never:"已停用","Auto Sorting":"自动排序","Toggle `Show/Hide` can set mode of group, LongPress can set group nodes to never":"点击`启用中/已忽略`可设置组模式, 长按可停用该组节点","Enable Shift+Up/Down/Left/Right key to align selected nodes":"启用 `Shift+上/下/左/右` 键对齐选中的节点","Enable Shift+g to add selected nodes to a group":"启用 `Shift+g` 键将选中的节点添加一个组","Enable Up/Down/Left/Right key to jump nearest nodes":"启用 `上/下/左/右` 键跳转到最近的前后节点","Enable ALT+1~9 to paste nodes from nodes template":"启用 `ALT+1~9` 从节点模板粘贴到工作流中","Enable contextMenu auto nest subdirectories":"启用上下文菜单自动嵌套子目录","Enable right-click menu to add node A~Z sorting":"启用右键菜单中新建节点A~Z排序","Enable model thumbnails display":"启动模型预览图显示","Enable nodes runtime display":"启动节点运行时间显示","Enable chain get node and set node with parent nodes":"启用将获取点和设置点与父节点链在一起","Too many thumbnails, have closed the display":"模型缩略图太多啦,为您关闭了显示","Get styles list Failed":"获取样式列表失败","Get style image Failed":"获取样式图片失败","Empty All":"清空所有","Type here to search styles ...":"在此处输入以搜索样式 ...","Loading UserInfo...":"正在获取用户信息...","Please set the APIKEY first":"请先设置APIKEY","Setting APIKEY":"设置APIKEY","Save Account Info":"保存账号信息",Choose:"选择",Delete:"删除",Edit:"编辑","At least one account is required":"删除失败: 至少需要一个账户","APIKEY is not Empty":"APIKEY 不能为空","Add Account":"添加账号","Getting Your APIKEY":"获取您的APIKEY","Choose Selected Images":"选择选中的图片","Choose images to continue":"选择图片以继续",Background:"背景",Hat:"帽子",Hair:"头发",Body:"身体",Face:"脸部",Clothes:"衣服",Others:"其他",Glove:"手套",Sunglasses:"太阳镜","Upper-clothes":"上衣",Dress:"连衣裙",Coat:"外套",Socks:"袜子",Pants:"裤子",Jumpsuits:"连体衣",Scarf:"围巾",Skirt:"裙子","Left-arm":"左臂","Right-arm":"右臂","Left-leg":"左腿","Right-leg":"右腿","Left-shoe":"左鞋","Right-shoe":"右鞋",s:"秒","No Node Templates Found":"未找到节点模板预设","Get Node Templates File Failed":"获取节点模板文件失败","Node template with {key} not set":"未设置快捷键为{key}的节点预设","ComfyUI Basic":"ComfyUI 基础节点","Recommend Nodes":"推荐节点","Others A~Z":"其他节点 A~Z"},z=A("AGL.Locale"),V=(e,t=!1)=>"zh-CN"===(t?navigator.language:z)&&U[e]||e,H={addGroup:{id:"EasyUse.Hotkeys.AddGroup",name:V("Enable Shift+g to add selected nodes to a group"),tooltip:V(""),type:"boolean",defaultValue:!0},alignSelectedNodes:{id:"EasyUse.Hotkeys.AlignSelectedNodes",name:V("Enable Shift+Up/Down/Left/Right key to align selected nodes"),tooltip:V(""),type:"boolean",defaultValue:!0},nodesTemplate:{id:"EasyUse.Hotkeys.NodesTemplate",name:V("Enable ALT+1~9 to paste nodes from nodes template"),tooltip:V(""),type:"boolean",defaultValue:!0},jumpNearestNodes:{id:"EasyUse.Hotkeys.JumpNearestNodes",name:V("Enable Up/Down/Left/Right key to jump nearest nodes"),tooltip:V(""),type:"boolean",defaultValue:!0},subDirectories:{id:"EasyUse.ContextMenu.SubDirectories",name:V("Enable contextMenu auto nest subdirectories"),tooltip:V(""),type:"boolean",defaultValue:!0},modelsThumbnails:{id:"EasyUse.ContextMenu.ModelsThumbnails",name:V("Enable model thumbnails display"),tooltip:V(""),type:"boolean",defaultValue:!0},rightMenuNodesSort:{id:"EasyUse.ContextMenu.NodesSort",name:V("Enable right-click menu to add node A~Z sorting"),tooltip:V(""),type:"boolean",defaultValue:!0},nodesRuntime:{id:"EasyUse.Nodes.Runtime",name:V("Enable nodes runtime display"),tooltip:V(""),type:"boolean",defaultValue:!0},chainGetSet:{id:"EasyUse.Nodes.ChainGetSet",name:V("Enable chain get node and set node with parent nodes"),tooltip:V(""),type:"boolean",defaultValue:!0}};function W(e=100,t){return new Promise((n=>{setTimeout((()=>{n(t)}),e)}))} +!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('@charset "UTF-8";.easyuse-model-info{color:#fff;max-width:90vw;font-family:var(--font-family)}.easyuse-model-content{display:flex;flex-direction:column;overflow:hidden}.easyuse-model-header{margin:0 0 15px}.easyuse-model-header-remark{display:flex;align-items:center;margin-top:5px}.easyuse-model-info h2{text-align:left;margin:0}.easyuse-model-info h5{text-align:left;margin:0 15px 0 0;font-weight:400;color:var(--descrip-text)}.easyuse-model-info p{margin:5px 0}.easyuse-model-info a{color:var(--theme-color-light)}.easyuse-model-info a:hover{text-decoration:underline}.easyuse-model-tags-list{display:flex;flex-wrap:wrap;list-style:none;gap:10px;max-height:200px;overflow:auto;margin:10px 0;padding:0}.easyuse-model-tag{background-color:var(--comfy-input-bg);border:2px solid var(--border-color);color:var(--input-text);display:flex;align-items:center;gap:5px;border-radius:5px;padding:2px 5px;cursor:pointer}.easyuse-model-tag--selected span:before{content:"✅";position:absolute;background-color:var(--theme-color-light);left:0;top:0;right:0;bottom:0;text-align:center}.easyuse-model-tag:hover{border:2px solid var(--theme-color-light)}.easyuse-model-tag p{margin:0}.easyuse-model-tag span{text-align:center;border-radius:5px;background-color:var(--theme-color-light);padding:2px;position:relative;min-width:20px;overflow:hidden;color:#fff}.easyuse-model-metadata .comfy-modal-content{max-width:100%}.easyuse-model-metadata label{margin-right:1ch;color:#ccc}.easyuse-model-metadata span{color:var(--theme-color-light)}.easyuse-preview{max-width:660px;margin-right:15px;position:relative}.easyuse-preview-group{position:relative;overflow:hidden;border-radius:.5rem;width:660px}.easyuse-preview-list{display:flex;flex-wrap:nowrap;width:100%;transition:all .5s ease-in-out}.easyuse-preview-list.no-transition{transition:none}.easyuse-preview-slide{display:flex;flex-basis:calc(50% - 5px);flex-grow:0;flex-shrink:0;position:relative;justify-content:center;align-items:center;padding-right:5px;padding-left:0}.easyuse-preview-slide:nth-child(2n){padding-left:5px;padding-right:0}.easyuse-preview-slide-content{position:relative;min-height:150px;width:100%}.easyuse-preview-slide-content .save{position:absolute;right:6px;z-index:12;bottom:6px;display:flex;align-items:center;height:26px;padding:0 9px;color:var(--input-text);font-size:12px;line-height:26px;background:#00000080;border-radius:13px;cursor:pointer;min-width:80px;text-align:center}.easyuse-preview-slide-content .save:hover{filter:brightness(120%);will-change:auto}.easyuse-preview-slide-content img{border-radius:14px;object-position:center center;max-width:100%;max-height:700px;border-style:none;vertical-align:middle}.easyuse-preview button{position:absolute;z-index:10;top:50%;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:15px;border:1px solid rgba(66,63,78,.15);background-color:#423f4e80;color:#fffc;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transform:translateY(-50%)}.easyuse-preview button.left{left:10px}.easyuse-preview button.right{right:10px}.easyuse-model-detail{margin-top:16px;overflow:hidden;border:1px solid var(--border-color);border-radius:8px;width:300px}.easyuse-model-detail-head{height:40px;padding:0 10px;font-weight:500;font-size:14px;font-style:normal;line-height:40px}.easyuse-model-detail-body{box-sizing:border-box;font-size:12px}.easyuse-model-detail-item{display:flex;justify-content:flex-start;border-top:1px solid var(--border-color)}.easyuse-model-detail-item-label{flex-shrink:0;width:88px;padding-top:5px;padding-bottom:5px;padding-left:10px;border-right:1px solid var(--border-color);color:var(--input-text);font-weight:400}.easyuse-model-detail-item-value{display:flex;flex-wrap:wrap;padding:5px 10px;color:var(--input-text)}.easyuse-model-detail-textarea{border-top:1px solid var(--border-color);padding:10px;height:100px;overflow-y:auto;font-size:12px}.easyuse-model-detail-textarea textarea{width:100%;height:100%;border:0;background-color:transparent;color:var(--input-text)}.easyuse-model-detail-textarea textarea::placeholder{color:var(--descrip-text)}.easyuse-model-detail-textarea.empty{display:flex;justify-content:center;align-items:center;color:var(--descrip-text)}.easyuse-model-notes{background-color:#00000040;padding:5px;margin-top:5px}.easyuse-model-notes:empty{display:none}.easyuse-account-user{font-size:10px;color:var(--descrip-text);text-align:center}.easyuse-account-user-info{display:flex;justify-content:space-between;align-items:center;padding-bottom:10px;cursor:pointer}.easyuse-account-user-info .user{display:flex;align-items:center}.easyuse-account-user-info .edit{padding:5px 10px;background:var(--comfy-menu-bg);border-radius:4px}.easyuse-account-user-info:hover{filter:brightness(110%)}.easyuse-account-user-info h5{margin:0;font-size:10px;text-align:left}.easyuse-account-user-info h6{margin:0;font-size:8px;text-align:left;font-weight:300}.easyuse-account-user-info .remark{margin-top:4px}.easyuse-account-user-info .avatar{width:36px;height:36px;background:var(--comfy-input-bg);border-radius:50%;margin-right:5px;display:flex;justify-content:center;align-items:center;font-size:16px;overflow:hidden}.easyuse-account-user-info .avatar img{width:100%;height:100%}.easyuse-account-dialog{width:600px}.easyuse-account-dialog-main a,.easyuse-account-dialog-main a:visited{font-weight:400;color:var(--theme-color-light)}.easyuse-account-dialog-item{display:flex;justify-content:flex-start;align-items:center;padding:10px 0;border-bottom:1px solid var(--border-color)}.easyuse-account-dialog-item input{padding:5px;margin-right:5px}.easyuse-account-dialog-item input.key{flex:1}.easyuse-account-dialog-item button{cursor:pointer;margin-left:5px!important;padding:5px!important;font-size:16px!important}.easyuse-account-dialog-item button:hover{filter:brightness(120%)}.easyuse-account-dialog-item button.choose{background:var(--theme-color)}.easyuse-account-dialog-item button.delete{background:var(--error-color)}.easy-dropdown,.easy-nested-dropdown{position:relative;box-sizing:border-box;background-color:#171717;box-shadow:0 4px 4px #ffffff40;padding:0;margin:0;list-style:none;z-index:1000;overflow:visible;max-height:fit-content;max-width:fit-content}.easy-dropdown{position:absolute;border-radius:0}.easy-dropdown li.item,.easy-nested-dropdown li.item{font-weight:400;min-width:max-content}.easy-dropdown li.folder,.easy-nested-dropdown li.folder{cursor:default;position:relative;border-right:3px solid cyan}.easy-dropdown li.folder:after,.easy-nested-dropdown li.folder:after{content:">";position:absolute;right:2px;font-weight:400}.easy-dropdown li,.easy-nested-dropdown li{padding:4px 10px;cursor:pointer;font-family:system-ui;font-size:.7rem;position:relative}.easy-nested-dropdown{position:absolute;top:0;left:100%;margin:0;border:none;display:none}.easy-dropdown li.selected>.easy-nested-dropdown,.easy-nested-dropdown li.selected>.easy-nested-dropdown{display:block;border:none}.easy-dropdown li.selected,.easy-nested-dropdown li.selected{background-color:#e5e5e5;border:none}:root{--theme-color:var(--primary-bg);--theme-color-light: var(--primary-hover-bg);--success-color: #52c41a;--error-color: #ff4d4f;--warning-color: #faad14;--font-family: Inter, -apple-system, BlinkMacSystemFont, Helvetica Neue, sans-serif;--p-inputtext-background: var(--p-form-field-background);--p-inputtext-disabled-background: var(--p-form-field-disabled-background);--p-inputtext-filled-background: var(--p-form-field-filled-background);--p-inputtext-filled-focus-background: var(--p-form-field-filled-focus-background);--p-inputtext-border-color: var(--p-form-field-border-color);--p-inputtext-hover-border-color: var(--p-form-field-hover-border-color);--p-inputtext-focus-border-color: var(--p-form-field-focus-border-color);--p-inputtext-invalid-border-color: var(--p-form-field-invalid-border-color);--p-inputtext-color: var(--p-form-field-color);--p-inputtext-disabled-color: var(--p-form-field-disabled-color);--p-inputtext-placeholder-color: var(--p-form-field-placeholder-color);--p-inputtext-shadow: var(--p-form-field-shadow);--p-inputtext-padding-x: var(--p-form-field-padding-x);--p-inputtext-padding-y: var(--p-form-field-padding-y);--p-inputtext-border-radius: var(--p-form-field-border-radius);--p-inputtext-focus-ring-width: var(--p-form-field-focus-ring-width);--p-inputtext-focus-ring-style: var(--p-form-field-focus-ring-style);--p-inputtext-focus-ring-color: var(--p-form-field-focus-ring-color);--p-inputtext-focus-ring-offset: var(--p-form-field-focus-ring-offset);--p-inputtext-focus-ring-shadow: var(--p-form-field-focus-ring-shadow);--p-inputtext-transition-duration: var(--p-form-field-transition-duration);--p-inputtext-sm-font-size: .875rem;--p-inputtext-sm-padding-x: .625rem;--p-inputtext-sm-padding-y: .375rem;--p-inputtext-lg-font-size: 1.125rem;--p-inputtext-lg-padding-x: .875rem;--p-inputtext-lg-padding-y: .625rem;--p-tag-font-size: .875rem;--p-tag-font-weight: 700;--p-tag-padding: .25rem .5rem;--p-tag-gap: .25rem;--p-tag-border-radius: var(--p-content-border-radius);--p-tag-rounded-border-radius: var(--p-border-radius-xl);--p-tag-icon-size: .75rem;--p-tag-primary-background: var(--p-primary-100);--p-tag-primary-color: var(--p-primary-700);--p-tag-secondary-background: var(--p-surface-100);--p-tag-secondary-color: var(--p-surface-600);--p-tag-success-background: var(--p-green-100);--p-tag-success-color: var(--p-green-700);--p-tag-info-background: var(--p-sky-100);--p-tag-info-color: var(--p-sky-700);--p-tag-warn-background: var(--p-orange-100);--p-tag-warn-color: var(--p-orange-700);--p-tag-danger-background: var(--p-red-100);--p-tag-danger-color: var(--p-red-700);--p-tag-contrast-background: var(--p-surface-950);--p-tag-contrast-color: var(--p-surface-0)}:root .dark-theme{--p-tag-font-size: .875rem;--p-tag-font-weight: 700;--p-tag-padding: .25rem .5rem;--p-tag-gap: .25rem;--p-tag-border-radius: var(--p-content-border-radius);--p-tag-rounded-border-radius: var(--p-border-radius-xl);--p-tag-icon-size: .75rem;--p-tag-primary-background: color-mix(in srgb, var(--p-primary-500), transparent 84%);--p-tag-primary-color: var(--p-primary-300);--p-tag-secondary-background: var(--p-surface-800);--p-tag-secondary-color: var(--p-surface-300);--p-tag-success-background: color-mix(in srgb, var(--p-green-500), transparent 84%);--p-tag-success-color: var(--p-green-300);--p-tag-info-background: color-mix(in srgb, var(--p-sky-500), transparent 84%);--p-tag-info-color: var(--p-sky-300);--p-tag-warn-background: color-mix(in srgb, var(--p-orange-500), transparent 84%);--p-tag-warn-color: var(--p-orange-300);--p-tag-danger-background: color-mix(in srgb, var(--p-red-500), transparent 84%);--p-tag-danger-color: var(--p-red-300);--p-tag-contrast-background: var(--p-surface-0);--p-tag-contrast-color: var(--p-surface-950)}.comfyui-easyuse-theme,.comfyui-easyuse-primary{color:var(--theme-color-light)}.comfyui-easyuse-theme.point:hover,.comfyui-easyuse-primary.point:hover{opacity:.8}.comfyui-easyuse-success{color:var(--success-color)}.comfyui-easyuse-success.point:hover{opacity:.8}.comfyui-easyuse-error{color:var(--error-color)}.comfyui-easyuse-error.point:hover{opacity:.8}.comfyui-easyuse-warning,.comfyui-easyuse--warn{color:var(--warning-color)}.comfyui-easyuse-warning.point:hover,.comfyui-easyuse--warn.point:hover{opacity:.8}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.grid{display:grid}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-10{gap:2.5rem}.gap-12{gap:3rem}.gap-2{gap:.5rem}.gap-2\\.5{gap:.625rem}.gap-20{gap:5rem}.gap-3{gap:.75rem}.gap-3\\.5{gap:.875rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-7{gap:1.75rem}.gap-8{gap:2rem}.gap-\\[0\\.28rem\\]{gap:.28rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.gap-y-6{row-gap:1.5rem}@media (min-width: 576px){.sm\\:col-span-4{grid-column:span 4/span 4}.sm\\:col-span-6{grid-column:span 6/span 6}.sm\\:ml-8{margin-left:2rem}.sm\\:mt-0{margin-top:0}.sm\\:flex{display:flex}.sm\\:h-60{height:15rem}.sm\\:\\!w-64{width:16rem!important}.sm\\:w-40{width:10rem}.sm\\:w-44{width:11rem}.sm\\:w-56{width:14rem}.sm\\:w-60{width:15rem}.sm\\:w-64{width:16rem}.sm\\:w-80{width:20rem}.sm\\:w-96{width:24rem}.sm\\:w-\\[30rem\\]{width:30rem}.sm\\:w-auto{width:auto}.sm\\:min-w-\\[30rem\\]{min-width:30rem}.sm\\:flex-row{flex-direction:row}.sm\\:flex-col{flex-direction:column}.sm\\:flex-nowrap{flex-wrap:nowrap}.sm\\:items-start{align-items:flex-start}.sm\\:items-end{align-items:flex-end}.sm\\:items-center{align-items:center}.sm\\:justify-center{justify-content:center}.sm\\:justify-between{justify-content:space-between}.sm\\:gap-2{gap:.5rem}.sm\\:p-20{padding:5rem}.sm\\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\\:py-10{padding-bottom:2.5rem;padding-top:2.5rem}.sm\\:py-5{padding-bottom:1.25rem;padding-top:1.25rem}.sm\\:pt-32{padding-top:8rem}.sm\\:text-left{text-align:left}.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\\:-bottom-12{bottom:-3rem}.md\\:-bottom-28{bottom:-7rem}.md\\:-bottom-8{bottom:-2rem}.md\\:-bottom-\\[26rem\\]{bottom:-26rem}.md\\:-left-12{left:-3rem}.md\\:-left-28{left:-7rem}.md\\:-left-32{left:-8rem}.md\\:-left-4{left:-1rem}.md\\:-left-48{left:-12rem}.md\\:-left-\\[22rem\\]{left:-22rem}.md\\:bottom-0{bottom:0}.md\\:left-10{left:2.5rem}.md\\:left-\\[32rem\\]{left:32rem}.md\\:left-\\[42rem\\]{left:42rem}.md\\:top-1\\/2{top:50%}.md\\:top-32{top:8rem}.md\\:top-8{top:2rem}.md\\:col-span-2{grid-column:span 2/span 2}.md\\:col-span-4{grid-column:span 4/span 4}.md\\:col-span-6{grid-column:span 6/span 6}.md\\:ml-auto{margin-left:auto}.md\\:block{display:block}.md\\:flex{display:flex}.md\\:hidden{display:none}.md\\:h-\\[20rem\\]{height:20rem}.md\\:h-\\[32rem\\]{height:32rem}.md\\:\\!w-80{width:20rem!important}.md\\:w-2\\/12{width:16.666667%}.md\\:w-40{width:10rem}.md\\:w-5\\/12{width:41.666667%}.md\\:w-56{width:14rem}.md\\:w-6\\/12{width:50%}.md\\:w-60{width:15rem}.md\\:w-8\\/12{width:66.666667%}.md\\:w-80{width:20rem}.md\\:w-\\[100rem\\]{width:100rem}.md\\:w-\\[26rem\\]{width:26rem}.md\\:w-\\[30rem\\]{width:30rem}.md\\:w-\\[50rem\\]{width:50rem}.md\\:w-\\[52rem\\]{width:52rem}.md\\:w-\\[60rem\\]{width:60rem}.md\\:w-\\[95rem\\]{width:95rem}.md\\:w-screen{width:100vw}.md\\:flex-initial{flex:0 1 auto}.md\\:-translate-y-1\\/2{--tw-translate-y: -50% }.md\\:-translate-y-1\\/2,.md\\:translate-x-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-x-0{--tw-translate-x: 0px }.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:flex-row{flex-direction:row}.md\\:flex-col{flex-direction:column}.md\\:items-end{align-items:flex-end}.md\\:items-center{align-items:center}.md\\:justify-start{justify-content:flex-start}.md\\:justify-center{justify-content:center}.md\\:gap-20{gap:5rem}.md\\:gap-4{gap:1rem}.md\\:p-5{padding:1.25rem}.md\\:p-8{padding:2rem}}@media (min-width: 992px){.lg\\:left-20{left:5rem}.lg\\:left-\\[36rem\\]{left:36rem}.lg\\:left-\\[50rem\\]{left:50rem}.lg\\:col-span-1{grid-column:span 1/span 1}.lg\\:col-span-2{grid-column:span 2/span 2}.lg\\:col-span-4{grid-column:span 4/span 4}.lg\\:col-span-6{grid-column:span 6/span 6}.lg\\:mb-0{margin-bottom:0}.lg\\:mt-0{margin-top:0}.lg\\:mt-20{margin-top:5rem}.lg\\:flex{display:flex}.lg\\:hidden{display:none}.lg\\:h-10{height:2.5rem}.lg\\:h-32{height:8rem}.lg\\:h-\\[28rem\\]{height:28rem}.lg\\:\\!w-\\[30rem\\]{width:30rem!important}.lg\\:w-3\\/12{width:25%}.lg\\:w-32{width:8rem}.lg\\:w-\\[28rem\\]{width:28rem}.lg\\:w-\\[64rem\\]{width:64rem}.lg\\:w-fit{width:-moz-fit-content;width:fit-content}.lg\\:max-w-6xl{max-width:72rem}.lg\\:flex-row{flex-direction:row}.lg\\:gap-0{gap:0}.lg\\:rounded-2xl{border-radius:1rem}.lg\\:rounded-3xl{border-radius:1.5rem}.lg\\:rounded-xl{border-radius:.75rem}.lg\\:p-7{padding:1.75rem}.lg\\:px-2{padding-left:.5rem;padding-right:.5rem}.lg\\:px-20{padding-left:5rem;padding-right:5rem}.lg\\:px-56{padding-left:14rem;padding-right:14rem}.lg\\:px-8{padding-left:2rem;padding-right:2rem}.lg\\:px-9{padding-left:2.25rem;padding-right:2.25rem}.lg\\:py-20{padding-bottom:5rem;padding-top:5rem}.lg\\:py-7{padding-bottom:1.75rem;padding-top:1.75rem}.lg\\:pt-0{padding-top:0}.lg\\:text-2xl{font-size:1.5rem;line-height:2rem}.lg\\:text-5xl{font-size:3rem;line-height:1}.lg\\:text-base{font-size:1rem;line-height:1.5rem}.lg\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1200px){.xl\\:-left-12{left:-3rem}.xl\\:-left-28{left:-7rem}.xl\\:bottom-0{bottom:0}.xl\\:left-36{left:9rem}.xl\\:left-\\[42rem\\]{left:42rem}.xl\\:left-\\[60rem\\]{left:60rem}.xl\\:col-span-3{grid-column:span 3/span 3}.xl\\:col-span-4{grid-column:span 4/span 4}.xl\\:col-span-6{grid-column:span 6/span 6}.xl\\:block{display:block}.xl\\:flex{display:flex}.xl\\:hidden{display:none}.xl\\:h-\\[36\\.25rem\\]{height:36.25rem}.xl\\:\\!w-40{width:10rem!important}.xl\\:w-3\\/12{width:25%}.xl\\:w-6\\/12{width:50%}.xl\\:w-96{width:24rem}.xl\\:w-\\[29rem\\]{width:29rem}.xl\\:max-w-36{max-width:9rem}.xl\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\\:flex-row{flex-direction:row}.xl\\:items-start{align-items:flex-start}.xl\\:items-center{align-items:center}.xl\\:gap-1{gap:.25rem}.xl\\:gap-6{gap:1.5rem}.xl\\:text-left{text-align:left}}.comfyui-easyuse-toast{position:fixed;z-index:99999;top:0;left:0;height:0;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:start}.comfyui-easyuse-toast-container{position:relative;height:fit-content;padding:4px;margin-top:-100px;opacity:0;z-index:3;-webkit-transition:all .3s ease-in-out;-khtml-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-ms-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.comfyui-easyuse-toast-container:last-child{z-index:1}.comfyui-easyuse-toast-container.show{opacity:1;margin-top:0!important;transform:translateY(0)}.comfyui-easyuse-toast-container:not(.show){z-index:1}.comfyui-easyuse-toast-container>div{position:relative;background:var(--comfy-menu-bg);color:var(--input-text);height:fit-content;box-shadow:0 0 10px #000000e0;padding:9px 12px;border-radius:var(--border-radius);font-size:14px;pointer-events:all;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-toast-container>div>span{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-toast-container>div>span i{font-size:16px;margin-right:8px}.comfyui-easyuse-toast-container>div>span i.loading{animation:loading-rotate 1s linear infinite}.comfyui-easyuse-toast-container a{cursor:pointer;text-decoration:underline;color:var(--theme-color-light);margin-left:4px;display:inline-block;line-height:1}.comfyui-easyuse-toast-container a:hover{color:var(--theme-color-light);text-decoration:none}@keyframes loading-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.comfyui-easyuse-selector{position:relative}.comfyui-easyuse-selector.hide{display:none}.comfyui-easyuse-selector__header{--height:26px;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;height:var(--height);padding-bottom:10px;border-bottom:1px solid var(--border-color-solid)}.comfyui-easyuse-selector__header_button{height:var(--height);width:var(--height);border-radius:var(--border-radius);border:1px solid var(--border-color);font-size:11px;background:var(--bg-color);box-shadow:none;cursor:pointer;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-selector__header_button:hover{filter:brightness(1.2)}.comfyui-easyuse-selector__header_button:hover i{color:var(--error-color)}.comfyui-easyuse-selector__header_button i{font-size:16px;color:var(--input-text);-webkit-transition:all .3s ease-in-out;-khtml-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-ms-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.comfyui-easyuse-selector__header_search{flex:1;margin-left:10px;border-radius:var(--border-radius);border:1px solid var(--border-color);font-size:11px;background:var(--bg-color);padding:0 8px;height:var(--height);display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-selector__header_search i{font-size:16px}.comfyui-easyuse-selector__header_search .search{vertical-align:middle;margin-left:5px;outline:none;resize:none;border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;overflow-y:scroll;background:transparent;width:100%;line-height:var(--height);font-size:12px;color:var(--input-text);-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1}.comfyui-easyuse-selector__content{list-style:none;padding:0;margin:0;min-height:150px;height:calc(100% - 28px);overflow-y:auto;overflow-x:hidden}.comfyui-easyuse-selector-item{display:inline-block;position:relative}.comfyui-easyuse-selector-item__tag{display:inline-block;vertical-align:middle;margin-top:8px;margin-right:8px;padding:4px;color:var(--input-text);background-color:var(--bg-color);border-radius:var(--border-radius);border:1px solid var(--border-color);font-size:11px;cursor:pointer;overflow:hidden;position:relative}.comfyui-easyuse-selector-item__tag:hover{filter:brightness(1.2)}.comfyui-easyuse-selector-item__tag.hide{display:none}.comfyui-easyuse-selector-item__tag input{--ring-color: transparent;position:relative;box-shadow:none;border:1px solid var(--border-color);border-radius:2px;background:linear-gradient(135deg,var(--comfy-menu-bg) 0%,var(--comfy-input-bg) 60%)}.comfyui-easyuse-selector-item__tag input[type=checkbox]{display:inline-block;flex-shrink:0;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid var(--border-color);background-origin:border-box;padding:0;width:1rem;height:1rem;border-radius:4px;color:var(--theme-color-light);-webkit-user-select:none;user-select:none}.comfyui-easyuse-selector-item__tag input[type=checkbox]:checked{border:1px solid var(--theme-color-light);background-color:var(--theme-color-light);background-image:url("data:image/svg+xml,%3csvg viewBox=\'0 0 16 16\' fill=\'white\' xmlns=\'http://www.w3.org/2000/svg\'%3e%3cpath d=\'M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z\'/%3e%3c/svg%3e")}.comfyui-easyuse-selector-item__tag input span{margin:0 4px;vertical-align:middle}.comfyui-easyuse-selector-preview{position:absolute;left:-180px;top:-110px;z-index:2;border:1px solid var(--border-color);border-radius:var(--border-radius);background:var(--comfy-menu-bg);-webkit-backdrop-filter:saturate(180%) blur(40px);-khtml-backdrop-filter:saturate(180%) blur(40px);-moz-backdrop-filter:saturate(180%) blur(40px);-ms-backdrop-filter:saturate(180%) blur(40px);-o-backdrop-filter:saturate(180%) blur(40px);backdrop-filter:saturate(180%) blur(40px);overflow:hidden}.comfyui-easyuse-selector-preview img{width:150px;height:150px}.comfyui-easyuse-selector-preview__text{font-size:12px;padding:5px 10px;max-width:130px;color:var(--input-text)}.comfyui-easyuse-selector-preview__text h6{line-height:1.15;font-size:10px;margin:10px 0}.comfyui-easyuse-dialog{max-width:600px}.comfyui-easyuse-dialog-title{font-size:18px;font-weight:700;text-align:center;color:var(--input-text);margin:0}.comfyui-easyuse-dialog-images{margin-top:10px;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box}.comfyui-easyuse-dialog-images img{width:50%;height:auto;cursor:pointer;box-sizing:border-box;filter:brightness(80%)}.comfyui-easyuse-dialog-images img:hover{filter:brightness(100%)}.comfyui-easyuse-dialog-images.selected{border:4px solid var(--success-color)}.comfyui-easyuse-dialog-hidden{display:none;height:0}.comfyui-easyuse-contextmenu{--height: 26px;--padding: 8px;font-family:var(--font-family);position:fixed;top:0;left:0;width:100%;max-width:200px;min-width:100px;min-height:100px;padding:var(--padding) 0;box-shadow:0 0 10px #00000040;background-color:var(--tr-odd-bg-color);border-radius:var(--border-radius);z-index:10;will-change:transform}.comfyui-easyuse-contextmenu-item-divider{height:1px;width:100%;background-color:var(--border-color);margin:var(--padding) 0}.comfyui-easyuse-contextmenu-item-content{height:var(--height);padding:0 12px;cursor:pointer;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-contextmenu-item-content span{font-size:11px;color:var(--input-text);display:-webkit-box;-webkit-line-clamp:1;overflow:hidden;word-break:break-all;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1}.comfyui-easyuse-contextmenu-item-content i{color:var(--input-text);margin-left:4px;display:block;width:0;height:0;border-width:4px 4px 0;border-style:solid;border-color:var(--descrip-text) transparent transparent;-webkit-transform:scaleY(.8) rotate(-90deg);-khtml-transform:scaleY(.8) rotate(-90deg);-moz-transform:scaleY(.8) rotate(-90deg);-ms-transform:scaleY(.8) rotate(-90deg);-o-transform:scaleY(.8) rotate(-90deg);transform:scaleY(.8) rotate(-90deg)}.comfyui-easyuse-contextmenu-item-content:hover{background:var(--theme-color)}.comfyui-easyuse-contextmenu-item.disabled .comfyui-easyuse-contextmenu-item-content span{color:var(--border-color);cursor:default}.comfyui-easyuse-contextmenu-item.disabled .comfyui-easyuse-contextmenu-item-content:hover{background:transparent}.comfyui-easyuse-contextmenu-submenu{font-family:var(--font-family);position:absolute;top:0;left:200px;max-width:200px;width:200px;min-width:100px;min-height:--height;padding:var(--padding) 0;box-shadow:0 0 10px #00000040;background-color:var(--tr-odd-bg-color);border-radius:var(--border-radius);z-index:10;will-change:transform}.comfyui-easyuse-contextmenu-model{position:relative}.comfyui-easyuse-contextmenu-model:hover img{display:block;opacity:1}.comfyui-easyuse-contextmenu-model img{position:absolute;z-index:1;right:-175px;top:-75px;width:150px;height:auto;display:none;filter:brightness(70%);-webkit-filter:brightness(70%);opacity:0;-webkit-transition:all .5s cubic-bezier(.55,0,.1,1);-khtml-transition:all .5s cubic-bezier(.55,0,.1,1);-moz-transition:all .5s cubic-bezier(.55,0,.1,1);-ms-transition:all .5s cubic-bezier(.55,0,.1,1);-o-transition:all .5s cubic-bezier(.55,0,.1,1);transition:all .5s cubic-bezier(.55,0,.1,1)}.comfyui-easyuse-slider{width:100%;height:100%;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-slider-item{height:inherit;min-width:25px;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-webkit-flex-direction:column;-khtml-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;-o-flex-direction:column;flex-direction:column}.comfyui-easyuse-slider-item-input{height:15px;font-size:10px;color:var(--input-text)}.comfyui-easyuse-slider-item-label{height:15px;border:none;color:var(--descrip-text);font-size:8px}.comfyui-easyuse-slider-item-scroll{width:5px;height:calc(100% - 30px);background:var(--comfy-input-bg);border-radius:10px;position:relative}.comfyui-easyuse-slider-item-bar{width:10px;height:10px;background:linear-gradient(to bottom,var(--input-text),var(--descrip-text));border-radius:100%;box-shadow:0 2px 10px var(--bg-color);position:absolute;top:0;left:-2.5px;cursor:pointer;z-index:1}.comfyui-easyuse-slider-item-area{width:100%;border-radius:20px;position:absolute;bottom:0;background:var(--input-text);z-index:0}.comfyui-easyuse-slider-item.positive .comfyui-easyuse-slider-item-label{color:var(--success-color)}.comfyui-easyuse-slider-item.positive .comfyui-easyuse-slider-item-area{background:var(--success-color)}.comfyui-easyuse-slider-item.negative .comfyui-easyuse-slider-item-label{color:var(--error-color)}.comfyui-easyuse-slider-item.negative .comfyui-easyuse-slider-item-area{background:var(--error-color)}.comfyui-easyuse-map{height:100%;background:var(--comfy-menu-bg)}.comfyui-easyuse-map .p-splitter-gutter-handle{height:1px!important}.comfyui-easyuse-map-nodes{height:100%;position:relative}.comfyui-easyuse-map-nodes__header{position:absolute;z-index:2;top:0;left:0;width:100%;padding:.25rem 0 .25rem 1rem;height:2.7rem;background:var(--comfy-menu-bg);border-bottom:1px solid var(--border-color);display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-webkit-backdrop-filter:saturate(180%) blur(40px);-khtml-backdrop-filter:saturate(180%) blur(40px);-moz-backdrop-filter:saturate(180%) blur(40px);-ms-backdrop-filter:saturate(180%) blur(40px);-o-backdrop-filter:saturate(180%) blur(40px);backdrop-filter:saturate(180%) blur(40px)}.comfyui-easyuse-map-nodes__header .title{font-size:13px;color:var(--input-text);font-weight:400;line-height:1.5}.comfyui-easyuse-map-nodes__header .toolbar{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-map-nodes__header .toolbar .icon{font-size:.85rem;margin-left:.25rem;cursor:pointer}.comfyui-easyuse-map-nodes__content{position:relative;padding:2.7rem 0 0;height:100%;overflow:auto}.comfyui-easyuse-map-nodes__content dl .label{padding-left:1rem}.comfyui-easyuse-map-nodes__content ol,.comfyui-easyuse-map-nodes__content dl{list-style-type:none;padding:0;margin:0}.comfyui-easyuse-map-nodes__content ol .toolbar span,.comfyui-easyuse-map-nodes__content dl .toolbar span{font-size:13px}.comfyui-easyuse-map-nodes__content ol .toolbar span.pi-eye,.comfyui-easyuse-map-nodes__content dl .toolbar span.pi-eye{color:var(--input-text)}.comfyui-easyuse-map-nodes__content ol .toolbar span.pi-eye-slash,.comfyui-easyuse-map-nodes__content dl .toolbar span.pi-eye-slash{color:var(--descrip-text)}.comfyui-easyuse-map-nodes__content ol .toolbar span.pi-eye-slash.never,.comfyui-easyuse-map-nodes__content dl .toolbar span.pi-eye-slash.never{opacity:.5}.comfyui-easyuse-map-nodes__content .no_result{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;text-align:center}.comfyui-easyuse-map-nodes-group{position:relative;overflow:hidden;width:100%;height:2rem;cursor:default;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-map-nodes-group .left,.comfyui-easyuse-map-nodes-group .right{height:100%;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse-map-nodes-group .left{padding-left:.5rem;margin-right:.25rem;-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1}.comfyui-easyuse-map-nodes-group .icon{font-size:.85rem;margin-right:.25rem}.comfyui-easyuse-map-nodes-group .label{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;height:100%;width:100%;min-width:80px}.comfyui-easyuse-map-nodes-group .label span{font-size:14px;color:var(--input-text);font-weight:400;line-height:1.5;display:-webkit-box;-webkit-line-clamp:1;overflow:hidden;word-break:break-all;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.comfyui-easyuse-map-nodes-group:hover{background:var(--content-hover-bg)!important}.comfyui-easyuse-map-nodes-group.active{background:var(--theme-color)!important}.comfyui-easyuse-map-nodes-group.active .label{color:#fff;cursor:default}.comfyui-easyuse-map-nodes-group.never .label{color:var(--descrip-text);opacity:.4}.comfyui-easyuse-map-nodes-group.bypass .label{color:var(--descrip-text)}.comfyui-easyuse-map-nodes-node{height:2rem;cursor:default;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;position:relative;overflow:hidden}.comfyui-easyuse-map-nodes-node .label{text-indent:.5rem;font-size:13px;color:var(--input-text);font-weight:400;line-height:1.5;-webkit-box-flex:1;-ms-flex:1;-webkit-flex:1;flex:1;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;margin-right:.25rem;height:2rem;line-height:2rem;width:100%;display:-webkit-box;-webkit-line-clamp:1;overflow:hidden;word-break:break-all;text-overflow:ellipsis;-webkit-box-orient:vertical}.comfyui-easyuse-map-nodes-node .label.error{color:var(--error-color)}.comfyui-easyuse-map-nodes-node:hover{background:var(--content-hover-bg)!important}.comfyui-easyuse-map-nodes-node.never .label{color:var(--descrip-text);opacity:.5}.comfyui-easyuse-map-nodes-node.bypass .label{color:#f0f;opacity:.5}.comfyui-easyuse-map-nodes .nodes .label{text-indent:1rem}.no-result-placeholder{display:flex;justify-content:center;align-items:center;height:100%}.no-result-placeholder-content{text-align:center;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-khtml-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;-o-flex-direction:column;flex-direction:column;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;-o-justify-content:space-between;justify-content:space-between}.no-result-placeholder .p-card{background-color:transparent!important;box-shadow:none;text-align:center}.no-result-placeholder h3{color:var(--input-text);margin-bottom:.5rem}.no-result-placeholder p{color:var(--descrip-text);margin-bottom:1rem;margin-top:0}#comfyui-easyuse-components{position:absolute;top:0;left:0;z-index:2}.comfyui-easyuse{--p-datatable-header-cell-padding: .15rem 1rem;--p-datatable-body-cell-padding: .15rem 1rem;--p-primary-color: var(--theme-color-light)!important;--border-color-solid: var(--border-color);--border-radius: 8px}.comfyui-easyuse.dark-theme{--fg-color: #fff;--bg-color: #242427;--content-bg:#18181b;--content-fg:#fff;--content-hover-bg: #27272a;--comfy-menu-bg: rgba(24,24,27,.9);--comfy-input-bg: #242427;--input-text: #ffffff;--descrip-text: #71717a;--drag-text: #ccc;--error-text: #ff4444;--border-color: #3f3f46;--border-color-solid: #2a2a2e;--tr-even-bg-color: rgba(28,28,28,.9);--tr-odd-bg-color: rgba(19,19,19,.9)}.comfyui-easyuse ::-webkit-scrollbar{width:0em}.comfyui-easyuse ::-webkit-scrollbar-track{background-color:transparent}.comfyui-easyuse ::-webkit-scrollbar-thumb{background-color:transparent;border-radius:2px}.comfyui-easyuse ::-webkit-scrollbar-thumb:hover{background-color:transparent}.comfyui-easyuse body{font-family:var(--font-family)!important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.comfyui-easyuse textarea{font-family:var(--font-family)!important}.comfyui-easyuse hr{border:1px solid var(--border-color)}.comfyui-easyuse .comfy-multiline-input{background-color:transparent;border:1px solid var(--border-color-solid);border-radius:var(--border-radius);padding:8px;font-size:12px}.comfyui-easyuse #comfy-settings-dialog{border:1px solid var(--border-color);background:transparent;-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%);box-shadow:none}.comfyui-easyuse .comfy-modal{border:1px solid var(--border-color);box-shadow:none;-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .cm-title{background-color:transparent!important}.comfyui-easyuse .cm-notice-board{border-radius:10px!important;border:1px solid var(--border-color)!important}.comfyui-easyuse .cm-menu-container{margin-bottom:50px!important}.comfyui-easyuse .cn-manager-custom_milk_white .tg-column-name,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-column-name{color:var(--input-text)}.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-message,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-message{text-align:center;color:var(--descrip-text)!important}.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-frame .tg-cell,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-frame .tg-cell{color:var(--input-text)}.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-frame .cn-node-name a,.comfyui-easyuse .cn-manager-custom_milk_white .tg-body-frame .cmm-node-name a,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-frame .cn-node-name a,.comfyui-easyuse .cmm-manager-custom_milk_white .tg-body-frame .cmm-node-name a{color:var(--theme-color)!important}.comfyui-easyuse .comfy-menu{border-radius:16px;box-shadow:0 0 1px var(--descrip-text);-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .comfy-menu button.comfy-settings-btn{font-size:12px}.comfyui-easyuse .comfy-menu-btns{margin-bottom:4px}.comfyui-easyuse .comfy-menu button,.comfyui-easyuse .comfy-modal button{font-size:14px;padding:4px 0;margin-bottom:4px}.comfyui-easyuse .comfy-menu-btns button,.comfyui-easyuse .comfy-list-actions button{font-size:10px}.comfyui-easyuse .comfy-menu>button,.comfyui-easyuse .comfy-menu-btns button,.comfyui-easyuse .comfy-menu .comfy-list button,.comfyui-easyuse .comfy-modal button{border-width:1px}.comfyui-easyuse #comfy-dev-save-api-button{justify-content:center}.comfyui-easyuse #queue-button{position:relative;overflow:hidden;min-height:30px;z-index:1}.comfyui-easyuse #queue-button:after{clear:both;content:attr(data-attr);background:green;color:#fff;width:var(--process-bar-width);height:100%;position:absolute;top:0;left:0;z-index:0;text-align:center;display:flex;justify-content:center;align-items:center}.comfyui-easyuse #shareButton{background:linear-gradient(to left,var(--theme-color),var(--theme-color-light))!important;color:#fff!important}.comfyui-easyuse .litegraph.litecontextmenu{--height: 24px;--padding: 6px;font-family:var(--font-family);padding:var(--padding) 0;border-radius:var(--border-radius);-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .litegraph.litecontextmenu .litemenu-title{padding:var(--padding)}.comfyui-easyuse .litegraph.litecontextmenu>div:first-child.litemenu-title{margin-top:-6px}.comfyui-easyuse .litegraph.litecontextmenu .submenu{height:var(--height);line-height:var(--height);padding:0 18px 0 12px;margin:0;background:transparent!important}.comfyui-easyuse .litegraph.litecontextmenu .submenu.has_submenu{border-right:none;position:relative}.comfyui-easyuse .litegraph.litecontextmenu .submenu.has_submenu:after{content:"";display:block;width:0;height:0;border-width:4px 4px 0;border-style:solid;border-color:var(--input-text) transparent transparent;transform:translateY(-50%) rotate(-90deg);top:50%;position:absolute}.comfyui-easyuse .litegraph.litecontextmenu .submenu.separator{height:1px;width:100%;background-color:var(--border-color)!important;margin:var(--padding) 0;border:none}.comfyui-easyuse .litegraph.litecontextmenu .submenu:last-child.separator{display:none}.comfyui-easyuse .litegraph.litecontextmenu .submenu:hover:not(.separator){background:var(--theme-color)!important}.comfyui-easyuse .litegraph.lite-search-item{background-color:var(--comfy-input-bg)!important;filter:brightness(100%)}.comfyui-easyuse .litegraph.lite-search-item:hover{filter:brightness(120%);color:var(--input-text)}.comfyui-easyuse .graphdialog{-webkit-backdrop-filter:blur(8px) brightness(120%);backdrop-filter:blur(8px) brightness(120%)}.comfyui-easyuse .graphdialog button{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center}.comfyui-easyuse .comfyui-menu{border-bottom:1px solid var(--bg-color)}.comfyui-easyuse .side-tool-bar-container{border-right:1px solid var(--bg-color)}.comfyui-easyuse .comfy-modal-content{width:100%}.comfyui-easyuse-poseEditor{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-khtml-align-items:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;text-align:center;font-size:18px;line-height:1.5}#comfyui-menu-monitor{width:120px}#comfyui-menu-monitor #crystools-monitor-container{margin:0 auto!important}#comfyui-menu-monitor #crystools-monitor-container>div{margin:2px 0!important}#comfyui-menu-monitor #crystools-monitor-container>div>div>div{padding:0 4px!important}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}(); +var e,t,n,o,i,r,s,a,l,c,u,d,p,f,h,m,g=Object.defineProperty,v=(e,t,n)=>((e,t,n)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let y=(null==(t=null==(e=window.comfyAPI)?void 0:e.app)?void 0:t.app)||null,b=(null==(o=null==(n=window.comfyAPI)?void 0:n.api)?void 0:o.api)||null,_=(null==(r=null==(i=window.comfyAPI)?void 0:i.ui)?void 0:r.$el)||null,w=(null==(a=null==(s=window.comfyAPI)?void 0:s.dialog)?void 0:a.ComfyDialog)||null,S=(null==(c=null==(l=window.comfyAPI)?void 0:l.widgets)?void 0:c.ComfyWidgets)||null,x=(null==(d=null==(u=window.comfyAPI)?void 0:u.utils)?void 0:d.applyTextReplacements)||null,k=(null==(f=null==(p=window.comfyAPI)?void 0:p.groupNode)?void 0:f.GroupNodeConfig)||null;const C=(e,t=void 0)=>{var n,o;return e?null==(o=null==(n=null==y?void 0:y.ui)?void 0:n.settings)?void 0:o.getSettingValue(e,t):null};function A(e,t=null,n=void 0){try{let o=e?C(e,n):null;return void 0===o&&t&&(o=localStorage[e]),o}catch(o){return null}}async function E(e,t,n=null){var o,i;try{(null==(i=null==(o=null==y?void 0:y.ui)?void 0:o.settings)?void 0:i.setSettingValue)?y.ui.settings.setSettingValue(e,t):await b.storeSetting(e,t),n&&(localStorage[n]="object"==typeof t?JSON.stringify(t):t)}catch(r){}}function O(e,t){if(e="number"==typeof e?e:e instanceof Date?e.getTime():parseInt(e),isNaN(e))return null;let n=new Date(e);(e=n.toString().split(/[\s\:]/g).slice(0,-2))[1]=["01","02","03","04","05","06","07","08","09","10","11","12"][n.getMonth()];let o={MM:1,dd:2,yyyy:3,hh:4,mm:5,ss:6};return t.replace(/([Mmdhs]|y{2})\1/g,(t=>e[o[t]]))}const L="comfyui-easyuse-",T="dark-theme",N="#236692",I={PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},P=0x4000000000000,D=["loaders","latent","image","mask","sampling","_for_testing","advanced","utils","api"],j={ALWAYS:0,NEVER:2,BYPASS:4},M="easyuse_nodes_map",R=LGraphCanvas.node_colors.bgcolor,$={ColorPalette:{version:104,id:"obsidian",name:"Obsidian",colors:{node_slot:{CLIP:"#FFD500",CLIP_VISION:"#A8DADC",CLIP_VISION_OUTPUT:"#ad7452",CONDITIONING:"#FFA931",CONTROL_NET:"#6EE7B7",IMAGE:"#64B5F6",LATENT:"#FF9CF9",MASK:"#81C784",MODEL:"#B39DDB",STYLE_MODEL:"#C2FFAE",VAE:"#FF6E6E",TAESD:"#DCC274",PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},litegraph_base:{BACKGROUND_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQBJREFUeNrs1rEKwjAUhlETUkj3vP9rdmr1Ysammk2w5wdxuLgcMHyptfawuZX4pJSWZTnfnu/lnIe/jNNxHHGNn//HNbbv+4dr6V+11uF527arU7+u63qfa/bnmh8sWLBgwYJlqRf8MEptXPBXJXa37BSl3ixYsGDBMliwFLyCV/DeLIMFCxYsWLBMwSt4Be/NggXLYMGCBUvBK3iNruC9WbBgwYJlsGApeAWv4L1ZBgsWLFiwYJmCV/AK3psFC5bBggULloJX8BpdwXuzYMGCBctgwVLwCl7Be7MMFixYsGDBsu8FH1FaSmExVfAxBa/gvVmwYMGCZbBg/W4vAQYA5tRF9QYlv/QAAAAASUVORK5CYII=",CLEAR_BACKGROUND_COLOR:"#09090b",NODE_TITLE_COLOR:"#d4d4d8",NODE_SELECTED_TITLE_COLOR:"#ffffff",NODE_TEXT_SIZE:14,NODE_TEXT_COLOR:"#ffffff",NODE_SUBTEXT_SIZE:12,NODE_DEFAULT_COLOR:"#09090b",NODE_DEFAULT_BGCOLOR:"rgba(24,24,27,.9)",NODE_DEFAULT_BOXCOLOR:"rgba(255,255,255,.75)",NODE_DEFAULT_SHAPE:"box",NODE_BOX_OUTLINE_COLOR:N,DEFAULT_SHADOW_COLOR:"rgba(0,0,0,0)",DEFAULT_GROUP_FONT:24,WIDGET_BGCOLOR:"#242427",WIDGET_OUTLINE_COLOR:"#3f3f46",WIDGET_TEXT_COLOR:"#d4d4d8",WIDGET_SECONDARY_TEXT_COLOR:"#d4d4d8",LINK_COLOR:"#9A9",EVENT_LINK_COLOR:"#A86",CONNECTING_LINK_COLOR:"#AFA"},comfy_base:{"fg-color":"#fff","bg-color":"#09090b","comfy-menu-bg":"rgba(24,24,24,.9)","comfy-input-bg":"#262626","input-text":"#ddd","descrip-text":"#999","drag-text":"#ccc","error-text":"#ff4444","border-color":"#29292c","tr-even-bg-color":"rgba(28,28,28,.9)","tr-odd-bg-color":"rgba(19,19,19,.9)"}}},NODE_COLORS:{red:{color:"#af3535",bgcolor:R,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:R,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:R,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:R,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:R,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:R,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:R,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:R,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:R,groupcolor:"#444"}}};let G=JSON.parse(JSON.stringify($));delete G.NODE_COLORS,G.ColorPalette.id="obsidian_dark",G.ColorPalette.name="Obsidian Dark",G.ColorPalette.colors.litegraph_base.BACKGROUND_IMAGE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGlmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDEgNzkuMTQ2Mjg5OSwgMjAyMy8wNi8yNS0yMDowMTo1NSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAyMy0xMS0xM1QwMDoxODowMiswMTowMCIgeG1wOk1vZGlmeURhdGU9IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIHhtcDpNZXRhZGF0YURhdGU9IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmIyYzRhNjA5LWJmYTctYTg0MC1iOGFlLTk3MzE2ZjM1ZGIyNyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjk0ZmNlZGU4LTE1MTctZmQ0MC04ZGU3LWYzOTgxM2E3ODk5ZiIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjIzMWIxMGIwLWI0ZmItMDI0ZS1iMTJlLTMwNTMwM2NkMDdjOCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6MjMxYjEwYjAtYjRmYi0wMjRlLWIxMmUtMzA1MzAzY2QwN2M4IiBzdEV2dDp3aGVuPSIyMDIzLTExLTEzVDAwOjE4OjAyKzAxOjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjUuMSAoV2luZG93cykiLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjQ4OWY1NzlmLTJkNjUtZWQ0Zi04OTg0LTA4NGE2MGE1ZTMzNSIgc3RFdnQ6d2hlbj0iMjAyMy0xMS0xNVQwMjowNDo1OSswMTowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDI1LjEgKFdpbmRvd3MpIiBzdEV2dDpjaGFuZ2VkPSIvIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpiMmM0YTYwOS1iZmE3LWE4NDAtYjhhZS05NzMxNmYzNWRiMjciIHN0RXZ0OndoZW49IjIwMjMtMTEtMTVUMDI6MDQ6NTkrMDE6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCAyNS4xIChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4OTe6GAAAAx0lEQVR42u3WMQoAIQxFwRzJys77X8vSLiRgITif7bYbgrwYc/mKXyBoY4VVBgsWLFiwYFmOlTv+9jfDOjHmr8u6eVkGCxYsWLBgmc5S8ApewXvgYRksWLBgKXidpeBdloL3wMOCBctgwVLwCl7BuyyDBQsWLFiwTGcpeAWv4D3wsAwWLFiwFLzOUvAuS8F74GHBgmWwYCl4Ba/gXZbBggULFixYprMUvIJX8B54WAYLFixYCl5nKXiXpeA98LBgwTJYsGC9tg1o8f4TTtqzNQAAAABJRU5ErkJggg==",G.ColorPalette.colors.litegraph_base.CLEAR_BACKGROUND_COLOR="#000";const B=LGraphCanvas.node_colors.bgcolor,F={ColorPalette:{id:"milk_white",name:"Milk White",colors:{node_slot:{CLIP:"#FFA726",CLIP_VISION:"#5C6BC0",CLIP_VISION_OUTPUT:"#8D6E63",CONDITIONING:"#EF5350",CONTROL_NET:"#66BB6A",IMAGE:"#42A5F5",LATENT:"#AB47BC",MASK:"#9CCC65",MODEL:"#7E57C2",STYLE_MODEL:"#D4E157",VAE:"#FF7043",PIPE_LINE:"#7737AA",PIPE_LINE_SDXL:"#7737AA",INT:"#29699C",X_Y:"#38291f",XYPLOT:"#74DA5D",LORA_STACK:"#94dccd",CONTROL_NET_STACK:"#94dccd"},litegraph_base:{BACKGROUND_IMAGE:"data:image/gif;base64,R0lGODlhZABkALMAAAAAAP///+vr6+rq6ujo6Ofn5+bm5uXl5d3d3f///wAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAkALAAAAABkAGQAAAT/UMhJq7046827HkcoHkYxjgZhnGG6si5LqnIM0/fL4qwwIMAg0CAsEovBIxKhRDaNy2GUOX0KfVFrssrNdpdaqTeKBX+dZ+jYvEaTf+y4W66mC8PUdrE879f9d2mBeoNLfH+IhYBbhIx2jkiHiomQlGKPl4uZe3CaeZifnnijgkESBqipqqusra6vsLGys62SlZO4t7qbuby7CLa+wqGWxL3Gv3jByMOkjc2lw8vOoNSi0czAncXW3Njdx9Pf48/Z4Kbbx+fQ5evZ4u3k1fKR6cn03vHlp7T9/v8A/8Gbp4+gwXoFryXMB2qgwoMMHyKEqA5fxX322FG8tzBcRnMW/zlulPbRncmQGidKjMjyYsOSKEF2FBlJQMCbOHP6c9iSZs+UnGYCdbnSo1CZI5F64kn0p1KnTH02nSoV3dGTV7FFHVqVq1dtWcMmVQZTbNGu72zqXMuW7danVL+6e4t1bEy6MeueBYLXrNO5Ze36jQtWsOG97wIj1vt3St/DjTEORss4nNq2mDP3e7w4r1bFkSET5hy6s2TRlD2/mSxXtSHQhCunXo26NevCpmvD/UU6tuullzULH76q92zdZG/Ltv1a+W+osI/nRmyc+fRi1Xdbh+68+0vv10dH3+77KD/i6IdnX669/frn5Zsjh4/2PXju8+8bzc9/6fj27LFnX11/+IUnXWl7BJfegm79FyB9JOl3oHgSklefgxAC+FmFGpqHIYcCfkhgfCohSKKJVo044YUMttggiBkmp6KFXw1oII24oYhjiDByaKOOHcp3Y5BD/njikSkO+eBREQAAOw==",CLEAR_BACKGROUND_COLOR:"lightgray",NODE_TITLE_COLOR:"#222",NODE_SELECTED_TITLE_COLOR:"#000",NODE_TEXT_SIZE:14,NODE_TEXT_COLOR:"#444",NODE_SUBTEXT_SIZE:12,NODE_DEFAULT_COLOR:"#F7F7F7",NODE_DEFAULT_BGCOLOR:"#F5F5F5",NODE_DEFAULT_BOXCOLOR:"#555",NODE_DEFAULT_SHAPE:"box",NODE_BOX_OUTLINE_COLOR:"#000",DEFAULT_SHADOW_COLOR:"rgba(0,0,0,0.1)",DEFAULT_GROUP_FONT:24,WIDGET_BGCOLOR:"#D4D4D4",WIDGET_OUTLINE_COLOR:"#999",WIDGET_TEXT_COLOR:"#222",WIDGET_SECONDARY_TEXT_COLOR:"#555",LINK_COLOR:"#9A9",EVENT_LINK_COLOR:"#FF9800",CONNECTING_LINK_COLOR:"#222"},comfy_base:{"fg-color":"#222","bg-color":"#DDD","comfy-menu-bg":"#F5F5F5","comfy-input-bg":"#C9C9C9","input-text":"#222","descrip-text":"#444","drag-text":"#555","error-text":"#F44336","border-color":"#bbb","tr-even-bg-color":"#f9f9f9","tr-odd-bg-color":"#fff","content-bg":"#e0e0e0","content-fg":"#222","content-hover-bg":"#adadad","content-hover-fg":"#222"}}},NODE_COLORS:{red:{color:"#af3535",bgcolor:B,groupcolor:"#A88"},brown:{color:"#38291f",bgcolor:B,groupcolor:"#b06634"},green:{color:"#346434",bgcolor:B,groupcolor:"#8A8"},blue:{color:"#1f1f48",bgcolor:B,groupcolor:"#88A"},pale_blue:{color:"#006691",bgcolor:B,groupcolor:"#3f789e"},cyan:{color:"#008181",bgcolor:B,groupcolor:"#8AA"},purple:{color:"#422342",bgcolor:B,groupcolor:"#a1309b"},yellow:{color:"#c09430",bgcolor:B,groupcolor:"#b58b2a"},black:{color:"rgba(0,0,0,.8)",bgcolor:B,groupcolor:"#444"}}},U={"Workflow created by":"工作流创建者","Watch more video content":"观看更多视频内容","Workflow Guide":"工作流指南","💎 View Checkpoint Info...":"💎 查看 Checkpoint 信息...","💎 View Lora Info...":"💎 查看 Lora 信息...","🔃 Reload Node":"🔃 刷新节点","Updated At:":"最近更新:","Created At:":"首次发布:","✏️ Edit":"✏️ 编辑","💾 Save":"💾 保存","No notes":"当前还没有备注内容","Saving Notes...":"正在保存备注...","Type your notes here":"在这里输入备注内容",ModelName:"模型名称","Models Required":"所需模型","Download Model":"下载模型","Source Url":"模型源地址",Notes:"备注",Type:"类型","Trained Words":"训练词",BaseModel:"基础算法",Details:"详情",Description:"描述",Download:"下载量",Source:"来源","Saving Preview...":"正在保存预览图...","Saving Succeed":"保存成功","Clean SuccessFully":"清理成功","Clean Failed":"清理失败","Saving Failed":"保存失败","No COMBO link":"沒有找到COMBO连接","Reboot ComfyUI":"重启ComfyUI","Are you sure you'd like to reboot the server?":"是否要重启ComfyUI?","Nodes Map":"管理节点组","No Nodes":"未找到节点","No nodes found in the map":"在工作流程中没有找到节点","Expand All":"展开所有组","Collapse All":"折叠所有组",Queue:"队列","Cleanup Of GPU Usage":"清理GPU占用","Please stop all running tasks before cleaning GPU":"请在清理GPU之前停止所有运行中的任务",Always:"启用中",Bypass:"已忽略",Never:"已停用","Auto Sorting":"自动排序","Toggle `Show/Hide` can set mode of group, LongPress can set group nodes to never":"点击`启用中/已忽略`可设置组模式, 长按可停用该组节点","Enable Shift+Up/Down/Left/Right key to align selected nodes":"启用 `Shift+上/下/左/右` 键对齐选中的节点","Enable Shift+g to add selected nodes to a group":"启用 `Shift+g` 键将选中的节点添加一个组","Enable Up/Down/Left/Right key to jump nearest nodes":"启用 `上/下/左/右` 键跳转到最近的前后节点","Enable ALT+1~9 to paste nodes from nodes template":"启用 `ALT+1~9` 从节点模板粘贴到工作流中","Enable contextMenu auto nest subdirectories":"启用上下文菜单自动嵌套子目录","Enable right-click menu to add node A~Z sorting":"启用右键菜单中新建节点A~Z排序","Enable model thumbnails display":"启动模型预览图显示","Enable nodes runtime display":"启动节点运行时间显示","Enable chain get node and set node with parent nodes":"启用将获取点和设置点与父节点链在一起","Too many thumbnails, have closed the display":"模型缩略图太多啦,为您关闭了显示","Get styles list Failed":"获取样式列表失败","Get style image Failed":"获取样式图片失败","Empty All":"清空所有","Type here to search styles ...":"在此处输入以搜索样式 ...","Loading UserInfo...":"正在获取用户信息...","Please set the APIKEY first":"请先设置APIKEY","Setting APIKEY":"设置APIKEY","Save Account Info":"保存账号信息",Choose:"选择",Delete:"删除",Edit:"编辑","At least one account is required":"删除失败: 至少需要一个账户","APIKEY is not Empty":"APIKEY 不能为空","Add Account":"添加账号","Getting Your APIKEY":"获取您的APIKEY","Choose Selected Images":"选择选中的图片","Choose images to continue":"选择图片以继续",Background:"背景",Hat:"帽子",Hair:"头发",Body:"身体",Face:"脸部",Clothes:"衣服",Others:"其他",Glove:"手套",Sunglasses:"太阳镜","Upper-clothes":"上衣",Dress:"连衣裙",Coat:"外套",Socks:"袜子",Pants:"裤子",Jumpsuits:"连体衣",Scarf:"围巾",Skirt:"裙子","Left-arm":"左臂","Right-arm":"右臂","Left-leg":"左腿","Right-leg":"右腿","Left-shoe":"左鞋","Right-shoe":"右鞋",s:"秒","No Node Templates Found":"未找到节点模板预设","Get Node Templates File Failed":"获取节点模板文件失败","Node template with {key} not set":"未设置快捷键为{key}的节点预设","ComfyUI Basic":"ComfyUI 基础节点","Recommend Nodes":"推荐节点","Others A~Z":"其他节点 A~Z"},z=A("AGL.Locale"),V=(e,t=!1)=>"zh-CN"===(t?navigator.language:z)&&U[e]||e,H={addGroup:{id:"EasyUse.Hotkeys.AddGroup",name:V("Enable Shift+g to add selected nodes to a group"),tooltip:V(""),type:"boolean",defaultValue:!0},alignSelectedNodes:{id:"EasyUse.Hotkeys.AlignSelectedNodes",name:V("Enable Shift+Up/Down/Left/Right key to align selected nodes"),tooltip:V(""),type:"boolean",defaultValue:!0},nodesTemplate:{id:"EasyUse.Hotkeys.NodesTemplate",name:V("Enable ALT+1~9 to paste nodes from nodes template"),tooltip:V(""),type:"boolean",defaultValue:!0},jumpNearestNodes:{id:"EasyUse.Hotkeys.JumpNearestNodes",name:V("Enable Up/Down/Left/Right key to jump nearest nodes"),tooltip:V(""),type:"boolean",defaultValue:!0},subDirectories:{id:"EasyUse.ContextMenu.SubDirectories",name:V("Enable contextMenu auto nest subdirectories"),tooltip:V(""),type:"boolean",defaultValue:!0},modelsThumbnails:{id:"EasyUse.ContextMenu.ModelsThumbnails",name:V("Enable model thumbnails display"),tooltip:V(""),type:"boolean",defaultValue:!0},rightMenuNodesSort:{id:"EasyUse.ContextMenu.NodesSort",name:V("Enable right-click menu to add node A~Z sorting"),tooltip:V(""),type:"boolean",defaultValue:!0},nodesRuntime:{id:"EasyUse.Nodes.Runtime",name:V("Enable nodes runtime display"),tooltip:V(""),type:"boolean",defaultValue:!0},chainGetSet:{id:"EasyUse.Nodes.ChainGetSet",name:V("Enable chain get node and set node with parent nodes"),tooltip:V(""),type:"boolean",defaultValue:!0}};function W(e=100,t){return new Promise((n=>{setTimeout((()=>{n(t)}),e)}))} /** * @vue/shared v3.4.36 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ -/*! #__NO_SIDE_EFFECTS__ */function Y(e,t){const n=new Set(e.split(","));return e=>n.has(e)}const Z={},K=[],X=()=>{},Q=()=>!1,J=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),q=e=>e.startsWith("onUpdate:"),ee=Object.assign,te=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ne=Object.prototype.hasOwnProperty,oe=(e,t)=>ne.call(e,t),ie=Array.isArray,re=e=>"[object Map]"===fe(e),se=e=>"[object Set]"===fe(e),ae=e=>"function"==typeof e,le=e=>"string"==typeof e,ce=e=>"symbol"==typeof e,ue=e=>null!==e&&"object"==typeof e,de=e=>(ue(e)||ae(e))&&ae(e.then)&&ae(e.catch),pe=Object.prototype.toString,fe=e=>pe.call(e),he=e=>fe(e).slice(8,-1),me=e=>"[object Object]"===fe(e),ge=e=>le(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,ve=Y(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ye=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},be=/-(\w)/g,_e=ye((e=>e.replace(be,((e,t)=>t?t.toUpperCase():"")))),we=/\B([A-Z])/g,Se=ye((e=>e.replace(we,"-$1").toLowerCase())),xe=ye((e=>e.charAt(0).toUpperCase()+e.slice(1))),ke=ye((e=>e?`on${xe(e)}`:"")),Ce=(e,t)=>!Object.is(e,t),Ae=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},Oe=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Le;const Te=()=>Le||(Le="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function Ie(e){if(ie(e)){const t={};for(let n=0;n{if(e){const n=e.split(Pe);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function Me(e){let t="";if(le(e))t=e;else if(ie(e))for(let n=0;n!(!e||!0!==e.__v_isRef),Be=e=>le(e)?e:null==e?"":ie(e)||ue(e)&&(e.toString===pe||!ae(e.toString))?Ge(e)?Be(e.value):JSON.stringify(e,Fe,2):String(e),Fe=(e,t)=>Ge(t)?Fe(e,t.value):re(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],o)=>(e[Ue(t,o)+" =>"]=n,e)),{})}:se(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>Ue(e)))}:ce(t)?Ue(t):!ue(t)||ie(t)||me(t)?t:String(t),Ue=(e,t="")=>{var n;return ce(e)?`Symbol(${null!=(n=e.description)?n:t})`:e}; +/*! #__NO_SIDE_EFFECTS__ */function Y(e,t){const n=new Set(e.split(","));return e=>n.has(e)}const Z={},K=[],X=()=>{},Q=()=>!1,J=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),q=e=>e.startsWith("onUpdate:"),ee=Object.assign,te=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ne=Object.prototype.hasOwnProperty,oe=(e,t)=>ne.call(e,t),ie=Array.isArray,re=e=>"[object Map]"===fe(e),se=e=>"[object Set]"===fe(e),ae=e=>"function"==typeof e,le=e=>"string"==typeof e,ce=e=>"symbol"==typeof e,ue=e=>null!==e&&"object"==typeof e,de=e=>(ue(e)||ae(e))&&ae(e.then)&&ae(e.catch),pe=Object.prototype.toString,fe=e=>pe.call(e),he=e=>fe(e).slice(8,-1),me=e=>"[object Object]"===fe(e),ge=e=>le(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,ve=Y(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ye=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},be=/-(\w)/g,_e=ye((e=>e.replace(be,((e,t)=>t?t.toUpperCase():"")))),we=/\B([A-Z])/g,Se=ye((e=>e.replace(we,"-$1").toLowerCase())),xe=ye((e=>e.charAt(0).toUpperCase()+e.slice(1))),ke=ye((e=>e?`on${xe(e)}`:"")),Ce=(e,t)=>!Object.is(e,t),Ae=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},Oe=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Le;const Te=()=>Le||(Le="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function Ne(e){if(ie(e)){const t={};for(let n=0;n{if(e){const n=e.split(Pe);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function Me(e){let t="";if(le(e))t=e;else if(ie(e))for(let n=0;n!(!e||!0!==e.__v_isRef),Be=e=>le(e)?e:null==e?"":ie(e)||ue(e)&&(e.toString===pe||!ae(e.toString))?Ge(e)?Be(e.value):JSON.stringify(e,Fe,2):String(e),Fe=(e,t)=>Ge(t)?Fe(e,t.value):re(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],o)=>(e[Ue(t,o)+" =>"]=n,e)),{})}:se(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>Ue(e)))}:ce(t)?Ue(t):!ue(t)||ie(t)||me(t)?t:String(t),Ue=(e,t="")=>{var n;return ce(e)?`Symbol(${null!=(n=e.description)?n:t})`:e}; /** * @vue/reactivity v3.4.36 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ -let ze,Ve;class He{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=ze,!e&&ze&&(this.index=(ze.scopes||(ze.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=ze;try{return ze=this,e()}finally{ze=t}}}on(){ze=this}off(){ze=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),nt()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=Je,t=Ve;try{return Je=!0,Ve=this,this._runnings++,Ke(this),this.fn()}finally{Xe(this),this._runnings--,Ve=t,Je=e}}stop(){this.active&&(Ke(this),Xe(this),this.onStop&&this.onStop(),this.active=!1)}}function Ke(e){e._trackId++,e._depsLength=0}function Xe(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},ct=new WeakMap,ut=Symbol(""),dt=Symbol("");function pt(e,t,n){if(Je&&Ve){let t=ct.get(e);t||ct.set(e,t=new Map);let o=t.get(n);o||t.set(n,o=lt((()=>t.delete(n)))),rt(Ve,o)}}function ft(e,t,n,o,i,r){const s=ct.get(e);if(!s)return;let a=[];if("clear"===t)a=[...s.values()];else if("length"===n&&ie(e)){const e=Number(o);s.forEach(((t,n)=>{("length"===n||!ce(n)&&n>=e)&&a.push(t)}))}else switch(void 0!==n&&a.push(s.get(n)),t){case"add":ie(e)?ge(n)&&a.push(s.get("length")):(a.push(s.get(ut)),re(e)&&a.push(s.get(dt)));break;case"delete":ie(e)||(a.push(s.get(ut)),re(e)&&a.push(s.get(dt)));break;case"set":re(e)&&a.push(s.get(ut))}ot();for(const l of a)l&&at(l,4);it()}const ht=Y("__proto__,__v_isRef,__isVue"),mt=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(ce)),gt=vt();function vt(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=on(this);for(let t=0,i=this.length;t{e[t]=function(...e){tt(),ot();const n=on(this)[t].apply(this,e);return it(),nt(),n}})),e}function yt(e){ce(e)||(e=String(e));const t=on(this);return pt(t,0,e),t.hasOwnProperty(e)}class bt{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const o=this._isReadonly,i=this._isShallow;if("__v_isReactive"===t)return!o;if("__v_isReadonly"===t)return o;if("__v_isShallow"===t)return i;if("__v_raw"===t)return n===(o?i?Kt:Zt:i?Yt:Wt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const r=ie(e);if(!o){if(r&&oe(gt,t))return Reflect.get(gt,t,n);if("hasOwnProperty"===t)return yt}const s=Reflect.get(e,t,n);return(ce(t)?mt.has(t):ht(t))?s:(o||pt(e,0,t),i?s:dn(s)?r&&ge(t)?s:s.value:ue(s)?o?Qt(s):Xt(s):s)}}class _t extends bt{constructor(e=!1){super(!1,e)}set(e,t,n,o){let i=e[t];if(!this._isShallow){const t=en(i);if(tn(n)||en(n)||(i=on(i),n=on(n)),!ie(e)&&dn(i)&&!dn(n))return!t&&(i.value=n,!0)}const r=ie(e)&&ge(t)?Number(t)e,At=e=>Reflect.getPrototypeOf(e);function Et(e,t,n=!1,o=!1){const i=on(e=e.__v_raw),r=on(t);n||(Ce(t,r)&&pt(i,0,t),pt(i,0,r));const{has:s}=At(i),a=o?Ct:n?an:sn;return s.call(i,t)?a(e.get(t)):s.call(i,r)?a(e.get(r)):void(e!==i&&e.get(t))}function Ot(e,t=!1){const n=this.__v_raw,o=on(n),i=on(e);return t||(Ce(e,i)&&pt(o,0,e),pt(o,0,i)),e===i?n.has(e):n.has(e)||n.has(i)}function Lt(e,t=!1){return e=e.__v_raw,!t&&pt(on(e),0,ut),Reflect.get(e,"size",e)}function Tt(e,t=!1){t||tn(e)||en(e)||(e=on(e));const n=on(this);return At(n).has.call(n,e)||(n.add(e),ft(n,"add",e,e)),this}function It(e,t,n=!1){n||tn(t)||en(t)||(t=on(t));const o=on(this),{has:i,get:r}=At(o);let s=i.call(o,e);s||(e=on(e),s=i.call(o,e));const a=r.call(o,e);return o.set(e,t),s?Ce(t,a)&&ft(o,"set",e,t):ft(o,"add",e,t),this}function Nt(e){const t=on(this),{has:n,get:o}=At(t);let i=n.call(t,e);i||(e=on(e),i=n.call(t,e)),o&&o.call(t,e);const r=t.delete(e);return i&&ft(t,"delete",e,void 0),r}function Pt(){const e=on(this),t=0!==e.size,n=e.clear();return t&&ft(e,"clear",void 0,void 0),n}function Dt(e,t){return function(n,o){const i=this,r=i.__v_raw,s=on(r),a=t?Ct:e?an:sn;return!e&&pt(s,0,ut),r.forEach(((e,t)=>n.call(o,a(e),a(t),i)))}}function jt(e,t,n){return function(...o){const i=this.__v_raw,r=on(i),s=re(r),a="entries"===e||e===Symbol.iterator&&s,l="keys"===e&&s,c=i[e](...o),u=n?Ct:t?an:sn;return!t&&pt(r,0,l?dt:ut),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function Mt(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Rt(){const e={get(e){return Et(this,e)},get size(){return Lt(this)},has:Ot,add:Tt,set:It,delete:Nt,clear:Pt,forEach:Dt(!1,!1)},t={get(e){return Et(this,e,!1,!0)},get size(){return Lt(this)},has:Ot,add(e){return Tt.call(this,e,!0)},set(e,t){return It.call(this,e,t,!0)},delete:Nt,clear:Pt,forEach:Dt(!1,!0)},n={get(e){return Et(this,e,!0)},get size(){return Lt(this,!0)},has(e){return Ot.call(this,e,!0)},add:Mt("add"),set:Mt("set"),delete:Mt("delete"),clear:Mt("clear"),forEach:Dt(!0,!1)},o={get(e){return Et(this,e,!0,!0)},get size(){return Lt(this,!0)},has(e){return Ot.call(this,e,!0)},add:Mt("add"),set:Mt("set"),delete:Mt("delete"),clear:Mt("clear"),forEach:Dt(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{e[i]=jt(i,!1,!1),n[i]=jt(i,!0,!1),t[i]=jt(i,!1,!0),o[i]=jt(i,!0,!0)})),[e,n,t,o]}const[$t,Gt,Bt,Ft]=Rt();function Ut(e,t){const n=t?e?Ft:Bt:e?Gt:$t;return(t,o,i)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(oe(n,o)&&o in t?n:t,o,i)}const zt={get:Ut(!1,!1)},Vt={get:Ut(!1,!0)},Ht={get:Ut(!0,!1)},Wt=new WeakMap,Yt=new WeakMap,Zt=new WeakMap,Kt=new WeakMap;function Xt(e){return en(e)?e:Jt(e,!1,St,zt,Wt)}function Qt(e){return Jt(e,!0,xt,Ht,Zt)}function Jt(e,t,n,o,i){if(!ue(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const r=i.get(e);if(r)return r;const s=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(he(a));var a;if(0===s)return e;const l=new Proxy(e,2===s?o:n);return i.set(e,l),l}function qt(e){return en(e)?qt(e.__v_raw):!(!e||!e.__v_isReactive)}function en(e){return!(!e||!e.__v_isReadonly)}function tn(e){return!(!e||!e.__v_isShallow)}function nn(e){return!!e&&!!e.__v_raw}function on(e){const t=e&&e.__v_raw;return t?on(t):e}function rn(e){return Object.isExtensible(e)&&Ee(e,"__v_skip",!0),e}const sn=e=>ue(e)?Xt(e):e,an=e=>ue(e)?Qt(e):e;class ln{constructor(e,t,n,o){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Ze((()=>e(this._value)),(()=>un(this,2===this.effect._dirtyLevel?2:3))),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=on(this);return e._cacheable&&!e.effect.dirty||!Ce(e._value,e._value=e.effect.run())||un(e,4),cn(e),e.effect._dirtyLevel>=2&&un(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function cn(e){var t;Je&&Ve&&(e=on(e),rt(Ve,null!=(t=e.dep)?t:e.dep=lt((()=>e.dep=void 0),e instanceof ln?e:void 0)))}function un(e,t=4,n,o){const i=(e=on(e)).dep;i&&at(i,t)}function dn(e){return!(!e||!0!==e.__v_isRef)}function pn(e){return function(e,t){if(dn(e))return e;return new fn(e,t)}(e,!1)}class fn{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:on(e),this._value=t?e:sn(e)}get value(){return cn(this),this._value}set value(e){const t=this.__v_isShallow||tn(e)||en(e);e=t?e:on(e),Ce(e,this._rawValue)&&(this._rawValue,this._rawValue=e,this._value=t?e:sn(e),un(this,4))}}function hn(e){return dn(e)?e.value:e}const mn={get:(e,t,n)=>hn(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const i=e[t];return dn(i)&&!dn(n)?(i.value=n,!0):Reflect.set(e,t,n,o)}};function gn(e){return qt(e)?e:new Proxy(e,mn)}class vn{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){const n=ct.get(e);return n&&n.get(t)}(on(this._object),this._key)}}class yn{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function bn(e,t,n){return dn(e)?e:ae(e)?new yn(e):ue(e)&&arguments.length>1?_n(e,t,n):pn(e)}function _n(e,t,n){const o=e[t];return dn(o)?o:new vn(e,t,n)} +let ze,Ve;class He{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=ze,!e&&ze&&(this.index=(ze.scopes||(ze.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=ze;try{return ze=this,e()}finally{ze=t}}}on(){ze=this}off(){ze=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),nt()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=Je,t=Ve;try{return Je=!0,Ve=this,this._runnings++,Ke(this),this.fn()}finally{Xe(this),this._runnings--,Ve=t,Je=e}}stop(){this.active&&(Ke(this),Xe(this),this.onStop&&this.onStop(),this.active=!1)}}function Ke(e){e._trackId++,e._depsLength=0}function Xe(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},ct=new WeakMap,ut=Symbol(""),dt=Symbol("");function pt(e,t,n){if(Je&&Ve){let t=ct.get(e);t||ct.set(e,t=new Map);let o=t.get(n);o||t.set(n,o=lt((()=>t.delete(n)))),rt(Ve,o)}}function ft(e,t,n,o,i,r){const s=ct.get(e);if(!s)return;let a=[];if("clear"===t)a=[...s.values()];else if("length"===n&&ie(e)){const e=Number(o);s.forEach(((t,n)=>{("length"===n||!ce(n)&&n>=e)&&a.push(t)}))}else switch(void 0!==n&&a.push(s.get(n)),t){case"add":ie(e)?ge(n)&&a.push(s.get("length")):(a.push(s.get(ut)),re(e)&&a.push(s.get(dt)));break;case"delete":ie(e)||(a.push(s.get(ut)),re(e)&&a.push(s.get(dt)));break;case"set":re(e)&&a.push(s.get(ut))}ot();for(const l of a)l&&at(l,4);it()}const ht=Y("__proto__,__v_isRef,__isVue"),mt=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(ce)),gt=vt();function vt(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=on(this);for(let t=0,i=this.length;t{e[t]=function(...e){tt(),ot();const n=on(this)[t].apply(this,e);return it(),nt(),n}})),e}function yt(e){ce(e)||(e=String(e));const t=on(this);return pt(t,0,e),t.hasOwnProperty(e)}class bt{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const o=this._isReadonly,i=this._isShallow;if("__v_isReactive"===t)return!o;if("__v_isReadonly"===t)return o;if("__v_isShallow"===t)return i;if("__v_raw"===t)return n===(o?i?Kt:Zt:i?Yt:Wt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const r=ie(e);if(!o){if(r&&oe(gt,t))return Reflect.get(gt,t,n);if("hasOwnProperty"===t)return yt}const s=Reflect.get(e,t,n);return(ce(t)?mt.has(t):ht(t))?s:(o||pt(e,0,t),i?s:dn(s)?r&&ge(t)?s:s.value:ue(s)?o?Qt(s):Xt(s):s)}}class _t extends bt{constructor(e=!1){super(!1,e)}set(e,t,n,o){let i=e[t];if(!this._isShallow){const t=en(i);if(tn(n)||en(n)||(i=on(i),n=on(n)),!ie(e)&&dn(i)&&!dn(n))return!t&&(i.value=n,!0)}const r=ie(e)&&ge(t)?Number(t)e,At=e=>Reflect.getPrototypeOf(e);function Et(e,t,n=!1,o=!1){const i=on(e=e.__v_raw),r=on(t);n||(Ce(t,r)&&pt(i,0,t),pt(i,0,r));const{has:s}=At(i),a=o?Ct:n?an:sn;return s.call(i,t)?a(e.get(t)):s.call(i,r)?a(e.get(r)):void(e!==i&&e.get(t))}function Ot(e,t=!1){const n=this.__v_raw,o=on(n),i=on(e);return t||(Ce(e,i)&&pt(o,0,e),pt(o,0,i)),e===i?n.has(e):n.has(e)||n.has(i)}function Lt(e,t=!1){return e=e.__v_raw,!t&&pt(on(e),0,ut),Reflect.get(e,"size",e)}function Tt(e,t=!1){t||tn(e)||en(e)||(e=on(e));const n=on(this);return At(n).has.call(n,e)||(n.add(e),ft(n,"add",e,e)),this}function Nt(e,t,n=!1){n||tn(t)||en(t)||(t=on(t));const o=on(this),{has:i,get:r}=At(o);let s=i.call(o,e);s||(e=on(e),s=i.call(o,e));const a=r.call(o,e);return o.set(e,t),s?Ce(t,a)&&ft(o,"set",e,t):ft(o,"add",e,t),this}function It(e){const t=on(this),{has:n,get:o}=At(t);let i=n.call(t,e);i||(e=on(e),i=n.call(t,e)),o&&o.call(t,e);const r=t.delete(e);return i&&ft(t,"delete",e,void 0),r}function Pt(){const e=on(this),t=0!==e.size,n=e.clear();return t&&ft(e,"clear",void 0,void 0),n}function Dt(e,t){return function(n,o){const i=this,r=i.__v_raw,s=on(r),a=t?Ct:e?an:sn;return!e&&pt(s,0,ut),r.forEach(((e,t)=>n.call(o,a(e),a(t),i)))}}function jt(e,t,n){return function(...o){const i=this.__v_raw,r=on(i),s=re(r),a="entries"===e||e===Symbol.iterator&&s,l="keys"===e&&s,c=i[e](...o),u=n?Ct:t?an:sn;return!t&&pt(r,0,l?dt:ut),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function Mt(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Rt(){const e={get(e){return Et(this,e)},get size(){return Lt(this)},has:Ot,add:Tt,set:Nt,delete:It,clear:Pt,forEach:Dt(!1,!1)},t={get(e){return Et(this,e,!1,!0)},get size(){return Lt(this)},has:Ot,add(e){return Tt.call(this,e,!0)},set(e,t){return Nt.call(this,e,t,!0)},delete:It,clear:Pt,forEach:Dt(!1,!0)},n={get(e){return Et(this,e,!0)},get size(){return Lt(this,!0)},has(e){return Ot.call(this,e,!0)},add:Mt("add"),set:Mt("set"),delete:Mt("delete"),clear:Mt("clear"),forEach:Dt(!0,!1)},o={get(e){return Et(this,e,!0,!0)},get size(){return Lt(this,!0)},has(e){return Ot.call(this,e,!0)},add:Mt("add"),set:Mt("set"),delete:Mt("delete"),clear:Mt("clear"),forEach:Dt(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{e[i]=jt(i,!1,!1),n[i]=jt(i,!0,!1),t[i]=jt(i,!1,!0),o[i]=jt(i,!0,!0)})),[e,n,t,o]}const[$t,Gt,Bt,Ft]=Rt();function Ut(e,t){const n=t?e?Ft:Bt:e?Gt:$t;return(t,o,i)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(oe(n,o)&&o in t?n:t,o,i)}const zt={get:Ut(!1,!1)},Vt={get:Ut(!1,!0)},Ht={get:Ut(!0,!1)},Wt=new WeakMap,Yt=new WeakMap,Zt=new WeakMap,Kt=new WeakMap;function Xt(e){return en(e)?e:Jt(e,!1,St,zt,Wt)}function Qt(e){return Jt(e,!0,xt,Ht,Zt)}function Jt(e,t,n,o,i){if(!ue(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const r=i.get(e);if(r)return r;const s=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(he(a));var a;if(0===s)return e;const l=new Proxy(e,2===s?o:n);return i.set(e,l),l}function qt(e){return en(e)?qt(e.__v_raw):!(!e||!e.__v_isReactive)}function en(e){return!(!e||!e.__v_isReadonly)}function tn(e){return!(!e||!e.__v_isShallow)}function nn(e){return!!e&&!!e.__v_raw}function on(e){const t=e&&e.__v_raw;return t?on(t):e}function rn(e){return Object.isExtensible(e)&&Ee(e,"__v_skip",!0),e}const sn=e=>ue(e)?Xt(e):e,an=e=>ue(e)?Qt(e):e;class ln{constructor(e,t,n,o){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Ze((()=>e(this._value)),(()=>un(this,2===this.effect._dirtyLevel?2:3))),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=on(this);return e._cacheable&&!e.effect.dirty||!Ce(e._value,e._value=e.effect.run())||un(e,4),cn(e),e.effect._dirtyLevel>=2&&un(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function cn(e){var t;Je&&Ve&&(e=on(e),rt(Ve,null!=(t=e.dep)?t:e.dep=lt((()=>e.dep=void 0),e instanceof ln?e:void 0)))}function un(e,t=4,n,o){const i=(e=on(e)).dep;i&&at(i,t)}function dn(e){return!(!e||!0!==e.__v_isRef)}function pn(e){return function(e,t){if(dn(e))return e;return new fn(e,t)}(e,!1)}class fn{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:on(e),this._value=t?e:sn(e)}get value(){return cn(this),this._value}set value(e){const t=this.__v_isShallow||tn(e)||en(e);e=t?e:on(e),Ce(e,this._rawValue)&&(this._rawValue,this._rawValue=e,this._value=t?e:sn(e),un(this,4))}}function hn(e){return dn(e)?e.value:e}const mn={get:(e,t,n)=>hn(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const i=e[t];return dn(i)&&!dn(n)?(i.value=n,!0):Reflect.set(e,t,n,o)}};function gn(e){return qt(e)?e:new Proxy(e,mn)}class vn{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){const n=ct.get(e);return n&&n.get(t)}(on(this._object),this._key)}}class yn{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function bn(e,t,n){return dn(e)?e:ae(e)?new yn(e):ue(e)&&arguments.length>1?_n(e,t,n):pn(e)}function _n(e,t,n){const o=e[t];return dn(o)?o:new vn(e,t,n)} /** * @vue/runtime-core v3.4.36 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function wn(e,t,n,o){try{return o?e(...o):e()}catch(i){xn(i,t,n)}}function Sn(e,t,n,o){if(ae(e)){const i=wn(e,t,n,o);return i&&de(i)&&i.catch((e=>{xn(e,t,n)})),i}if(ie(e)){const i=[];for(let r=0;r>>1,i=An[o],r=$n(i);r$n(e)-$n(t)));if(On.length=0,Ln)return void Ln.push(...e);for(Ln=e,Tn=0;Tnnull==e.id?1/0:e.id,Gn=(e,t)=>{const n=$n(e)-$n(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Bn(e){Cn=!1,kn=!0,An.sort(Gn);try{for(En=0;En{o._d&&Bi(-1);const i=zn(t);let r;try{r=e(...n)}finally{zn(i),o._d&&Bi(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function Hn(e,t){if(null===Fn)return e;const n=yr(Fn),o=e.dirs||(e.dirs=[]);for(let i=0;i!!e.type.__asyncLoader,Kn=e=>e.type.__isKeepAlive;function Xn(e,t){Jn(e,"a",t)}function Qn(e,t){Jn(e,"da",t)}function Jn(e,t,n=sr){const o=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(eo(t,o,n),n){let e=n.parent;for(;e&&e.parent;)Kn(e.parent.vnode)&&qn(o,t,n,e),e=e.parent}}function qn(e,t,n,o){const i=eo(t,e,o,!0);ao((()=>{te(o[t],i)}),n)}function eo(e,t,n=sr,o=!1){if(n){const i=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...o)=>{tt();const i=ur(n),r=Sn(t,n,e,o);return i(),nt(),r});return o?i.unshift(r):i.push(r),r}}const to=e=>(t,n=sr)=>{hr&&"sp"!==e||eo(e,((...e)=>t(...e)),n)},no=to("bm"),oo=to("m"),io=to("bu"),ro=to("u"),so=to("bum"),ao=to("um"),lo=to("sp"),co=to("rtg"),uo=to("rtc");function po(e,t=sr){eo("ec",e,t)}const fo="components",ho="directives";function mo(e,t){return vo(fo,e,!0,t)||e}const go=Symbol.for("v-ndc");function vo(e,t,n=!0,o=!1){const i=Fn||sr;if(i){const n=i.type;if(e===fo){const e=br(n,!1);if(e&&(e===t||e===_e(t)||e===xe(_e(t))))return n}const r=yo(i[e]||n[e],t)||yo(i.appContext[e],t);return!r&&o?n:r}}function yo(e,t){return e&&(e[t]||e[_e(t)]||e[xe(_e(t))])}function bo(e,t,n,o){let i;const r=n;if(ie(e)||le(e)){i=new Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,r)));else{const n=Object.keys(e);i=new Array(n.length);for(let o=0,s=n.length;o!Vi(e)||e.type!==Di&&!(e.type===Ni&&!wo(e.children))))?e:null}const So=e=>e?pr(e)?yr(e):So(e.parent):null,xo=ee(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>So(e.parent),$root:e=>So(e.root),$emit:e=>e.emit,$options:e=>Io(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Dn(e.update)}),$nextTick:e=>e.n||(e.n=Pn.bind(e.proxy)),$watch:e=>wi.bind(e)}),ko=(e,t)=>e!==Z&&!e.__isScriptSetup&&oe(e,t),Co={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:o,data:i,props:r,accessCache:s,type:a,appContext:l}=e;let c;if("$"!==t[0]){const a=s[t];if(void 0!==a)switch(a){case 1:return o[t];case 2:return i[t];case 4:return n[t];case 3:return r[t]}else{if(ko(o,t))return s[t]=1,o[t];if(i!==Z&&oe(i,t))return s[t]=2,i[t];if((c=e.propsOptions[0])&&oe(c,t))return s[t]=3,r[t];if(n!==Z&&oe(n,t))return s[t]=4,n[t];Eo&&(s[t]=0)}}const u=xo[t];let d,p;return u?("$attrs"===t&&pt(e.attrs,0,""),u(e)):(d=a.__cssModules)&&(d=d[t])?d:n!==Z&&oe(n,t)?(s[t]=4,n[t]):(p=l.config.globalProperties,oe(p,t)?p[t]:void 0)},set({_:e},t,n){const{data:o,setupState:i,ctx:r}=e;return ko(i,t)?(i[t]=n,!0):o!==Z&&oe(o,t)?(o[t]=n,!0):!oe(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(r[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:i,propsOptions:r}},s){let a;return!!n[s]||e!==Z&&oe(e,s)||ko(t,s)||(a=r[0])&&oe(a,s)||oe(o,s)||oe(xo,s)||oe(i.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:oe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ao(e){return ie(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}let Eo=!0;function Oo(e){const t=Io(e),n=e.proxy,o=e.ctx;Eo=!1,t.beforeCreate&&Lo(t.beforeCreate,e,"bc");const{data:i,computed:r,methods:s,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:p,beforeUpdate:f,updated:h,activated:m,deactivated:g,beforeDestroy:v,beforeUnmount:y,destroyed:b,unmounted:_,render:w,renderTracked:S,renderTriggered:x,errorCaptured:k,serverPrefetch:C,expose:A,inheritAttrs:E,components:O,directives:L,filters:T}=t;if(c&&function(e,t){ie(e)&&(e=jo(e));for(const n in e){const o=e[n];let i;i=ue(o)?"default"in o?zo(o.from||n,o.default,!0):zo(o.from||n):zo(o),dn(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}(c,o,null),s)for(const N in s){const e=s[N];ae(e)&&(o[N]=e.bind(n))}if(i){const t=i.call(n,n);ue(t)&&(e.data=Xt(t))}if(Eo=!0,r)for(const N in r){const e=r[N],t=ae(e)?e.bind(n,n):ae(e.get)?e.get.bind(n,n):X,i=!ae(e)&&ae(e.set)?e.set.bind(n):X,s=_r({get:t,set:i});Object.defineProperty(o,N,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(a)for(const N in a)To(a[N],o,n,N);if(l){const e=ae(l)?l.call(n):l;Reflect.ownKeys(e).forEach((t=>{!function(e,t){if(sr){let n=sr.provides;const o=sr.parent&&sr.parent.provides;o===n&&(n=sr.provides=Object.create(o)),n[e]=t}else;}(t,e[t])}))}function I(e,t){ie(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(u&&Lo(u,e,"c"),I(no,d),I(oo,p),I(io,f),I(ro,h),I(Xn,m),I(Qn,g),I(po,k),I(uo,S),I(co,x),I(so,y),I(ao,_),I(lo,C),ie(A))if(A.length){const t=e.exposed||(e.exposed={});A.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});w&&e.render===X&&(e.render=w),null!=E&&(e.inheritAttrs=E),O&&(e.components=O),L&&(e.directives=L)}function Lo(e,t,n){Sn(ie(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function To(e,t,n,o){const i=o.includes(".")?Si(n,o):()=>n[o];if(le(e)){const n=t[e];ae(n)&&bi(i,n)}else if(ae(e))bi(i,e.bind(n));else if(ue(e))if(ie(e))e.forEach((e=>To(e,t,n,o)));else{const o=ae(e.handler)?e.handler.bind(n):t[e.handler];ae(o)&&bi(i,o,e)}}function Io(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:i,optionsCache:r,config:{optionMergeStrategies:s}}=e.appContext,a=r.get(t);let l;return a?l=a:i.length||n||o?(l={},i.length&&i.forEach((e=>No(l,e,s,!0))),No(l,t,s)):l=t,ue(t)&&r.set(t,l),l}function No(e,t,n,o=!1){const{mixins:i,extends:r}=t;r&&No(e,r,n,!0),i&&i.forEach((t=>No(e,t,n,!0)));for(const s in t)if(o&&"expose"===s);else{const o=Po[s]||n&&n[s];e[s]=o?o(e[s],t[s]):t[s]}return e}const Po={data:Do,props:$o,emits:$o,methods:Ro,computed:Ro,beforeCreate:Mo,created:Mo,beforeMount:Mo,mounted:Mo,beforeUpdate:Mo,updated:Mo,beforeDestroy:Mo,beforeUnmount:Mo,destroyed:Mo,unmounted:Mo,activated:Mo,deactivated:Mo,errorCaptured:Mo,serverPrefetch:Mo,components:Ro,directives:Ro,watch:function(e,t){if(!e)return t;if(!t)return e;const n=ee(Object.create(null),e);for(const o in t)n[o]=Mo(e[o],t[o]);return n},provide:Do,inject:function(e,t){return Ro(jo(e),jo(t))}};function Do(e,t){return t?e?function(){return ee(ae(e)?e.call(this,this):e,ae(t)?t.call(this,this):t)}:t:e}function jo(e){if(ie(e)){const t={};for(let n=0;n(r.has(e)||(e&&ae(e.install)?(r.add(e),e.install(a,...t)):ae(e)&&(r.add(e),e(a,...t))),a),mixin:e=>(i.mixins.includes(e)||i.mixins.push(e),a),component:(e,t)=>t?(i.components[e]=t,a):i.components[e],directive:(e,t)=>t?(i.directives[e]=t,a):i.directives[e],mount(r,l,c){if(!s){const u=Ki(n,o);return u.appContext=i,!0===c?c="svg":!1===c&&(c=void 0),l&&t?t(u,r):e(u,r,c),s=!0,a._container=r,r.__vue_app__=a,yr(u.component)}},unmount(){s&&(e(null,a._container),delete a._container.__vue_app__)},provide:(e,t)=>(i.provides[e]=t,a),runWithContext(e){const t=Uo;Uo=a;try{return e()}finally{Uo=t}}};return a}}let Uo=null;function zo(e,t,n=!1){const o=sr||Fn;if(o||Uo){const i=o?null==o.parent?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:Uo._context.provides;if(i&&e in i)return i[e];if(arguments.length>1)return n&&ae(t)?t.call(o&&o.proxy):t}}const Vo={},Ho=()=>Object.create(Vo),Wo=e=>Object.getPrototypeOf(e)===Vo;function Yo(e,t,n,o=!1){const i={},r=Ho();e.propsDefaults=Object.create(null),Zo(e,t,i,r);for(const s in e.propsOptions[0])s in i||(i[s]=void 0);n?e.props=o?i:Jt(i,!1,kt,Vt,Yt):e.type.props?e.props=i:e.props=r,e.attrs=r}function Zo(e,t,n,o){const[i,r]=e.propsOptions;let s,a=!1;if(t)for(let l in t){if(ve(l))continue;const c=t[l];let u;i&&oe(i,u=_e(l))?r&&r.includes(u)?(s||(s={}))[u]=c:n[u]=c:Ei(e.emitsOptions,l)||l in o&&c===o[l]||(o[l]=c,a=!0)}if(r){const t=on(n),o=s||Z;for(let s=0;s{l=!0;const[n,o]=Qo(e,t,!0);ee(s,n),o&&a.push(...o)};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}if(!r&&!l)return ue(e)&&o.set(e,K),K;if(ie(r))for(let u=0;u"_"===e[0]||"$stable"===e,ei=e=>ie(e)?e.map(qi):[qi(e)],ti=(e,t,n)=>{if(t._n)return t;const o=Vn(((...e)=>ei(t(...e))),n);return o._c=!1,o},ni=(e,t,n)=>{const o=e._ctx;for(const i in e){if(qo(i))continue;const n=e[i];if(ae(n))t[i]=ti(0,n,o);else if(null!=n){const e=ei(n);t[i]=()=>e}}},oi=(e,t)=>{const n=ei(t);e.slots.default=()=>n},ii=(e,t,n)=>{for(const o in t)(n||"_"!==o)&&(e[o]=t[o])},ri=(e,t,n)=>{const o=e.slots=Ho();if(32&e.vnode.shapeFlag){const e=t._;e?(ii(o,t,n),n&&Ee(o,"_",e,!0)):ni(t,o)}else t&&oi(e,t)},si=(e,t,n)=>{const{vnode:o,slots:i}=e;let r=!0,s=Z;if(32&o.shapeFlag){const e=t._;e?n&&1===e?r=!1:ii(i,t,n):(r=!t.$stable,ni(t,i)),s=t}else t&&(oi(e,t),s={default:1});if(r)for(const a in i)qo(a)||null!=s[a]||delete i[a]};function ai(e,t,n,o,i=!1){if(ie(e))return void e.forEach(((e,r)=>ai(e,t&&(ie(t)?t[r]:t),n,o,i)));if(Zn(o)&&!i)return;const r=4&o.shapeFlag?yr(o.component):o.el,s=i?null:r,{i:a,r:l}=e,c=t&&t.r,u=a.refs===Z?a.refs={}:a.refs,d=a.setupState;if(null!=c&&c!==l&&(le(c)?(u[c]=null,oe(d,c)&&(d[c]=null)):dn(c)&&(c.value=null)),ae(l))wn(l,a,12,[s,u]);else{const t=le(l),o=dn(l);if(t||o){const a=()=>{if(e.f){const n=t?oe(d,l)?d[l]:u[l]:l.value;i?ie(n)&&te(n,r):ie(n)?n.includes(r)||n.push(r):t?(u[l]=[r],oe(d,l)&&(d[l]=u[l])):(l.value=[r],e.k&&(u[e.k]=l.value))}else t?(u[l]=s,oe(d,l)&&(d[l]=s)):o&&(l.value=s,e.k&&(u[e.k]=s))};s?(a.id=-1,ci(a,n)):a()}}}const li=Symbol("_vte"),ci=function(e,t){t&&t.pendingBranch?ie(e)?t.effects.push(...e):t.effects.push(e):(ie(n=e)?On.push(...n):Ln&&Ln.includes(n,n.allowRecurse?Tn+1:Tn)||On.push(n),jn());var n};function ui(e){return function(e){Te().__VUE__=!0;const{insert:t,remove:n,patchProp:o,createElement:i,createText:r,createComment:s,setText:a,setElementText:l,parentNode:c,nextSibling:u,setScopeId:d=X,insertStaticContent:p}=e,f=(e,t,n,o=null,i=null,r=null,s=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Hi(e,t)&&(o=F(e),M(e,i,r,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:u,shapeFlag:d}=t;switch(c){case Pi:h(e,t,n,o);break;case Di:m(e,t,n,o);break;case ji:null==e&&g(t,n,o,s);break;case Ni:A(e,t,n,o,i,r,s,a,l);break;default:1&d?b(e,t,n,o,i,r,s,a,l):6&d?E(e,t,n,o,i,r,s,a,l):(64&d||128&d)&&c.process(e,t,n,o,i,r,s,a,l,V)}null!=u&&i&&ai(u,e&&e.ref,r,t||e,!t)},h=(e,n,o,i)=>{if(null==e)t(n.el=r(n.children),o,i);else{const t=n.el=e.el;n.children!==e.children&&a(t,n.children)}},m=(e,n,o,i)=>{null==e?t(n.el=s(n.children||""),o,i):n.el=e.el},g=(e,t,n,o)=>{[e.el,e.anchor]=p(e.children,t,n,o,e.el,e.anchor)},v=({el:e,anchor:n},o,i)=>{let r;for(;e&&e!==n;)r=u(e),t(e,o,i),e=r;t(n,o,i)},y=({el:e,anchor:t})=>{let o;for(;e&&e!==t;)o=u(e),n(e),e=o;n(t)},b=(e,t,n,o,i,r,s,a,l)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?_(t,n,o,i,r,s,a,l):x(e,t,i,r,s,a,l)},_=(e,n,r,s,a,c,u,d)=>{let p,f;const{props:h,shapeFlag:m,transition:g,dirs:v}=e;if(p=e.el=i(e.type,c,h&&h.is,h),8&m?l(p,e.children):16&m&&S(e.children,p,null,s,a,di(e,c),u,d),v&&Wn(e,null,s,"created"),w(p,e,e.scopeId,u,s),h){for(const e in h)"value"===e||ve(e)||o(p,e,null,h[e],c,s);"value"in h&&o(p,"value",null,h.value,c),(f=h.onVnodeBeforeMount)&&or(f,s,e)}v&&Wn(e,null,s,"beforeMount");const y=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(a,g);y&&g.beforeEnter(p),t(p,n,r),((f=h&&h.onVnodeMounted)||y||v)&&ci((()=>{f&&or(f,s,e),y&&g.enter(p),v&&Wn(e,null,s,"mounted")}),a)},w=(e,t,n,o,i)=>{if(n&&d(e,n),o)for(let r=0;r{for(let c=l;c{const c=t.el=e.el;let{patchFlag:u,dynamicChildren:d,dirs:p}=t;u|=16&e.patchFlag;const f=e.props||Z,h=t.props||Z;let m;if(n&&pi(n,!1),(m=h.onVnodeBeforeUpdate)&&or(m,n,t,e),p&&Wn(t,e,n,"beforeUpdate"),n&&pi(n,!0),(f.innerHTML&&null==h.innerHTML||f.textContent&&null==h.textContent)&&l(c,""),d?k(e.dynamicChildren,d,c,n,i,di(t,r),s):a||N(e,t,c,null,n,i,di(t,r),s,!1),u>0){if(16&u)C(c,f,h,n,r);else if(2&u&&f.class!==h.class&&o(c,"class",null,h.class,r),4&u&&o(c,"style",f.style,h.style,r),8&u){const e=t.dynamicProps;for(let t=0;t{m&&or(m,n,t,e),p&&Wn(t,e,n,"updated")}),i)},k=(e,t,n,o,i,r,s)=>{for(let a=0;a{if(t!==n){if(t!==Z)for(const s in t)ve(s)||s in n||o(e,s,t[s],null,r,i);for(const s in n){if(ve(s))continue;const a=n[s],l=t[s];a!==l&&"value"!==s&&o(e,s,l,a,r,i)}"value"in n&&o(e,"value",t.value,n.value,r)}},A=(e,n,o,i,s,a,l,c,u)=>{const d=n.el=e?e.el:r(""),p=n.anchor=e?e.anchor:r("");let{patchFlag:f,dynamicChildren:h,slotScopeIds:m}=n;m&&(c=c?c.concat(m):m),null==e?(t(d,o,i),t(p,o,i),S(n.children||[],o,p,s,a,l,c,u)):f>0&&64&f&&h&&e.dynamicChildren?(k(e.dynamicChildren,h,o,s,a,l,c),(null!=n.key||s&&n===s.subTree)&&fi(e,n,!0)):N(e,n,o,p,s,a,l,c,u)},E=(e,t,n,o,i,r,s,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?i.ctx.activate(t,n,o,s,l):O(t,n,o,i,r,s,l):L(e,t,l)},O=(e,t,n,o,i,r,s)=>{const a=e.component=function(e,t,n){const o=e.type,i=(t?t.appContext:e.appContext)||ir,r={uid:rr++,vnode:e,type:o,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new He(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Qo(o,i),emitsOptions:Ai(o,i),emit:null,emitted:null,propsDefaults:Z,inheritAttrs:o.inheritAttrs,ctx:Z,data:Z,props:Z,attrs:Z,slots:Z,refs:Z,setupState:Z,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};r.ctx={_:r},r.root=t?t.root:r,r.emit=Ci.bind(null,r),e.ce&&e.ce(r);return r}(e,o,i);if(Kn(e)&&(a.ctx.renderer=V),function(e,t=!1,n=!1){t&&cr(t);const{props:o,children:i}=e.vnode,r=pr(e);Yo(e,o,r,t),ri(e,i,n);const s=r?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Co);const{setup:o}=n;if(o){const n=e.setupContext=o.length>1?function(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,vr),slots:e.slots,emit:e.emit,expose:t}}(e):null,i=ur(e);tt();const r=wn(o,e,0,[e.props,n]);if(nt(),i(),de(r)){if(r.then(dr,dr),t)return r.then((n=>{mr(e,n,t)})).catch((t=>{xn(t,e,0)}));e.asyncDep=r}else mr(e,r,t)}else gr(e,t)}(e,t):void 0;t&&cr(!1)}(a,!1,s),a.asyncDep){if(i&&i.registerDep(a,T,s),!e.el){const e=a.subTree=Ki(Di);m(null,e,t,n)}}else T(a,e,t,n,i,r,s)},L=(e,t,n)=>{const o=t.component=e.component;if(function(e,t,n){const{props:o,children:i,component:r}=e,{props:s,children:a,patchFlag:l}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!i&&!a||a&&a.$stable)||o!==s&&(o?!s||Ii(o,s,c):!!s);if(1024&l)return!0;if(16&l)return o?Ii(o,s,c):!!s;if(8&l){const e=t.dynamicProps;for(let t=0;tEn&&An.splice(t,1)}(o.update),o.effect.dirty=!0,o.update()}else t.el=e.el,o.vnode=t},T=(e,t,n,o,i,r,s)=>{const a=()=>{if(e.isMounted){let{next:t,bu:n,u:o,parent:l,vnode:u}=e;{const n=hi(e);if(n)return t&&(t.el=u.el,I(e,t,s)),void n.asyncDep.then((()=>{e.isUnmounted||a()}))}let d,p=t;pi(e,!1),t?(t.el=u.el,I(e,t,s)):t=u,n&&Ae(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&or(d,l,t,u),pi(e,!0);const h=Oi(e),m=e.subTree;e.subTree=h,f(m,h,c(m.el),F(m),e,i,r),t.el=h.el,null===p&&function({vnode:e,parent:t},n){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.el=e.el),o!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,h.el),o&&ci(o,i),(d=t.props&&t.props.onVnodeUpdated)&&ci((()=>or(d,l,t,u)),i)}else{let s;const{el:a,props:l}=t,{bm:c,m:u,parent:d}=e,p=Zn(t);if(pi(e,!1),c&&Ae(c),!p&&(s=l&&l.onVnodeBeforeMount)&&or(s,d,t),pi(e,!0),a&&W){const n=()=>{e.subTree=Oi(e),W(a,e.subTree,e,i,null)};p?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const s=e.subTree=Oi(e);f(null,s,n,o,e,i,r),t.el=s.el}if(u&&ci(u,i),!p&&(s=l&&l.onVnodeMounted)){const e=t;ci((()=>or(s,d,e)),i)}(256&t.shapeFlag||d&&Zn(d.vnode)&&256&d.vnode.shapeFlag)&&e.a&&ci(e.a,i),e.isMounted=!0,t=n=o=null}},l=e.effect=new Ze(a,X,(()=>Dn(u)),e.scope),u=e.update=()=>{l.dirty&&l.run()};u.i=e,u.id=e.uid,pi(e,!0),u()},I=(e,t,n)=>{t.component=e;const o=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,o){const{props:i,attrs:r,vnode:{patchFlag:s}}=e,a=on(i),[l]=e.propsOptions;let c=!1;if(!(o||s>0)||16&s){let o;Zo(e,t,i,r)&&(c=!0);for(const r in a)t&&(oe(t,r)||(o=Se(r))!==r&&oe(t,o))||(l?!n||void 0===n[r]&&void 0===n[o]||(i[r]=Ko(l,a,r,void 0,e,!0)):delete i[r]);if(r!==a)for(const e in r)t&&oe(t,e)||(delete r[e],c=!0)}else if(8&s){const n=e.vnode.dynamicProps;for(let o=0;o{const u=e&&e.children,d=e?e.shapeFlag:0,p=t.children,{patchFlag:f,shapeFlag:h}=t;if(f>0){if(128&f)return void D(u,p,n,o,i,r,s,a,c);if(256&f)return void P(u,p,n,o,i,r,s,a,c)}8&h?(16&d&&B(u,i,r),p!==u&&l(n,p)):16&d?16&h?D(u,p,n,o,i,r,s,a,c):B(u,i,r,!0):(8&d&&l(n,""),16&h&&S(p,n,o,i,r,s,a,c))},P=(e,t,n,o,i,r,s,a,l)=>{t=t||K;const c=(e=e||K).length,u=t.length,d=Math.min(c,u);let p;for(p=0;pu?B(e,i,r,!0,!1,d):S(t,n,o,i,r,s,a,l,d)},D=(e,t,n,o,i,r,s,a,l)=>{let c=0;const u=t.length;let d=e.length-1,p=u-1;for(;c<=d&&c<=p;){const o=e[c],u=t[c]=l?er(t[c]):qi(t[c]);if(!Hi(o,u))break;f(o,u,n,null,i,r,s,a,l),c++}for(;c<=d&&c<=p;){const o=e[d],c=t[p]=l?er(t[p]):qi(t[p]);if(!Hi(o,c))break;f(o,c,n,null,i,r,s,a,l),d--,p--}if(c>d){if(c<=p){const e=p+1,d=ep)for(;c<=d;)M(e[c],i,r,!0),c++;else{const h=c,m=c,g=new Map;for(c=m;c<=p;c++){const e=t[c]=l?er(t[c]):qi(t[c]);null!=e.key&&g.set(e.key,c)}let v,y=0;const b=p-m+1;let _=!1,w=0;const S=new Array(b);for(c=0;c=b){M(o,i,r,!0);continue}let u;if(null!=o.key)u=g.get(o.key);else for(v=m;v<=p;v++)if(0===S[v-m]&&Hi(o,t[v])){u=v;break}void 0===u?M(o,i,r,!0):(S[u-m]=c+1,u>=w?w=u:_=!0,f(o,t[u],n,null,i,r,s,a,l),y++)}const x=_?function(e){const t=e.slice(),n=[0];let o,i,r,s,a;const l=e.length;for(o=0;o>1,e[n[a]]0&&(t[o]=n[r-1]),n[r]=o)}}r=n.length,s=n[r-1];for(;r-- >0;)n[r]=s,s=t[s];return n}(S):K;for(v=x.length-1,c=b-1;c>=0;c--){const e=m+c,d=t[e],p=e+1{const{el:s,type:a,transition:l,children:c,shapeFlag:u}=e;if(6&u)return void j(e.component.subTree,n,o,i);if(128&u)return void e.suspense.move(n,o,i);if(64&u)return void a.move(e,n,o,V);if(a===Ni){t(s,n,o);for(let e=0;el.enter(s)),r);else{const{leave:e,delayLeave:i,afterLeave:r}=l,a=()=>t(s,n,o),c=()=>{e(s,(()=>{a(),r&&r()}))};i?i(s,a,c):c()}else t(s,n,o)},M=(e,t,n,o=!1,i=!1)=>{const{type:r,props:s,ref:a,children:l,dynamicChildren:c,shapeFlag:u,patchFlag:d,dirs:p,cacheIndex:f}=e;if(-2===d&&(i=!1),null!=a&&ai(a,null,n,e,!0),null!=f&&(t.renderCache[f]=void 0),256&u)return void t.ctx.deactivate(e);const h=1&u&&p,m=!Zn(e);let g;if(m&&(g=s&&s.onVnodeBeforeUnmount)&&or(g,t,e),6&u)G(e.component,n,o);else{if(128&u)return void e.suspense.unmount(n,o);h&&Wn(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,V,o):c&&!c.hasOnce&&(r!==Ni||d>0&&64&d)?B(c,t,n,!1,!0):(r===Ni&&384&d||!i&&16&u)&&B(l,t,n),o&&R(e)}(m&&(g=s&&s.onVnodeUnmounted)||h)&&ci((()=>{g&&or(g,t,e),h&&Wn(e,null,t,"unmounted")}),n)},R=e=>{const{type:t,el:o,anchor:i,transition:r}=e;if(t===Ni)return void $(o,i);if(t===ji)return void y(e);const s=()=>{n(o),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){const{leave:t,delayLeave:n}=r,i=()=>t(o,s);n?n(e.el,s,i):i()}else s()},$=(e,t)=>{let o;for(;e!==t;)o=u(e),n(e),e=o;n(t)},G=(e,t,n)=>{const{bum:o,scope:i,update:r,subTree:s,um:a,m:l,a:c}=e;mi(l),mi(c),o&&Ae(o),i.stop(),r&&(r.active=!1,M(s,e,t,n)),a&&ci(a,t),ci((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},B=(e,t,n,o=!1,i=!1,r=0)=>{for(let s=r;s{if(6&e.shapeFlag)return F(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=u(e.anchor||e.el),n=t&&t[li];return n?u(n):t};let U=!1;const z=(e,t,n)=>{null==e?t._vnode&&M(t._vnode,null,null,!0):f(t._vnode||null,e,t,null,null,null,n),U||(U=!0,Mn(),Rn(),U=!1),t._vnode=e},V={p:f,um:M,m:j,r:R,mt:O,mc:S,pc:N,pbc:k,n:F,o:e};let H,W;return{render:z,hydrate:H,createApp:Fo(z,H)}}(e)}function di({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function pi({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function fi(e,t,n=!1){const o=e.children,i=t.children;if(ie(o)&&ie(i))for(let r=0;rzo(gi),yi={};function bi(e,t,n){return _i(e,t,n)}function _i(e,t,{immediate:n,deep:o,flush:i,once:r,onTrack:s,onTrigger:a}=Z){if(t&&r){const e=t;t=(...t)=>{e(...t),w()}}const l=sr,c=e=>!0===o?e:xi(e,!1===o?1:void 0);let u,d,p=!1,f=!1;if(dn(e)?(u=()=>e.value,p=tn(e)):qt(e)?(u=()=>c(e),p=!0):ie(e)?(f=!0,p=e.some((e=>qt(e)||tn(e))),u=()=>e.map((e=>dn(e)?e.value:qt(e)?c(e):ae(e)?wn(e,l,2):void 0))):u=ae(e)?t?()=>wn(e,l,2):()=>(d&&d(),Sn(e,l,3,[m])):X,t&&o){const e=u;u=()=>xi(e())}let h,m=e=>{d=b.onStop=()=>{wn(e,l,4),d=b.onStop=void 0}};if(hr){if(m=X,t?n&&Sn(t,l,3,[u(),f?[]:void 0,m]):u(),"sync"!==i)return X;{const e=vi();h=e.__watcherHandles||(e.__watcherHandles=[])}}let g=f?new Array(e.length).fill(yi):yi;const v=()=>{if(b.active&&b.dirty)if(t){const e=b.run();(o||p||(f?e.some(((e,t)=>Ce(e,g[t]))):Ce(e,g)))&&(d&&d(),Sn(t,l,3,[e,g===yi?void 0:f&&g[0]===yi?[]:g,m]),g=e)}else b.run()};let y;v.allowRecurse=!!t,"sync"===i?y=v:"post"===i?y=()=>ci(v,l&&l.suspense):(v.pre=!0,l&&(v.id=l.uid),y=()=>Dn(v));const b=new Ze(u,X,y),_=Ye(),w=()=>{b.stop(),_&&te(_.effects,b)};return t?n?v():g=b.run():"post"===i?ci(b.run.bind(b),l&&l.suspense):b.run(),h&&h.push(w),w}function wi(e,t,n){const o=this.proxy,i=le(e)?e.includes(".")?Si(o,e):()=>o[e]:e.bind(o,o);let r;ae(t)?r=t:(r=t.handler,n=t);const s=ur(this),a=_i(i,r.bind(o),n);return s(),a}function Si(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{xi(e,t,n)}));else if(me(e)){for(const o in e)xi(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&xi(e[o],t,n)}return e}const ki=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${_e(t)}Modifiers`]||e[`${Se(t)}Modifiers`];function Ci(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Z;let i=n;const r=t.startsWith("update:"),s=r&&ki(o,t.slice(7));let a;s&&(s.trim&&(i=n.map((e=>le(e)?e.trim():e))),s.number&&(i=n.map(Oe)));let l=o[a=ke(t)]||o[a=ke(_e(t))];!l&&r&&(l=o[a=ke(Se(t))]),l&&Sn(l,e,6,i);const c=o[a+"Once"];if(c){if(e.emitted){if(e.emitted[a])return}else e.emitted={};e.emitted[a]=!0,Sn(c,e,6,i)}}function Ai(e,t,n=!1){const o=t.emitsCache,i=o.get(e);if(void 0!==i)return i;const r=e.emits;let s={},a=!1;if(!ae(e)){const o=e=>{const n=Ai(e,t,!0);n&&(a=!0,ee(s,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return r||a?(ie(r)?r.forEach((e=>s[e]=null)):ee(s,r),ue(e)&&o.set(e,s),s):(ue(e)&&o.set(e,null),null)}function Ei(e,t){return!(!e||!J(t))&&(t=t.slice(2).replace(/Once$/,""),oe(e,t[0].toLowerCase()+t.slice(1))||oe(e,Se(t))||oe(e,t))}function Oi(e){const{type:t,vnode:n,proxy:o,withProxy:i,propsOptions:[r],slots:s,attrs:a,emit:l,render:c,renderCache:u,props:d,data:p,setupState:f,ctx:h,inheritAttrs:m}=e,g=zn(e);let v,y;try{if(4&n.shapeFlag){const e=i||o,t=e;v=qi(c.call(t,e,u,d,f,p,h)),y=a}else{const e=t;0,v=qi(e.length>1?e(d,{attrs:a,slots:s,emit:l}):e(d,null)),y=t.props?a:Li(a)}}catch(_){Mi.length=0,xn(_,e,1),v=Ki(Di)}let b=v;if(y&&!1!==m){const e=Object.keys(y),{shapeFlag:t}=b;e.length&&7&t&&(r&&e.some(q)&&(y=Ti(y,r)),b=Xi(b,y,!1,!0))}return n.dirs&&(b=Xi(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&(b.transition=n.transition),v=b,zn(g),v}const Li=e=>{let t;for(const n in e)("class"===n||"style"===n||J(n))&&((t||(t={}))[n]=e[n]);return t},Ti=(e,t)=>{const n={};for(const o in e)q(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function Ii(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let i=0;i0?Ri||K:null,Mi.pop(),Ri=Mi[Mi.length-1]||null,Gi>0&&Ri&&Ri.push(e),e}function Ui(e,t,n,o,i,r){return Fi(Zi(e,t,n,o,i,r,!0))}function zi(e,t,n,o,i){return Fi(Ki(e,t,n,o,i,!0))}function Vi(e){return!!e&&!0===e.__v_isVNode}function Hi(e,t){return e.type===t.type&&e.key===t.key}const Wi=({key:e})=>null!=e?e:null,Yi=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?le(e)||dn(e)||ae(e)?{i:Fn,r:e,k:t,f:!!n}:e:null);function Zi(e,t=null,n=null,o=0,i=null,r=(e===Ni?0:1),s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Wi(t),ref:t&&Yi(t),scopeId:Un,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:o,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Fn};return a?(tr(l,n),128&r&&e.normalize(l)):n&&(l.shapeFlag|=le(n)?8:16),Gi>0&&!s&&Ri&&(l.patchFlag>0||6&r)&&32!==l.patchFlag&&Ri.push(l),l}const Ki=function(e,t=null,n=null,o=0,i=null,r=!1){e&&e!==go||(e=Di);if(Vi(e)){const o=Xi(e,t,!0);return n&&tr(o,n),Gi>0&&!r&&Ri&&(6&o.shapeFlag?Ri[Ri.indexOf(e)]=o:Ri.push(o)),o.patchFlag=-2,o}s=e,ae(s)&&"__vccOpts"in s&&(e=e.__vccOpts);var s;if(t){t=function(e){return e?nn(e)||Wo(e)?ee({},e):e:null}(t);let{class:e,style:n}=t;e&&!le(e)&&(t.class=Me(e)),ue(n)&&(nn(n)&&!ie(n)&&(n=ee({},n)),t.style=Ie(n))}const a=le(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:ue(e)?4:ae(e)?2:0;return Zi(e,t,n,o,i,a,r,!0)};function Xi(e,t,n=!1,o=!1){const{props:i,ref:r,patchFlag:s,children:a,transition:l}=e,c=t?nr(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Wi(c),ref:t&&t.ref?n&&r?ie(r)?r.concat(Yi(t)):[r,Yi(t)]:Yi(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ni?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Xi(e.ssContent),ssFallback:e.ssFallback&&Xi(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&o&&Yn(u,l.clone(u)),u}function Qi(e=" ",t=0){return Ki(Pi,null,e,t)}function Ji(e="",t=!1){return t?($i(),zi(Di,null,e)):Ki(Di,null,e)}function qi(e){return null==e||"boolean"==typeof e?Ki(Di):ie(e)?Ki(Ni,null,e.slice()):"object"==typeof e?er(e):Ki(Pi,null,String(e))}function er(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Xi(e)}function tr(e,t){let n=0;const{shapeFlag:o}=e;if(null==t)t=null;else if(ie(t))n=16;else if("object"==typeof t){if(65&o){const n=t.default;return void(n&&(n._c&&(n._d=!1),tr(e,n()),n._c&&(n._d=!0)))}{n=32;const o=t._;o||Wo(t)?3===o&&Fn&&(1===Fn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=Fn}}else ae(t)?(t={default:t,_ctx:Fn},n=32):(t=String(t),64&o?(n=16,t=[Qi(t)]):n=8);e.children=t,e.shapeFlag|=n}function nr(...e){const t={};for(let n=0;nsr||Fn;let lr,cr;{const e=Te(),t=(t,n)=>{let o;return(o=e[t])||(o=e[t]=[]),o.push(n),e=>{o.length>1?o.forEach((t=>t(e))):o[0](e)}};lr=t("__VUE_INSTANCE_SETTERS__",(e=>sr=e)),cr=t("__VUE_SSR_SETTERS__",(e=>hr=e))}const ur=e=>{const t=sr;return lr(e),e.scope.on(),()=>{e.scope.off(),lr(t)}},dr=()=>{sr&&sr.scope.off(),lr(null)};function pr(e){return 4&e.vnode.shapeFlag}let fr,hr=!1;function mr(e,t,n){ae(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ue(t)&&(e.setupState=gn(t)),gr(e,n)}function gr(e,t,n){const o=e.type;if(!e.render){if(!t&&fr&&!o.render){const t=o.template||Io(e).template;if(t){const{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:r,compilerOptions:s}=o,a=ee(ee({isCustomElement:n,delimiters:r},i),s);o.render=fr(t,a)}}e.render=o.render||X}{const t=ur(e);tt();try{Oo(e)}finally{nt(),t()}}}const vr={get:(e,t)=>(pt(e,0,""),e[t])};function yr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(gn(rn(e.exposed)),{get:(t,n)=>n in t?t[n]:n in xo?xo[n](e):void 0,has:(e,t)=>t in e||t in xo})):e.proxy}function br(e,t=!0){return ae(e)?e.displayName||e.name:e.name||t&&e.__name}const _r=(e,t)=>{const n=function(e,t,n=!1){let o,i;const r=ae(e);return r?(o=e,i=X):(o=e.get,i=e.set),new ln(o,i,r||!i,n)}(e,0,hr);return n};const wr="3.4.36",Sr="undefined"!=typeof document?document:null,xr=Sr&&Sr.createElement("template"),kr={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const i="svg"===t?Sr.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?Sr.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?Sr.createElement(e,{is:n}):Sr.createElement(e);return"select"===e&&o&&null!=o.multiple&&i.setAttribute("multiple",o.multiple),i},createText:e=>Sr.createTextNode(e),createComment:e=>Sr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Sr.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,i,r){const s=n?n.previousSibling:t.lastChild;if(i&&(i===r||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==r&&(i=i.nextSibling););else{xr.innerHTML="svg"===o?`${e}`:"mathml"===o?`${e}`:e;const i=xr.content;if("svg"===o||"mathml"===o){const e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Cr=Symbol("_vtc"); +**/function wn(e,t,n,o){try{return o?e(...o):e()}catch(i){xn(i,t,n)}}function Sn(e,t,n,o){if(ae(e)){const i=wn(e,t,n,o);return i&&de(i)&&i.catch((e=>{xn(e,t,n)})),i}if(ie(e)){const i=[];for(let r=0;r>>1,i=An[o],r=$n(i);r$n(e)-$n(t)));if(On.length=0,Ln)return void Ln.push(...e);for(Ln=e,Tn=0;Tnnull==e.id?1/0:e.id,Gn=(e,t)=>{const n=$n(e)-$n(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Bn(e){Cn=!1,kn=!0,An.sort(Gn);try{for(En=0;En{o._d&&Bi(-1);const i=zn(t);let r;try{r=e(...n)}finally{zn(i),o._d&&Bi(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function Hn(e,t){if(null===Fn)return e;const n=yr(Fn),o=e.dirs||(e.dirs=[]);for(let i=0;i!!e.type.__asyncLoader,Kn=e=>e.type.__isKeepAlive;function Xn(e,t){Jn(e,"a",t)}function Qn(e,t){Jn(e,"da",t)}function Jn(e,t,n=sr){const o=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(eo(t,o,n),n){let e=n.parent;for(;e&&e.parent;)Kn(e.parent.vnode)&&qn(o,t,n,e),e=e.parent}}function qn(e,t,n,o){const i=eo(t,e,o,!0);ao((()=>{te(o[t],i)}),n)}function eo(e,t,n=sr,o=!1){if(n){const i=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...o)=>{tt();const i=ur(n),r=Sn(t,n,e,o);return i(),nt(),r});return o?i.unshift(r):i.push(r),r}}const to=e=>(t,n=sr)=>{hr&&"sp"!==e||eo(e,((...e)=>t(...e)),n)},no=to("bm"),oo=to("m"),io=to("bu"),ro=to("u"),so=to("bum"),ao=to("um"),lo=to("sp"),co=to("rtg"),uo=to("rtc");function po(e,t=sr){eo("ec",e,t)}const fo="components",ho="directives";function mo(e,t){return vo(fo,e,!0,t)||e}const go=Symbol.for("v-ndc");function vo(e,t,n=!0,o=!1){const i=Fn||sr;if(i){const n=i.type;if(e===fo){const e=br(n,!1);if(e&&(e===t||e===_e(t)||e===xe(_e(t))))return n}const r=yo(i[e]||n[e],t)||yo(i.appContext[e],t);return!r&&o?n:r}}function yo(e,t){return e&&(e[t]||e[_e(t)]||e[xe(_e(t))])}function bo(e,t,n,o){let i;const r=n;if(ie(e)||le(e)){i=new Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,r)));else{const n=Object.keys(e);i=new Array(n.length);for(let o=0,s=n.length;o!Vi(e)||e.type!==Di&&!(e.type===Ii&&!wo(e.children))))?e:null}const So=e=>e?pr(e)?yr(e):So(e.parent):null,xo=ee(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>So(e.parent),$root:e=>So(e.root),$emit:e=>e.emit,$options:e=>No(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Dn(e.update)}),$nextTick:e=>e.n||(e.n=Pn.bind(e.proxy)),$watch:e=>wi.bind(e)}),ko=(e,t)=>e!==Z&&!e.__isScriptSetup&&oe(e,t),Co={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:o,data:i,props:r,accessCache:s,type:a,appContext:l}=e;let c;if("$"!==t[0]){const a=s[t];if(void 0!==a)switch(a){case 1:return o[t];case 2:return i[t];case 4:return n[t];case 3:return r[t]}else{if(ko(o,t))return s[t]=1,o[t];if(i!==Z&&oe(i,t))return s[t]=2,i[t];if((c=e.propsOptions[0])&&oe(c,t))return s[t]=3,r[t];if(n!==Z&&oe(n,t))return s[t]=4,n[t];Eo&&(s[t]=0)}}const u=xo[t];let d,p;return u?("$attrs"===t&&pt(e.attrs,0,""),u(e)):(d=a.__cssModules)&&(d=d[t])?d:n!==Z&&oe(n,t)?(s[t]=4,n[t]):(p=l.config.globalProperties,oe(p,t)?p[t]:void 0)},set({_:e},t,n){const{data:o,setupState:i,ctx:r}=e;return ko(i,t)?(i[t]=n,!0):o!==Z&&oe(o,t)?(o[t]=n,!0):!oe(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(r[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:i,propsOptions:r}},s){let a;return!!n[s]||e!==Z&&oe(e,s)||ko(t,s)||(a=r[0])&&oe(a,s)||oe(o,s)||oe(xo,s)||oe(i.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:oe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ao(e){return ie(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}let Eo=!0;function Oo(e){const t=No(e),n=e.proxy,o=e.ctx;Eo=!1,t.beforeCreate&&Lo(t.beforeCreate,e,"bc");const{data:i,computed:r,methods:s,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:p,beforeUpdate:f,updated:h,activated:m,deactivated:g,beforeDestroy:v,beforeUnmount:y,destroyed:b,unmounted:_,render:w,renderTracked:S,renderTriggered:x,errorCaptured:k,serverPrefetch:C,expose:A,inheritAttrs:E,components:O,directives:L,filters:T}=t;if(c&&function(e,t){ie(e)&&(e=jo(e));for(const n in e){const o=e[n];let i;i=ue(o)?"default"in o?zo(o.from||n,o.default,!0):zo(o.from||n):zo(o),dn(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}(c,o,null),s)for(const I in s){const e=s[I];ae(e)&&(o[I]=e.bind(n))}if(i){const t=i.call(n,n);ue(t)&&(e.data=Xt(t))}if(Eo=!0,r)for(const I in r){const e=r[I],t=ae(e)?e.bind(n,n):ae(e.get)?e.get.bind(n,n):X,i=!ae(e)&&ae(e.set)?e.set.bind(n):X,s=_r({get:t,set:i});Object.defineProperty(o,I,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(a)for(const I in a)To(a[I],o,n,I);if(l){const e=ae(l)?l.call(n):l;Reflect.ownKeys(e).forEach((t=>{!function(e,t){if(sr){let n=sr.provides;const o=sr.parent&&sr.parent.provides;o===n&&(n=sr.provides=Object.create(o)),n[e]=t}else;}(t,e[t])}))}function N(e,t){ie(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(u&&Lo(u,e,"c"),N(no,d),N(oo,p),N(io,f),N(ro,h),N(Xn,m),N(Qn,g),N(po,k),N(uo,S),N(co,x),N(so,y),N(ao,_),N(lo,C),ie(A))if(A.length){const t=e.exposed||(e.exposed={});A.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});w&&e.render===X&&(e.render=w),null!=E&&(e.inheritAttrs=E),O&&(e.components=O),L&&(e.directives=L)}function Lo(e,t,n){Sn(ie(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function To(e,t,n,o){const i=o.includes(".")?Si(n,o):()=>n[o];if(le(e)){const n=t[e];ae(n)&&bi(i,n)}else if(ae(e))bi(i,e.bind(n));else if(ue(e))if(ie(e))e.forEach((e=>To(e,t,n,o)));else{const o=ae(e.handler)?e.handler.bind(n):t[e.handler];ae(o)&&bi(i,o,e)}}function No(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:i,optionsCache:r,config:{optionMergeStrategies:s}}=e.appContext,a=r.get(t);let l;return a?l=a:i.length||n||o?(l={},i.length&&i.forEach((e=>Io(l,e,s,!0))),Io(l,t,s)):l=t,ue(t)&&r.set(t,l),l}function Io(e,t,n,o=!1){const{mixins:i,extends:r}=t;r&&Io(e,r,n,!0),i&&i.forEach((t=>Io(e,t,n,!0)));for(const s in t)if(o&&"expose"===s);else{const o=Po[s]||n&&n[s];e[s]=o?o(e[s],t[s]):t[s]}return e}const Po={data:Do,props:$o,emits:$o,methods:Ro,computed:Ro,beforeCreate:Mo,created:Mo,beforeMount:Mo,mounted:Mo,beforeUpdate:Mo,updated:Mo,beforeDestroy:Mo,beforeUnmount:Mo,destroyed:Mo,unmounted:Mo,activated:Mo,deactivated:Mo,errorCaptured:Mo,serverPrefetch:Mo,components:Ro,directives:Ro,watch:function(e,t){if(!e)return t;if(!t)return e;const n=ee(Object.create(null),e);for(const o in t)n[o]=Mo(e[o],t[o]);return n},provide:Do,inject:function(e,t){return Ro(jo(e),jo(t))}};function Do(e,t){return t?e?function(){return ee(ae(e)?e.call(this,this):e,ae(t)?t.call(this,this):t)}:t:e}function jo(e){if(ie(e)){const t={};for(let n=0;n(r.has(e)||(e&&ae(e.install)?(r.add(e),e.install(a,...t)):ae(e)&&(r.add(e),e(a,...t))),a),mixin:e=>(i.mixins.includes(e)||i.mixins.push(e),a),component:(e,t)=>t?(i.components[e]=t,a):i.components[e],directive:(e,t)=>t?(i.directives[e]=t,a):i.directives[e],mount(r,l,c){if(!s){const u=Ki(n,o);return u.appContext=i,!0===c?c="svg":!1===c&&(c=void 0),l&&t?t(u,r):e(u,r,c),s=!0,a._container=r,r.__vue_app__=a,yr(u.component)}},unmount(){s&&(e(null,a._container),delete a._container.__vue_app__)},provide:(e,t)=>(i.provides[e]=t,a),runWithContext(e){const t=Uo;Uo=a;try{return e()}finally{Uo=t}}};return a}}let Uo=null;function zo(e,t,n=!1){const o=sr||Fn;if(o||Uo){const i=o?null==o.parent?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:Uo._context.provides;if(i&&e in i)return i[e];if(arguments.length>1)return n&&ae(t)?t.call(o&&o.proxy):t}}const Vo={},Ho=()=>Object.create(Vo),Wo=e=>Object.getPrototypeOf(e)===Vo;function Yo(e,t,n,o=!1){const i={},r=Ho();e.propsDefaults=Object.create(null),Zo(e,t,i,r);for(const s in e.propsOptions[0])s in i||(i[s]=void 0);n?e.props=o?i:Jt(i,!1,kt,Vt,Yt):e.type.props?e.props=i:e.props=r,e.attrs=r}function Zo(e,t,n,o){const[i,r]=e.propsOptions;let s,a=!1;if(t)for(let l in t){if(ve(l))continue;const c=t[l];let u;i&&oe(i,u=_e(l))?r&&r.includes(u)?(s||(s={}))[u]=c:n[u]=c:Ei(e.emitsOptions,l)||l in o&&c===o[l]||(o[l]=c,a=!0)}if(r){const t=on(n),o=s||Z;for(let s=0;s{l=!0;const[n,o]=Qo(e,t,!0);ee(s,n),o&&a.push(...o)};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}if(!r&&!l)return ue(e)&&o.set(e,K),K;if(ie(r))for(let u=0;u"_"===e[0]||"$stable"===e,ei=e=>ie(e)?e.map(qi):[qi(e)],ti=(e,t,n)=>{if(t._n)return t;const o=Vn(((...e)=>ei(t(...e))),n);return o._c=!1,o},ni=(e,t,n)=>{const o=e._ctx;for(const i in e){if(qo(i))continue;const n=e[i];if(ae(n))t[i]=ti(0,n,o);else if(null!=n){const e=ei(n);t[i]=()=>e}}},oi=(e,t)=>{const n=ei(t);e.slots.default=()=>n},ii=(e,t,n)=>{for(const o in t)(n||"_"!==o)&&(e[o]=t[o])},ri=(e,t,n)=>{const o=e.slots=Ho();if(32&e.vnode.shapeFlag){const e=t._;e?(ii(o,t,n),n&&Ee(o,"_",e,!0)):ni(t,o)}else t&&oi(e,t)},si=(e,t,n)=>{const{vnode:o,slots:i}=e;let r=!0,s=Z;if(32&o.shapeFlag){const e=t._;e?n&&1===e?r=!1:ii(i,t,n):(r=!t.$stable,ni(t,i)),s=t}else t&&(oi(e,t),s={default:1});if(r)for(const a in i)qo(a)||null!=s[a]||delete i[a]};function ai(e,t,n,o,i=!1){if(ie(e))return void e.forEach(((e,r)=>ai(e,t&&(ie(t)?t[r]:t),n,o,i)));if(Zn(o)&&!i)return;const r=4&o.shapeFlag?yr(o.component):o.el,s=i?null:r,{i:a,r:l}=e,c=t&&t.r,u=a.refs===Z?a.refs={}:a.refs,d=a.setupState;if(null!=c&&c!==l&&(le(c)?(u[c]=null,oe(d,c)&&(d[c]=null)):dn(c)&&(c.value=null)),ae(l))wn(l,a,12,[s,u]);else{const t=le(l),o=dn(l);if(t||o){const a=()=>{if(e.f){const n=t?oe(d,l)?d[l]:u[l]:l.value;i?ie(n)&&te(n,r):ie(n)?n.includes(r)||n.push(r):t?(u[l]=[r],oe(d,l)&&(d[l]=u[l])):(l.value=[r],e.k&&(u[e.k]=l.value))}else t?(u[l]=s,oe(d,l)&&(d[l]=s)):o&&(l.value=s,e.k&&(u[e.k]=s))};s?(a.id=-1,ci(a,n)):a()}}}const li=Symbol("_vte"),ci=function(e,t){t&&t.pendingBranch?ie(e)?t.effects.push(...e):t.effects.push(e):(ie(n=e)?On.push(...n):Ln&&Ln.includes(n,n.allowRecurse?Tn+1:Tn)||On.push(n),jn());var n};function ui(e){return function(e){Te().__VUE__=!0;const{insert:t,remove:n,patchProp:o,createElement:i,createText:r,createComment:s,setText:a,setElementText:l,parentNode:c,nextSibling:u,setScopeId:d=X,insertStaticContent:p}=e,f=(e,t,n,o=null,i=null,r=null,s=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Hi(e,t)&&(o=F(e),M(e,i,r,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:u,shapeFlag:d}=t;switch(c){case Pi:h(e,t,n,o);break;case Di:m(e,t,n,o);break;case ji:null==e&&g(t,n,o,s);break;case Ii:A(e,t,n,o,i,r,s,a,l);break;default:1&d?b(e,t,n,o,i,r,s,a,l):6&d?E(e,t,n,o,i,r,s,a,l):(64&d||128&d)&&c.process(e,t,n,o,i,r,s,a,l,V)}null!=u&&i&&ai(u,e&&e.ref,r,t||e,!t)},h=(e,n,o,i)=>{if(null==e)t(n.el=r(n.children),o,i);else{const t=n.el=e.el;n.children!==e.children&&a(t,n.children)}},m=(e,n,o,i)=>{null==e?t(n.el=s(n.children||""),o,i):n.el=e.el},g=(e,t,n,o)=>{[e.el,e.anchor]=p(e.children,t,n,o,e.el,e.anchor)},v=({el:e,anchor:n},o,i)=>{let r;for(;e&&e!==n;)r=u(e),t(e,o,i),e=r;t(n,o,i)},y=({el:e,anchor:t})=>{let o;for(;e&&e!==t;)o=u(e),n(e),e=o;n(t)},b=(e,t,n,o,i,r,s,a,l)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?_(t,n,o,i,r,s,a,l):x(e,t,i,r,s,a,l)},_=(e,n,r,s,a,c,u,d)=>{let p,f;const{props:h,shapeFlag:m,transition:g,dirs:v}=e;if(p=e.el=i(e.type,c,h&&h.is,h),8&m?l(p,e.children):16&m&&S(e.children,p,null,s,a,di(e,c),u,d),v&&Wn(e,null,s,"created"),w(p,e,e.scopeId,u,s),h){for(const e in h)"value"===e||ve(e)||o(p,e,null,h[e],c,s);"value"in h&&o(p,"value",null,h.value,c),(f=h.onVnodeBeforeMount)&&or(f,s,e)}v&&Wn(e,null,s,"beforeMount");const y=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(a,g);y&&g.beforeEnter(p),t(p,n,r),((f=h&&h.onVnodeMounted)||y||v)&&ci((()=>{f&&or(f,s,e),y&&g.enter(p),v&&Wn(e,null,s,"mounted")}),a)},w=(e,t,n,o,i)=>{if(n&&d(e,n),o)for(let r=0;r{for(let c=l;c{const c=t.el=e.el;let{patchFlag:u,dynamicChildren:d,dirs:p}=t;u|=16&e.patchFlag;const f=e.props||Z,h=t.props||Z;let m;if(n&&pi(n,!1),(m=h.onVnodeBeforeUpdate)&&or(m,n,t,e),p&&Wn(t,e,n,"beforeUpdate"),n&&pi(n,!0),(f.innerHTML&&null==h.innerHTML||f.textContent&&null==h.textContent)&&l(c,""),d?k(e.dynamicChildren,d,c,n,i,di(t,r),s):a||I(e,t,c,null,n,i,di(t,r),s,!1),u>0){if(16&u)C(c,f,h,n,r);else if(2&u&&f.class!==h.class&&o(c,"class",null,h.class,r),4&u&&o(c,"style",f.style,h.style,r),8&u){const e=t.dynamicProps;for(let t=0;t{m&&or(m,n,t,e),p&&Wn(t,e,n,"updated")}),i)},k=(e,t,n,o,i,r,s)=>{for(let a=0;a{if(t!==n){if(t!==Z)for(const s in t)ve(s)||s in n||o(e,s,t[s],null,r,i);for(const s in n){if(ve(s))continue;const a=n[s],l=t[s];a!==l&&"value"!==s&&o(e,s,l,a,r,i)}"value"in n&&o(e,"value",t.value,n.value,r)}},A=(e,n,o,i,s,a,l,c,u)=>{const d=n.el=e?e.el:r(""),p=n.anchor=e?e.anchor:r("");let{patchFlag:f,dynamicChildren:h,slotScopeIds:m}=n;m&&(c=c?c.concat(m):m),null==e?(t(d,o,i),t(p,o,i),S(n.children||[],o,p,s,a,l,c,u)):f>0&&64&f&&h&&e.dynamicChildren?(k(e.dynamicChildren,h,o,s,a,l,c),(null!=n.key||s&&n===s.subTree)&&fi(e,n,!0)):I(e,n,o,p,s,a,l,c,u)},E=(e,t,n,o,i,r,s,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?i.ctx.activate(t,n,o,s,l):O(t,n,o,i,r,s,l):L(e,t,l)},O=(e,t,n,o,i,r,s)=>{const a=e.component=function(e,t,n){const o=e.type,i=(t?t.appContext:e.appContext)||ir,r={uid:rr++,vnode:e,type:o,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new He(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Qo(o,i),emitsOptions:Ai(o,i),emit:null,emitted:null,propsDefaults:Z,inheritAttrs:o.inheritAttrs,ctx:Z,data:Z,props:Z,attrs:Z,slots:Z,refs:Z,setupState:Z,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};r.ctx={_:r},r.root=t?t.root:r,r.emit=Ci.bind(null,r),e.ce&&e.ce(r);return r}(e,o,i);if(Kn(e)&&(a.ctx.renderer=V),function(e,t=!1,n=!1){t&&cr(t);const{props:o,children:i}=e.vnode,r=pr(e);Yo(e,o,r,t),ri(e,i,n);const s=r?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Co);const{setup:o}=n;if(o){const n=e.setupContext=o.length>1?function(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,vr),slots:e.slots,emit:e.emit,expose:t}}(e):null,i=ur(e);tt();const r=wn(o,e,0,[e.props,n]);if(nt(),i(),de(r)){if(r.then(dr,dr),t)return r.then((n=>{mr(e,n,t)})).catch((t=>{xn(t,e,0)}));e.asyncDep=r}else mr(e,r,t)}else gr(e,t)}(e,t):void 0;t&&cr(!1)}(a,!1,s),a.asyncDep){if(i&&i.registerDep(a,T,s),!e.el){const e=a.subTree=Ki(Di);m(null,e,t,n)}}else T(a,e,t,n,i,r,s)},L=(e,t,n)=>{const o=t.component=e.component;if(function(e,t,n){const{props:o,children:i,component:r}=e,{props:s,children:a,patchFlag:l}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!i&&!a||a&&a.$stable)||o!==s&&(o?!s||Ni(o,s,c):!!s);if(1024&l)return!0;if(16&l)return o?Ni(o,s,c):!!s;if(8&l){const e=t.dynamicProps;for(let t=0;tEn&&An.splice(t,1)}(o.update),o.effect.dirty=!0,o.update()}else t.el=e.el,o.vnode=t},T=(e,t,n,o,i,r,s)=>{const a=()=>{if(e.isMounted){let{next:t,bu:n,u:o,parent:l,vnode:u}=e;{const n=hi(e);if(n)return t&&(t.el=u.el,N(e,t,s)),void n.asyncDep.then((()=>{e.isUnmounted||a()}))}let d,p=t;pi(e,!1),t?(t.el=u.el,N(e,t,s)):t=u,n&&Ae(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&or(d,l,t,u),pi(e,!0);const h=Oi(e),m=e.subTree;e.subTree=h,f(m,h,c(m.el),F(m),e,i,r),t.el=h.el,null===p&&function({vnode:e,parent:t},n){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.el=e.el),o!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,h.el),o&&ci(o,i),(d=t.props&&t.props.onVnodeUpdated)&&ci((()=>or(d,l,t,u)),i)}else{let s;const{el:a,props:l}=t,{bm:c,m:u,parent:d}=e,p=Zn(t);if(pi(e,!1),c&&Ae(c),!p&&(s=l&&l.onVnodeBeforeMount)&&or(s,d,t),pi(e,!0),a&&W){const n=()=>{e.subTree=Oi(e),W(a,e.subTree,e,i,null)};p?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const s=e.subTree=Oi(e);f(null,s,n,o,e,i,r),t.el=s.el}if(u&&ci(u,i),!p&&(s=l&&l.onVnodeMounted)){const e=t;ci((()=>or(s,d,e)),i)}(256&t.shapeFlag||d&&Zn(d.vnode)&&256&d.vnode.shapeFlag)&&e.a&&ci(e.a,i),e.isMounted=!0,t=n=o=null}},l=e.effect=new Ze(a,X,(()=>Dn(u)),e.scope),u=e.update=()=>{l.dirty&&l.run()};u.i=e,u.id=e.uid,pi(e,!0),u()},N=(e,t,n)=>{t.component=e;const o=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,o){const{props:i,attrs:r,vnode:{patchFlag:s}}=e,a=on(i),[l]=e.propsOptions;let c=!1;if(!(o||s>0)||16&s){let o;Zo(e,t,i,r)&&(c=!0);for(const r in a)t&&(oe(t,r)||(o=Se(r))!==r&&oe(t,o))||(l?!n||void 0===n[r]&&void 0===n[o]||(i[r]=Ko(l,a,r,void 0,e,!0)):delete i[r]);if(r!==a)for(const e in r)t&&oe(t,e)||(delete r[e],c=!0)}else if(8&s){const n=e.vnode.dynamicProps;for(let o=0;o{const u=e&&e.children,d=e?e.shapeFlag:0,p=t.children,{patchFlag:f,shapeFlag:h}=t;if(f>0){if(128&f)return void D(u,p,n,o,i,r,s,a,c);if(256&f)return void P(u,p,n,o,i,r,s,a,c)}8&h?(16&d&&B(u,i,r),p!==u&&l(n,p)):16&d?16&h?D(u,p,n,o,i,r,s,a,c):B(u,i,r,!0):(8&d&&l(n,""),16&h&&S(p,n,o,i,r,s,a,c))},P=(e,t,n,o,i,r,s,a,l)=>{t=t||K;const c=(e=e||K).length,u=t.length,d=Math.min(c,u);let p;for(p=0;pu?B(e,i,r,!0,!1,d):S(t,n,o,i,r,s,a,l,d)},D=(e,t,n,o,i,r,s,a,l)=>{let c=0;const u=t.length;let d=e.length-1,p=u-1;for(;c<=d&&c<=p;){const o=e[c],u=t[c]=l?er(t[c]):qi(t[c]);if(!Hi(o,u))break;f(o,u,n,null,i,r,s,a,l),c++}for(;c<=d&&c<=p;){const o=e[d],c=t[p]=l?er(t[p]):qi(t[p]);if(!Hi(o,c))break;f(o,c,n,null,i,r,s,a,l),d--,p--}if(c>d){if(c<=p){const e=p+1,d=ep)for(;c<=d;)M(e[c],i,r,!0),c++;else{const h=c,m=c,g=new Map;for(c=m;c<=p;c++){const e=t[c]=l?er(t[c]):qi(t[c]);null!=e.key&&g.set(e.key,c)}let v,y=0;const b=p-m+1;let _=!1,w=0;const S=new Array(b);for(c=0;c=b){M(o,i,r,!0);continue}let u;if(null!=o.key)u=g.get(o.key);else for(v=m;v<=p;v++)if(0===S[v-m]&&Hi(o,t[v])){u=v;break}void 0===u?M(o,i,r,!0):(S[u-m]=c+1,u>=w?w=u:_=!0,f(o,t[u],n,null,i,r,s,a,l),y++)}const x=_?function(e){const t=e.slice(),n=[0];let o,i,r,s,a;const l=e.length;for(o=0;o>1,e[n[a]]0&&(t[o]=n[r-1]),n[r]=o)}}r=n.length,s=n[r-1];for(;r-- >0;)n[r]=s,s=t[s];return n}(S):K;for(v=x.length-1,c=b-1;c>=0;c--){const e=m+c,d=t[e],p=e+1{const{el:s,type:a,transition:l,children:c,shapeFlag:u}=e;if(6&u)return void j(e.component.subTree,n,o,i);if(128&u)return void e.suspense.move(n,o,i);if(64&u)return void a.move(e,n,o,V);if(a===Ii){t(s,n,o);for(let e=0;el.enter(s)),r);else{const{leave:e,delayLeave:i,afterLeave:r}=l,a=()=>t(s,n,o),c=()=>{e(s,(()=>{a(),r&&r()}))};i?i(s,a,c):c()}else t(s,n,o)},M=(e,t,n,o=!1,i=!1)=>{const{type:r,props:s,ref:a,children:l,dynamicChildren:c,shapeFlag:u,patchFlag:d,dirs:p,cacheIndex:f}=e;if(-2===d&&(i=!1),null!=a&&ai(a,null,n,e,!0),null!=f&&(t.renderCache[f]=void 0),256&u)return void t.ctx.deactivate(e);const h=1&u&&p,m=!Zn(e);let g;if(m&&(g=s&&s.onVnodeBeforeUnmount)&&or(g,t,e),6&u)G(e.component,n,o);else{if(128&u)return void e.suspense.unmount(n,o);h&&Wn(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,V,o):c&&!c.hasOnce&&(r!==Ii||d>0&&64&d)?B(c,t,n,!1,!0):(r===Ii&&384&d||!i&&16&u)&&B(l,t,n),o&&R(e)}(m&&(g=s&&s.onVnodeUnmounted)||h)&&ci((()=>{g&&or(g,t,e),h&&Wn(e,null,t,"unmounted")}),n)},R=e=>{const{type:t,el:o,anchor:i,transition:r}=e;if(t===Ii)return void $(o,i);if(t===ji)return void y(e);const s=()=>{n(o),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){const{leave:t,delayLeave:n}=r,i=()=>t(o,s);n?n(e.el,s,i):i()}else s()},$=(e,t)=>{let o;for(;e!==t;)o=u(e),n(e),e=o;n(t)},G=(e,t,n)=>{const{bum:o,scope:i,update:r,subTree:s,um:a,m:l,a:c}=e;mi(l),mi(c),o&&Ae(o),i.stop(),r&&(r.active=!1,M(s,e,t,n)),a&&ci(a,t),ci((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},B=(e,t,n,o=!1,i=!1,r=0)=>{for(let s=r;s{if(6&e.shapeFlag)return F(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=u(e.anchor||e.el),n=t&&t[li];return n?u(n):t};let U=!1;const z=(e,t,n)=>{null==e?t._vnode&&M(t._vnode,null,null,!0):f(t._vnode||null,e,t,null,null,null,n),U||(U=!0,Mn(),Rn(),U=!1),t._vnode=e},V={p:f,um:M,m:j,r:R,mt:O,mc:S,pc:I,pbc:k,n:F,o:e};let H,W;return{render:z,hydrate:H,createApp:Fo(z,H)}}(e)}function di({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function pi({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function fi(e,t,n=!1){const o=e.children,i=t.children;if(ie(o)&&ie(i))for(let r=0;rzo(gi),yi={};function bi(e,t,n){return _i(e,t,n)}function _i(e,t,{immediate:n,deep:o,flush:i,once:r,onTrack:s,onTrigger:a}=Z){if(t&&r){const e=t;t=(...t)=>{e(...t),w()}}const l=sr,c=e=>!0===o?e:xi(e,!1===o?1:void 0);let u,d,p=!1,f=!1;if(dn(e)?(u=()=>e.value,p=tn(e)):qt(e)?(u=()=>c(e),p=!0):ie(e)?(f=!0,p=e.some((e=>qt(e)||tn(e))),u=()=>e.map((e=>dn(e)?e.value:qt(e)?c(e):ae(e)?wn(e,l,2):void 0))):u=ae(e)?t?()=>wn(e,l,2):()=>(d&&d(),Sn(e,l,3,[m])):X,t&&o){const e=u;u=()=>xi(e())}let h,m=e=>{d=b.onStop=()=>{wn(e,l,4),d=b.onStop=void 0}};if(hr){if(m=X,t?n&&Sn(t,l,3,[u(),f?[]:void 0,m]):u(),"sync"!==i)return X;{const e=vi();h=e.__watcherHandles||(e.__watcherHandles=[])}}let g=f?new Array(e.length).fill(yi):yi;const v=()=>{if(b.active&&b.dirty)if(t){const e=b.run();(o||p||(f?e.some(((e,t)=>Ce(e,g[t]))):Ce(e,g)))&&(d&&d(),Sn(t,l,3,[e,g===yi?void 0:f&&g[0]===yi?[]:g,m]),g=e)}else b.run()};let y;v.allowRecurse=!!t,"sync"===i?y=v:"post"===i?y=()=>ci(v,l&&l.suspense):(v.pre=!0,l&&(v.id=l.uid),y=()=>Dn(v));const b=new Ze(u,X,y),_=Ye(),w=()=>{b.stop(),_&&te(_.effects,b)};return t?n?v():g=b.run():"post"===i?ci(b.run.bind(b),l&&l.suspense):b.run(),h&&h.push(w),w}function wi(e,t,n){const o=this.proxy,i=le(e)?e.includes(".")?Si(o,e):()=>o[e]:e.bind(o,o);let r;ae(t)?r=t:(r=t.handler,n=t);const s=ur(this),a=_i(i,r.bind(o),n);return s(),a}function Si(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{xi(e,t,n)}));else if(me(e)){for(const o in e)xi(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&xi(e[o],t,n)}return e}const ki=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${_e(t)}Modifiers`]||e[`${Se(t)}Modifiers`];function Ci(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Z;let i=n;const r=t.startsWith("update:"),s=r&&ki(o,t.slice(7));let a;s&&(s.trim&&(i=n.map((e=>le(e)?e.trim():e))),s.number&&(i=n.map(Oe)));let l=o[a=ke(t)]||o[a=ke(_e(t))];!l&&r&&(l=o[a=ke(Se(t))]),l&&Sn(l,e,6,i);const c=o[a+"Once"];if(c){if(e.emitted){if(e.emitted[a])return}else e.emitted={};e.emitted[a]=!0,Sn(c,e,6,i)}}function Ai(e,t,n=!1){const o=t.emitsCache,i=o.get(e);if(void 0!==i)return i;const r=e.emits;let s={},a=!1;if(!ae(e)){const o=e=>{const n=Ai(e,t,!0);n&&(a=!0,ee(s,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return r||a?(ie(r)?r.forEach((e=>s[e]=null)):ee(s,r),ue(e)&&o.set(e,s),s):(ue(e)&&o.set(e,null),null)}function Ei(e,t){return!(!e||!J(t))&&(t=t.slice(2).replace(/Once$/,""),oe(e,t[0].toLowerCase()+t.slice(1))||oe(e,Se(t))||oe(e,t))}function Oi(e){const{type:t,vnode:n,proxy:o,withProxy:i,propsOptions:[r],slots:s,attrs:a,emit:l,render:c,renderCache:u,props:d,data:p,setupState:f,ctx:h,inheritAttrs:m}=e,g=zn(e);let v,y;try{if(4&n.shapeFlag){const e=i||o,t=e;v=qi(c.call(t,e,u,d,f,p,h)),y=a}else{const e=t;0,v=qi(e.length>1?e(d,{attrs:a,slots:s,emit:l}):e(d,null)),y=t.props?a:Li(a)}}catch(_){Mi.length=0,xn(_,e,1),v=Ki(Di)}let b=v;if(y&&!1!==m){const e=Object.keys(y),{shapeFlag:t}=b;e.length&&7&t&&(r&&e.some(q)&&(y=Ti(y,r)),b=Xi(b,y,!1,!0))}return n.dirs&&(b=Xi(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&(b.transition=n.transition),v=b,zn(g),v}const Li=e=>{let t;for(const n in e)("class"===n||"style"===n||J(n))&&((t||(t={}))[n]=e[n]);return t},Ti=(e,t)=>{const n={};for(const o in e)q(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function Ni(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let i=0;i0?Ri||K:null,Mi.pop(),Ri=Mi[Mi.length-1]||null,Gi>0&&Ri&&Ri.push(e),e}function Ui(e,t,n,o,i,r){return Fi(Zi(e,t,n,o,i,r,!0))}function zi(e,t,n,o,i){return Fi(Ki(e,t,n,o,i,!0))}function Vi(e){return!!e&&!0===e.__v_isVNode}function Hi(e,t){return e.type===t.type&&e.key===t.key}const Wi=({key:e})=>null!=e?e:null,Yi=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?le(e)||dn(e)||ae(e)?{i:Fn,r:e,k:t,f:!!n}:e:null);function Zi(e,t=null,n=null,o=0,i=null,r=(e===Ii?0:1),s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Wi(t),ref:t&&Yi(t),scopeId:Un,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:o,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Fn};return a?(tr(l,n),128&r&&e.normalize(l)):n&&(l.shapeFlag|=le(n)?8:16),Gi>0&&!s&&Ri&&(l.patchFlag>0||6&r)&&32!==l.patchFlag&&Ri.push(l),l}const Ki=function(e,t=null,n=null,o=0,i=null,r=!1){e&&e!==go||(e=Di);if(Vi(e)){const o=Xi(e,t,!0);return n&&tr(o,n),Gi>0&&!r&&Ri&&(6&o.shapeFlag?Ri[Ri.indexOf(e)]=o:Ri.push(o)),o.patchFlag=-2,o}s=e,ae(s)&&"__vccOpts"in s&&(e=e.__vccOpts);var s;if(t){t=function(e){return e?nn(e)||Wo(e)?ee({},e):e:null}(t);let{class:e,style:n}=t;e&&!le(e)&&(t.class=Me(e)),ue(n)&&(nn(n)&&!ie(n)&&(n=ee({},n)),t.style=Ne(n))}const a=le(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:ue(e)?4:ae(e)?2:0;return Zi(e,t,n,o,i,a,r,!0)};function Xi(e,t,n=!1,o=!1){const{props:i,ref:r,patchFlag:s,children:a,transition:l}=e,c=t?nr(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Wi(c),ref:t&&t.ref?n&&r?ie(r)?r.concat(Yi(t)):[r,Yi(t)]:Yi(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ii?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Xi(e.ssContent),ssFallback:e.ssFallback&&Xi(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&o&&Yn(u,l.clone(u)),u}function Qi(e=" ",t=0){return Ki(Pi,null,e,t)}function Ji(e="",t=!1){return t?($i(),zi(Di,null,e)):Ki(Di,null,e)}function qi(e){return null==e||"boolean"==typeof e?Ki(Di):ie(e)?Ki(Ii,null,e.slice()):"object"==typeof e?er(e):Ki(Pi,null,String(e))}function er(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Xi(e)}function tr(e,t){let n=0;const{shapeFlag:o}=e;if(null==t)t=null;else if(ie(t))n=16;else if("object"==typeof t){if(65&o){const n=t.default;return void(n&&(n._c&&(n._d=!1),tr(e,n()),n._c&&(n._d=!0)))}{n=32;const o=t._;o||Wo(t)?3===o&&Fn&&(1===Fn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=Fn}}else ae(t)?(t={default:t,_ctx:Fn},n=32):(t=String(t),64&o?(n=16,t=[Qi(t)]):n=8);e.children=t,e.shapeFlag|=n}function nr(...e){const t={};for(let n=0;nsr||Fn;let lr,cr;{const e=Te(),t=(t,n)=>{let o;return(o=e[t])||(o=e[t]=[]),o.push(n),e=>{o.length>1?o.forEach((t=>t(e))):o[0](e)}};lr=t("__VUE_INSTANCE_SETTERS__",(e=>sr=e)),cr=t("__VUE_SSR_SETTERS__",(e=>hr=e))}const ur=e=>{const t=sr;return lr(e),e.scope.on(),()=>{e.scope.off(),lr(t)}},dr=()=>{sr&&sr.scope.off(),lr(null)};function pr(e){return 4&e.vnode.shapeFlag}let fr,hr=!1;function mr(e,t,n){ae(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ue(t)&&(e.setupState=gn(t)),gr(e,n)}function gr(e,t,n){const o=e.type;if(!e.render){if(!t&&fr&&!o.render){const t=o.template||No(e).template;if(t){const{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:r,compilerOptions:s}=o,a=ee(ee({isCustomElement:n,delimiters:r},i),s);o.render=fr(t,a)}}e.render=o.render||X}{const t=ur(e);tt();try{Oo(e)}finally{nt(),t()}}}const vr={get:(e,t)=>(pt(e,0,""),e[t])};function yr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(gn(rn(e.exposed)),{get:(t,n)=>n in t?t[n]:n in xo?xo[n](e):void 0,has:(e,t)=>t in e||t in xo})):e.proxy}function br(e,t=!0){return ae(e)?e.displayName||e.name:e.name||t&&e.__name}const _r=(e,t)=>{const n=function(e,t,n=!1){let o,i;const r=ae(e);return r?(o=e,i=X):(o=e.get,i=e.set),new ln(o,i,r||!i,n)}(e,0,hr);return n};const wr="3.4.36",Sr="undefined"!=typeof document?document:null,xr=Sr&&Sr.createElement("template"),kr={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const i="svg"===t?Sr.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?Sr.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?Sr.createElement(e,{is:n}):Sr.createElement(e);return"select"===e&&o&&null!=o.multiple&&i.setAttribute("multiple",o.multiple),i},createText:e=>Sr.createTextNode(e),createComment:e=>Sr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Sr.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,i,r){const s=n?n.previousSibling:t.lastChild;if(i&&(i===r||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==r&&(i=i.nextSibling););else{xr.innerHTML="svg"===o?`${e}`:"mathml"===o?`${e}`:e;const i=xr.content;if("svg"===o||"mathml"===o){const e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Cr=Symbol("_vtc"); /** * @vue/runtime-dom v3.4.36 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const Ar=Symbol("_vod"),Er=Symbol("_vsh"),Or=Symbol(""),Lr=/(^|;)\s*display\s*:/;const Tr=/\s*!important$/;function Ir(e,t,n){if(ie(n))n.forEach((n=>Ir(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=Pr[t];if(n)return n;let o=_e(t);if("filter"!==o&&o in e)return Pr[t]=o;o=xe(o);for(let i=0;i{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();Sn(function(e,t){if(ie(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Ur(),n}(o,i);Mr(e,n,s,a)}else s&&(!function(e,t,n,o){e.removeEventListener(t,n,o)}(e,n,s,a),r[t]=void 0)}}const Gr=/(?:Once|Passive|Capture)$/;let Br=0;const Fr=Promise.resolve(),Ur=()=>Br||(Fr.then((()=>Br=0)),Br=Date.now());const zr=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;const Vr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ie(t)?e=>Ae(t,e):t};function Hr(e){e.target.composing=!0}function Wr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Yr=Symbol("_assign"),Zr={created(e,{modifiers:{lazy:t,trim:n,number:o}},i){e[Yr]=Vr(i);const r=o||i.props&&"number"===i.props.type;Mr(e,t?"change":"input",(t=>{if(t.target.composing)return;let o=e.value;n&&(o=o.trim()),r&&(o=Oe(o)),e[Yr](o)})),n&&Mr(e,"change",(()=>{e.value=e.value.trim()})),t||(Mr(e,"compositionstart",Hr),Mr(e,"compositionend",Wr),Mr(e,"change",Wr))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:i,number:r}},s){if(e[Yr]=Vr(s),e.composing)return;const a=null==t?"":t;if((!r&&"number"!==e.type||/^0\d/.test(e.value)?e.value:Oe(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(o&&t===n)return;if(i&&e.value.trim()===a)return}e.value=a}}},Kr=["ctrl","shift","alt","meta"],Xr={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Kr.some((n=>e[`${n}Key`]&&!t.includes(n)))},Qr=(e,t)=>{const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(n,...o)=>{for(let e=0;e{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=n=>{if(!("key"in n))return;const o=Se(n.key);return t.some((e=>e===o||Jr[e]===o))?e(n):void 0})},es=ee({patchProp:(e,t,n,o,i,r)=>{const s="svg"===i;"class"===t?function(e,t,n){const o=e[Cr];o&&(t=(t?[t,...o]:[...o]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,o,s):"style"===t?function(e,t,n){const o=e.style,i=le(n);let r=!1;if(n&&!i){if(t)if(le(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&Ir(o,t,"")}else for(const e in t)null==n[e]&&Ir(o,e,"");for(const e in n)"display"===e&&(r=!0),Ir(o,e,n[e])}else if(i){if(t!==n){const e=o[Or];e&&(n+=";"+e),o.cssText=n,r=Lr.test(n)}}else t&&e.removeAttribute("style");Ar in e&&(e[Ar]=r?o.display:"",e[Er]&&(o.display="none"))}(e,n,o):J(t)?q(t)||$r(e,t,0,o,r):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,o){if(o)return"innerHTML"===t||"textContent"===t||!!(t in e&&zr(t)&&ae(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}if(zr(t)&&le(n))return!1;return t in e}(e,t,o,s))?(!function(e,t,n){if("innerHTML"===t||"textContent"===t){if(null==n)return;return void(e[t]=n)}const o=e.tagName;if("value"===t&&"PROGRESS"!==o&&!o.includes("-")){const i="OPTION"===o?e.getAttribute("value")||"":e.value,r=null==n?"":String(n);return i===r&&"_value"in e||(e.value=r),null==n&&e.removeAttribute(t),void(e._value=n)}let i=!1;if(""===n||null==n){const o=typeof e[t];"boolean"===o?n=$e(n):null==n&&"string"===o?(n="",i=!0):"number"===o&&(n=0,i=!0)}try{e[t]=n}catch(r){}i&&e.removeAttribute(t)}(e,t,o),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||jr(e,t,o,s,0,"value"!==t)):("true-value"===t?e._trueValue=o:"false-value"===t&&(e._falseValue=o),jr(e,t,o,s))}},kr);let ts;function ns(){return ts||(ts=ui(es))} +**/const Ar=Symbol("_vod"),Er=Symbol("_vsh"),Or=Symbol(""),Lr=/(^|;)\s*display\s*:/;const Tr=/\s*!important$/;function Nr(e,t,n){if(ie(n))n.forEach((n=>Nr(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=Pr[t];if(n)return n;let o=_e(t);if("filter"!==o&&o in e)return Pr[t]=o;o=xe(o);for(let i=0;i{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();Sn(function(e,t){if(ie(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Ur(),n}(o,i);Mr(e,n,s,a)}else s&&(!function(e,t,n,o){e.removeEventListener(t,n,o)}(e,n,s,a),r[t]=void 0)}}const Gr=/(?:Once|Passive|Capture)$/;let Br=0;const Fr=Promise.resolve(),Ur=()=>Br||(Fr.then((()=>Br=0)),Br=Date.now());const zr=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;const Vr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ie(t)?e=>Ae(t,e):t};function Hr(e){e.target.composing=!0}function Wr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Yr=Symbol("_assign"),Zr={created(e,{modifiers:{lazy:t,trim:n,number:o}},i){e[Yr]=Vr(i);const r=o||i.props&&"number"===i.props.type;Mr(e,t?"change":"input",(t=>{if(t.target.composing)return;let o=e.value;n&&(o=o.trim()),r&&(o=Oe(o)),e[Yr](o)})),n&&Mr(e,"change",(()=>{e.value=e.value.trim()})),t||(Mr(e,"compositionstart",Hr),Mr(e,"compositionend",Wr),Mr(e,"change",Wr))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:i,number:r}},s){if(e[Yr]=Vr(s),e.composing)return;const a=null==t?"":t;if((!r&&"number"!==e.type||/^0\d/.test(e.value)?e.value:Oe(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(o&&t===n)return;if(i&&e.value.trim()===a)return}e.value=a}}},Kr=["ctrl","shift","alt","meta"],Xr={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Kr.some((n=>e[`${n}Key`]&&!t.includes(n)))},Qr=(e,t)=>{const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(n,...o)=>{for(let e=0;e{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=n=>{if(!("key"in n))return;const o=Se(n.key);return t.some((e=>e===o||Jr[e]===o))?e(n):void 0})},es=ee({patchProp:(e,t,n,o,i,r)=>{const s="svg"===i;"class"===t?function(e,t,n){const o=e[Cr];o&&(t=(t?[t,...o]:[...o]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,o,s):"style"===t?function(e,t,n){const o=e.style,i=le(n);let r=!1;if(n&&!i){if(t)if(le(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&Nr(o,t,"")}else for(const e in t)null==n[e]&&Nr(o,e,"");for(const e in n)"display"===e&&(r=!0),Nr(o,e,n[e])}else if(i){if(t!==n){const e=o[Or];e&&(n+=";"+e),o.cssText=n,r=Lr.test(n)}}else t&&e.removeAttribute("style");Ar in e&&(e[Ar]=r?o.display:"",e[Er]&&(o.display="none"))}(e,n,o):J(t)?q(t)||$r(e,t,0,o,r):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,o){if(o)return"innerHTML"===t||"textContent"===t||!!(t in e&&zr(t)&&ae(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}if(zr(t)&&le(n))return!1;return t in e}(e,t,o,s))?(!function(e,t,n){if("innerHTML"===t||"textContent"===t){if(null==n)return;return void(e[t]=n)}const o=e.tagName;if("value"===t&&"PROGRESS"!==o&&!o.includes("-")){const i="OPTION"===o?e.getAttribute("value")||"":e.value,r=null==n?"":String(n);return i===r&&"_value"in e||(e.value=r),null==n&&e.removeAttribute(t),void(e._value=n)}let i=!1;if(""===n||null==n){const o=typeof e[t];"boolean"===o?n=$e(n):null==n&&"string"===o?(n="",i=!0):"number"===o&&(n=0,i=!0)}try{e[t]=n}catch(r){}i&&e.removeAttribute(t)}(e,t,o),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||jr(e,t,o,s,0,"value"!==t)):("true-value"===t?e._trueValue=o:"false-value"===t&&(e._falseValue=o),jr(e,t,o,s))}},kr);let ts;function ns(){return ts||(ts=ui(es))} /*! * pinia v2.2.1 * (c) 2024 Eduardo San Martin Morote * @license MIT */ -let os;const is=e=>os=e,rs=Symbol();function ss(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var as,ls;(ls=as||(as={})).direct="direct",ls.patchObject="patch object",ls.patchFunction="patch function";const cs=()=>{};function us(e,t,n,o=cs){e.push(t);const i=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),o())};var r;return!n&&Ye()&&(r=i,ze&&ze.cleanups.push(r)),i}function ds(e,...t){e.slice().forEach((e=>{e(...t)}))}const ps=e=>e(),fs=Symbol(),hs=Symbol();function ms(e,t){e instanceof Map&&t instanceof Map?t.forEach(((t,n)=>e.set(n,t))):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const o=t[n],i=e[n];ss(i)&&ss(o)&&e.hasOwnProperty(n)&&!dn(o)&&!qt(o)?e[n]=ms(i,o):e[n]=o}return e}const gs=Symbol();const{assign:vs}=Object;function ys(e,t,n,o){const{state:i,actions:r,getters:s}=t,a=n.state.value[e];let l;return l=bs(e,(function(){a||(n.state.value[e]=i?i():{});const t=function(e){const t=ie(e)?new Array(e.length):{};for(const n in e)t[n]=_n(e,n);return t}(n.state.value[e]);return vs(t,r,Object.keys(s||{}).reduce(((t,o)=>(t[o]=rn(_r((()=>{is(n);const t=n._s.get(e);return s[o].call(t,t)}))),t)),{}))}),t,n,o,!0),l}function bs(e,t,n={},o,i,r){let s;const a=vs({actions:{}},n),l={deep:!0};let c,u,d,p=[],f=[];const h=o.state.value[e];let m;function g(t){let n;c=u=!1,"function"==typeof t?(t(o.state.value[e]),n={type:as.patchFunction,storeId:e,events:d}):(ms(o.state.value[e],t),n={type:as.patchObject,payload:t,storeId:e,events:d});const i=m=Symbol();Pn().then((()=>{m===i&&(c=!0)})),u=!0,ds(p,n,o.state.value[e])}r||h||(o.state.value[e]={}),pn({});const v=r?function(){const{state:e}=n,t=e?e():{};this.$patch((e=>{vs(e,t)}))}:cs;const y=(t,n="")=>{if(fs in t)return t[hs]=n,t;const i=function(){is(o);const n=Array.from(arguments),r=[],s=[];let a;ds(f,{args:n,name:i[hs],store:b,after:function(e){r.push(e)},onError:function(e){s.push(e)}});try{a=t.apply(this&&this.$id===e?this:b,n)}catch(l){throw ds(s,l),l}return a instanceof Promise?a.then((e=>(ds(r,e),e))).catch((e=>(ds(s,e),Promise.reject(e)))):(ds(r,a),a)};return i[fs]=!0,i[hs]=n,i},b=Xt({_p:o,$id:e,$onAction:us.bind(null,f),$patch:g,$reset:v,$subscribe(t,n={}){const i=us(p,t,n.detached,(()=>r())),r=s.run((()=>bi((()=>o.state.value[e]),(o=>{("sync"===n.flush?u:c)&&t({storeId:e,type:as.direct,events:d},o)}),vs({},l,n))));return i},$dispose:function(){s.stop(),p=[],f=[],o._s.delete(e)}});o._s.set(e,b);const _=(o._a&&o._a.runWithContext||ps)((()=>o._e.run((()=>(s=We()).run((()=>t({action:y})))))));for(const x in _){const t=_[x];if(dn(t)&&(!dn(S=t)||!S.effect)||qt(t))r||(!h||ss(w=t)&&w.hasOwnProperty(gs)||(dn(t)?t.value=h[x]:ms(t,h[x])),o.state.value[e][x]=t);else if("function"==typeof t){const e=y(t,x);_[x]=e,a.actions[x]=t}}var w,S;return vs(b,_),vs(on(b),_),Object.defineProperty(b,"$state",{get:()=>o.state.value[e],set:e=>{g((t=>{vs(t,e)}))}}),o._p.forEach((e=>{vs(b,s.run((()=>e({store:b,app:o._a,pinia:o,options:a}))))})),h&&r&&n.hydrate&&n.hydrate(b.$state,h),c=!0,u=!0,b}function _s(e,t,n){let o,i;const r="function"==typeof t;function s(e,n){(e=e||(!!(sr||Fn||Uo)?zo(rs,null):null))&&is(e),(e=os)._s.has(o)||(r?bs(o,t,i,e):ys(o,i,e));return e._s.get(o)}return"string"==typeof e?(o=e,i=r?n:t):(i=e,o=e.id),s.$id=o,s}function ws(e){{e=on(e);const t={};for(const n in e){const o=e[n];(dn(o)||qt(o))&&(t[n]=bn(e,n))}return t}}var Ss="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ks=function(){this.__data__=[],this.size=0};var Cs=function(e,t){return e===t||e!=e&&t!=t},As=Cs;var Es=function(e,t){for(var n=e.length;n--;)if(As(e[n][0],t))return n;return-1},Os=Es,Ls=Array.prototype.splice;var Ts=Es;var Is=Es;var Ns=Es;var Ps=ks,Ds=function(e){var t=this.__data__,n=Os(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ls.call(t,n,1),--this.size,!0)},js=function(e){var t=this.__data__,n=Ts(t,e);return n<0?void 0:t[n][1]},Ms=function(e){return Is(this.__data__,e)>-1},Rs=function(e,t){var n=this.__data__,o=Ns(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this};function $s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},ec=sa,tc=ql,nc=Il,oc={};oc["[object Float32Array]"]=oc["[object Float64Array]"]=oc["[object Int8Array]"]=oc["[object Int16Array]"]=oc["[object Int32Array]"]=oc["[object Uint8Array]"]=oc["[object Uint8ClampedArray]"]=oc["[object Uint16Array]"]=oc["[object Uint32Array]"]=!0,oc["[object Arguments]"]=oc["[object Array]"]=oc["[object ArrayBuffer]"]=oc["[object Boolean]"]=oc["[object DataView]"]=oc["[object Date]"]=oc["[object Error]"]=oc["[object Function]"]=oc["[object Map]"]=oc["[object Number]"]=oc["[object Object]"]=oc["[object RegExp]"]=oc["[object Set]"]=oc["[object String]"]=oc["[object WeakMap]"]=!1;var ic=function(e){return nc(e)&&tc(e.length)&&!!oc[ec(e)]};var rc=function(e){return function(t){return e(t)}},sc={exports:{}};!function(e,t){var n=Hs,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,r=i&&i.exports===o&&n.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||r&&r.binding&&r.binding("util")}catch(t){}}();e.exports=s}(sc,sc.exports);var ac=sc.exports,lc=ic,cc=rc,uc=ac&&ac.isTypedArray,dc=uc?cc(uc):lc,pc=Tl,fc=Yl,hc=Zl,mc=Xl,gc=Jl,vc=dc,yc=Object.prototype.hasOwnProperty;var bc=function(e,t){var n=hc(e),o=!n&&fc(e),i=!n&&!o&&mc(e),r=!n&&!o&&!i&&vc(e),s=n||o||i||r,a=s?pc(e.length,String):[],l=a.length;for(var c in e)!t&&!yc.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||gc(c,l))||a.push(c);return a},_c=Object.prototype;var wc=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_c)};var Sc=function(e,t){return function(n){return e(t(n))}},xc=Sc(Object.keys,Object),kc=wc,Cc=xc,Ac=Object.prototype.hasOwnProperty;var Ec=da,Oc=ql;var Lc=function(e){return null!=e&&Oc(e.length)&&!Ec(e)},Tc=bc,Ic=function(e){if(!kc(e))return Cc(e);var t=[];for(var n in Object(e))Ac.call(e,n)&&"constructor"!=n&&t.push(n);return t},Nc=Lc;var Pc=function(e){return Nc(e)?Tc(e):Ic(e)},Dc=Ll,jc=Pc;var Mc=function(e,t){return e&&Dc(t,jc(t),e)};var Rc=aa,$c=wc,Gc=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Bc=Object.prototype.hasOwnProperty;var Fc=bc,Uc=function(e){if(!Rc(e))return Gc(e);var t=$c(e),n=[];for(var o in e)("constructor"!=o||!t&&Bc.call(e,o))&&n.push(o);return n},zc=Lc;var Vc=function(e){return zc(e)?Fc(e,!0):Uc(e)},Hc=Ll,Wc=Vc;var Yc=function(e,t){return e&&Hc(t,Wc(t),e)},Zc={exports:{}};!function(e,t){var n=Zs,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,r=i&&i.exports===o?n.Buffer:void 0,s=r?r.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,o=s?s(n):new e.constructor(n);return e.copy(o),o}}(Zc,Zc.exports);var Kc=Zc.exports;var Xc=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n({groups:[],nodes:[]}),getters:{groups_nodes(){var e;let t=[],n=[];if((null==(e=this.nodes)?void 0:e.length)>0){this.nodes.map((e=>{let o=e.pos,i=!1;for(let n=0;nr.pos[0]&&o[0]r.pos[1]&&o[1]e.pos[0]-t.pos[0])).sort(((e,t)=>e.pos[1]-t.pos[1])))},setNodes(e){this.nodes=tp(e)},update(){y.extensionManager.activeSidebarTab===M&&setTimeout((e=>{this.setGroups(y.canvas.graph._groups),this.setNodes(y.canvas.graph._nodes)}),1)},watchGraph(){let e=this;this.update();const t=y.graph.onNodeAdded;y.graph.onNodeAdded=function(n){e.update();const o=n.onRemoved;return n.onRemoved=function(){return e.update(),null==o?void 0:o.apply(this,arguments)},null==t?void 0:t.apply(this,arguments)},y.canvas.onNodeMoved=function(t){e.update()};const n=LGraphCanvas.onNodeAlign;LGraphCanvas.onNodeAlign=function(t){return e.update(),null==n?void 0:n.apply(this,arguments)};const o=LGraphCanvas.onGroupAdd;LGraphCanvas.onGroupAdd=function(){return e.update(),null==o?void 0:o.apply(this,arguments)};const i=LGraphCanvas.onGroupAlign;LGraphCanvas.onGroupAlign=function(t){return e.update(),null==i?void 0:i.apply(this,arguments)};const r=LGraphCanvas.onMenuNodeRemove;LGraphCanvas.onMenuNodeRemove=function(t){return e.update(),null==r?void 0:r.apply(this,arguments)}}}});let op=null;const ip=["custom_obsidian","custom_obsidian_dark","custom_milk_white"],rp={"easy positive":"green","easy negative":"red","easy promptList":"cyan","easy promptLine":"cyan","easy promptConcat":"cyan","easy promptReplace":"cyan","easy textSwitch":"pale_blue"};let sp=LGraphCanvas.node_colors,ap=null,lp=null,cp=null,up=null;for(let by in H)dp=H[by],y.ui.settings.addSetting(dp);var dp;function pp(e,t=!1){let n="after",o="before";t&&([o,n]=[n,o]),e.label=(e.label??e.name).replace(o,n),e.name=e.label}function fp(e,t,n,o,i,r,s){t.strokeStyle=o,t.fillStyle=i;let a=LiteGraph.NODE_TITLE_HEIGHT,l=this.ds.scale<.5,c=e._shape||e.constructor.shape||LiteGraph.ROUND_SHAPE,u=e.constructor.title_mode,d=!0;u==LiteGraph.TRANSPARENT_TITLE||u==LiteGraph.NO_TITLE?d=!1:u==LiteGraph.AUTOHIDE_TITLE&&mouse_over&&(d=!0);let p=new Float32Array(4);p=[0,d?-a:0,n[0]+1,d?n[1]+a:n[1]];let f=t.globalAlpha;if(t.lineWidth=1,t.beginPath(),c==LiteGraph.BOX_SHAPE||l?t.fillRect(p[0],p[1],p[2],p[3]):c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CARD_SHAPE?t.roundRect(p[0],p[1],p[2],p[3],c==LiteGraph.CARD_SHAPE?[this.round_radius,this.round_radius,0,0]:[this.round_radius]):c==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*n[0],.5*n[1],.5*n[0],0,2*Math.PI),t.strokeStyle=LiteGraph.WIDGET_OUTLINE_COLOR,t.stroke(),t.strokeStyle=o,t.fill(),!e.flags.collapsed&&d&&(t.shadowColor="transparent",t.fillStyle="rgba(0,0,0,0.2)",t.fillRect(0,-1,p[2],2)),t.shadowColor="transparent",e.onDrawBackground&&e.onDrawBackground(t,this,this.canvas,this.graph_mouse),d||u==LiteGraph.TRANSPARENT_TITLE){const i="dark"==function(e){let t=e.replace("#","");return n=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16),.299*n+.587*o+.114*i>127.5?"light":"dark";var n,o,i}((null==e?void 0:e.color)||"#ffffff");if(e.onDrawTitleBar)e.onDrawTitleBar(t,a,n,this.ds.scale,o);else if(u!=LiteGraph.TRANSPARENT_TITLE&&(e.constructor.title_color||this.render_title_colored)){let i=e.constructor.title_color||o;if(e.flags.collapsed&&(t.shadowColor=LiteGraph.DEFAULT_SHADOW_COLOR),this.use_gradients){let e=LGraphCanvas.gradients[i];e||(e=LGraphCanvas.gradients[i]=t.createLinearGradient(0,0,400,0),e.addColorStop(0,i),e.addColorStop(1,"#000")),t.fillStyle=e}else t.fillStyle=i;t.beginPath(),c==LiteGraph.BOX_SHAPE||l?t.rect(0,-a,n[0]+1,a):c!=LiteGraph.ROUND_SHAPE&&c!=LiteGraph.CARD_SHAPE||t.roundRect(0,-a,n[0]+1,a,e.flags.collapsed?[this.round_radius]:[this.round_radius,this.round_radius,0,0]),t.fill(),t.shadowColor="transparent"}let s=!1;LiteGraph.node_box_coloured_by_mode&&LiteGraph.NODE_MODES_COLORS[e.mode]&&(s=LiteGraph.NODE_MODES_COLORS[e.mode]),LiteGraph.node_box_coloured_when_on&&(s=e.action_triggered?"#FFF":e.execute_triggered?"#AAA":s);let d=10;if(e.onDrawTitleBox)e.onDrawTitleBox(t,a,n,this.ds.scale);else if(c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CIRCLE_SHAPE||c==LiteGraph.CARD_SHAPE){const n=i?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR,o=i?"#eeeeee":e.boxcolor||s||LiteGraph.NODE_DEFAULT_BOXCOLOR;t.fillStyle=r?n:o,t.beginPath(),t.fillRect(10,0-1.05*d-1,1.1*d,.125*d),t.fillRect(10,0-1.45*d-1,1.1*d,.125*d),t.fillRect(10,0-1.85*d-1,1.1*d,.125*d)}else t.fillStyle=e.boxcolor||s||LiteGraph.NODE_DEFAULT_BOXCOLOR,t.fillRect(.5*(a-d),-.5*(a+d),d,d);if(t.globalAlpha=f,e.onDrawTitleText&&e.onDrawTitleText(t,a,n,this.ds.scale,this.title_text_font,r),!l){t.font=this.title_text_font;let n=String(e.getTitle());n&&(t.fillStyle=r?i?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR:i?"#ffffff":e.constructor.title_text_color||this.node_title_color,e.flags.collapsed?(t.textAlign="left",t.measureText(n),t.fillText(n.substr(0,20),a,LiteGraph.NODE_TITLE_TEXT_Y-a),t.textAlign="left"):(t.textAlign="left",t.fillText(n,a,LiteGraph.NODE_TITLE_TEXT_Y-a)))}if(!e.flags.collapsed&&e.subgraph&&!e.skip_subgraph_button){let n=LiteGraph.NODE_TITLE_HEIGHT,o=e.size[0]-n,i=LiteGraph.isInsideRectangle(this.graph_mouse[0]-e.pos[0],this.graph_mouse[1]-e.pos[1],o+2,2-n,n-4,n-4);t.fillStyle=i?"#888":"#555",c==LiteGraph.BOX_SHAPE||l?t.fillRect(o+2,2-n,n-4,n-4):(t.beginPath(),t.roundRect(o+2,2-n,n-4,n-4,[4]),t.fill()),t.fillStyle="#333",t.beginPath(),t.moveTo(o+.2*n,.6*-n),t.lineTo(o+.8*n,.6*-n),t.lineTo(o+.5*n,.3*-n),t.fill()}e.onDrawTitle&&e.onDrawTitle(t)}if(r){e.onBounding&&e.onBounding(p),u==LiteGraph.TRANSPARENT_TITLE&&(p[1]-=a,p[3]+=a),t.lineWidth=2,t.globalAlpha=.8,t.beginPath();let i=0,r=0,s=1;c==LiteGraph.BOX_SHAPE?t.rect(i+p[0],i+p[1],r+p[2],r+p[3]):c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CARD_SHAPE&&e.flags.collapsed?t.roundRect(i+p[0],i+p[1],r+p[2],r+p[3],[this.round_radius*s]):c==LiteGraph.CARD_SHAPE?t.roundRect(i+p[0],i+p[1],r+p[2],r+p[3],[this.round_radius*s,s,this.round_radius*s,s]):c==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*n[0],.5*n[1],.5*n[0]+6,0,2*Math.PI),t.strokeStyle=LiteGraph.NODE_BOX_OUTLINE_COLOR,t.stroke(),t.strokeStyle=o,t.globalAlpha=1}e.execute_triggered>0&&e.execute_triggered--,e.action_triggered>0&&e.action_triggered--}function hp(e,t,n,o){if(!e.widgets||!e.widgets.length)return 0;let i=e.size[0],r=e.widgets;t+=2;let s=LiteGraph.NODE_WIDGET_HEIGHT,a=this.ds.scale>.5;n.save(),n.globalAlpha=this.editor_alpha;let l=LiteGraph.WIDGET_OUTLINE_COLOR,c=LiteGraph.WIDGET_BGCOLOR,u=LiteGraph.WIDGET_TEXT_COLOR,d=LiteGraph.WIDGET_SECONDARY_TEXT_COLOR,p=12;for(let f=0;f1&&(i=1),n.fillStyle=h.options.hasOwnProperty("slider_color")?h.options.slider_color:o==h?l:I,n.beginPath(),n.roundRect(p,m,i*(g-24),s,[.25*s]),n.fill(),h.marker){let e=(h.marker-h.options.min)/t;e<0&&(e=0),e>1&&(e=1),n.fillStyle=h.options.hasOwnProperty("marker_color")?h.options.marker_color:"#AA9",n.roundRect(p+e*(g-24),m,2,s,[.25*s])}if(a){n.textAlign="center",n.fillStyle=u;let e=(h.label||h.name)+": "+Number(h.value).toFixed(null!=h.options.precision?h.options.precision:3).toString();n.fillText(e,.5*g,m+.7*s)}break;case"number":case"combo":if(n.textAlign="left",n.strokeStyle=l,n.fillStyle=c,n.beginPath(),a?n.roundRect(p,m,g-24,s,[.25*s]):n.rect(p,m,g-24,s),n.fill(),a){h.disabled||n.stroke(),n.fillStyle=u,h.disabled||(n.beginPath(),n.moveTo(24,m+6.5),n.lineTo(18,m+.5*s),n.lineTo(24,m+s-6.5),n.fill(),n.beginPath(),n.moveTo(g-p-12,m+6.5),n.lineTo(g-p-6,m+.5*s),n.lineTo(g-p-12,m+s-6.5),n.fill()),n.fillStyle=d,n.font="10px Inter",n.fillText(h.label||h.name,29,m+.7*s),n.fillStyle=u,n.textAlign="right";let e=6;if("number"==h.type)n.font="10px Inter",n.fillText(Number(h.value).toFixed(void 0!==h.options.precision?h.options.precision:3),g-24-e,m+.7*s);else{let t=h.value;if(h.options.values){let e=h.options.values;e.constructor===Function&&(e=e()),e&&e.constructor!==Array&&(t=e[h.value])}n.fillText(t,g-24-e,m+.7*s)}}break;case"string":case"text":if(n.textAlign="left",n.strokeStyle=l,n.fillStyle=c,n.beginPath(),a?n.roundRect(p,m,g-24,s,[.25*s]):n.rect(p,m,g-24,s),n.fill(),a){h.disabled||n.stroke(),n.save(),n.beginPath(),n.rect(p,m,g-24,s),n.clip(),n.fillStyle=d;const e=h.label||h.name;n.font="10px Inter",null!=e&&n.fillText(e,24,m+.7*s),n.fillStyle=u,n.textAlign="right",n.fillText(String(h.value).substr(0,30),g-24,m+.7*s),n.restore()}break;default:h.draw&&h.draw(n,e,g,m,s)}t+=(h.computeSize?h.computeSize(g)[1]:s)+4,n.globalAlpha=this.editor_alpha}n.restore(),n.textAlign="left"}function mp(e,t,n,o,i){return new LiteGraph.ContextMenu(LiteGraph.NODE_MODES,{event:n,callback:function(e){if(!i)return;var t=Object.values(LiteGraph.NODE_MODES).indexOf(e),n=function(e){t>=0&&LiteGraph.NODE_MODES[t]?e.changeMode(t):e.changeMode(LiteGraph.ALWAYS),op||(op=np()),op.update()},o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)n(i);else for(var r in o.selected_nodes)n(o.selected_nodes[r])},parentMenu:o,node:i}),!1}function gp(e,t,n,o,i){if(!i)throw"no node for color";var r=[];for(var s in r.push({value:null,content:"No color"}),LGraphCanvas.node_colors){var a=LGraphCanvas.node_colors[s];e={value:s,content:""+s+""};r.push(e)}return new LiteGraph.ContextMenu(r,{event:n,callback:function(e){if(!i)return;var t=e.value?LGraphCanvas.node_colors[e.value]:null,n=function(e){t?e.constructor===LiteGraph.LGraphGroup?e.color=t.groupcolor:(e.color=t.color,e.bgcolor=t.bgcolor):(delete e.color,delete e.bgcolor),op||(op=np()),op.update()},o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)n(i);else for(var r in o.selected_nodes)n(o.selected_nodes[r]);i.setDirtyCanvas(!0,!0)},parentMenu:o,node:i}),!1}function vp(e,t,n,o,i){var r=e.property||"title",s=i[r],a=document.createElement("div");a.is_modified=!1,a.className="graphdialog",a.innerHTML="",a.close=function(){a.parentNode&&a.parentNode.removeChild(a)},a.querySelector(".name").innerText=r;var l=a.querySelector(".value");l&&(l.value=s,l.addEventListener("blur",(function(e){this.focus()})),l.addEventListener("keydown",(function(e){if(a.is_modified=!0,27==e.keyCode)a.close();else if(13==e.keyCode)h();else if(13!=e.keyCode&&"textarea"!=e.target.localName)return;e.preventDefault(),e.stopPropagation()})));var c=LGraphCanvas.active_canvas.canvas,u=c.getBoundingClientRect(),d=-20,p=-20;u&&(d-=u.left,p-=u.top),event?(a.style.left=event.clientX+d+"px",a.style.top=event.clientY+p+"px"):(a.style.left=.5*c.width+d+"px",a.style.top=.5*c.height+p+"px"),a.querySelector("button").addEventListener("click",h),c.parentNode.appendChild(a),l&&l.focus();var f=null;function h(){l&&function(t){"Number"==e.type?t=Number(t):"Boolean"==e.type&&(t=Boolean(t));i[r]=t,a.parentNode&&a.parentNode.removeChild(a);i.setDirtyCanvas(!0,!0),op||(op=np());op.update()}(l.value)}a.addEventListener("mouseleave",(function(e){LiteGraph.dialog_close_on_mouse_leave&&!a.is_modified&&LiteGraph.dialog_close_on_mouse_leave&&(f=setTimeout(a.close,LiteGraph.dialog_close_on_mouse_leave_delay))})),a.addEventListener("mouseenter",(function(e){LiteGraph.dialog_close_on_mouse_leave&&f&&clearTimeout(f)}))}y.registerExtension({name:"Comfy.EasyUse.UI",init(){var e,t;const n="Comfy.CustomColorPalettes",o="Comfy.Settings.Comfy.CustomColorPalettes";if(lp||(lp=A(n,o)),cp||(cp=A("Comfy.ColorPalette","Comfy.Settings.Comfy.ColorPalette")||"dark"),(!(null==(e=null==lp?void 0:lp.obsidian)?void 0:e.version)||lp.obsidian.version<$.ColorPalette.version)&&(lp.obsidian=$.ColorPalette,lp.obsidian_dark=G.ColorPalette,E(n,lp,o)),(!(null==(t=null==lp?void 0:lp.milk_white)?void 0:t.version)||lp.milk_white.version{(null==e?void 0:e.value)&&(null==e?void 0:e.oldValue)&&(await W(1),Object.assign(y.canvas.default_connection_color_byType,N),Object.assign(LGraphCanvas.link_type_colors,N)),"custom_milk_white"==e.value&&document.body.classList.remove(T)})),setTimeout((e=>bp(A("Comfy.UseNewMenu")||"Disabled")),1)},async nodeCreated(e){var t;if(rp.hasOwnProperty(e.comfyClass)){const t=rp[e.comfyClass],n=sp[t];if(!n)return;n.color&&(e.color=n.color),n.bgcolor&&(e.bgcolor=n.bgcolor)}if(ap||(ap=A("Comfy.WidgetControlMode")),"before"==ap){const n="before"==ap;if((null==(t=e.widgets)?void 0:t.length)>0)for(const t of e.widgets)if(["control_before_generate","control_after_generate"].includes(t.name)&&(await pp(t,n),t.linkedWidgets))for(const e of t.linkedWidgets)await pp(e,n)}}});const yp=null==(h=y.ui.settings.settingsLookup)?void 0:h["Comfy.UseNewMenu"];yp&&(yp.onChange=e=>bp(e));const bp=e=>{var t;const n=(null==(t=document.getElementById("crystools-root"))?void 0:t.children)||null;if((null==n?void 0:n.length)>0){if(!up)for(let e=0;ee.widgets.find((e=>e.name===t)),Sp=(e,t,n=!1,o="")=>{var i;if(!t||((e,t)=>!!e.inputs&&e.inputs.some((e=>e.name===t)))(e,t.name))return;_p[t.name]||(_p[t.name]={origType:t.type,origComputeSize:t.computeSize});const r=e.size;t.type=n?_p[t.name].origType:"easyHidden"+o,t.computeSize=n?_p[t.name].origComputeSize:()=>[0,-4],null==(i=t.linkedWidgets)||i.forEach((o=>Sp(e,o,":"+t.name,n)));const s=n?Math.max(e.computeSize()[1],r[1]):e.size[1];e.setSize([e.size[0],s])},xp=(e,t=0)=>{var n,o;if(e)return(null==(n=e.widgets)?void 0:n[t])?e.widgets[t].value:e.widgets_values?null==(o=e.widgets_values)?void 0:o[t]:void 0},kp=e=>e.setSize([e.size[0],e.computeSize()[1]]),Cp=(e,t)=>graph.getNodeById(e),Ap=e=>{var t;try{return Object.values(null==(t=null==graph?void 0:graph.list_of_graphcanvas[0])?void 0:t.selected_nodes)}catch(n){return[]}};function Ep(e,t,n){return e+(o=n,(.5-.5*Math.cos(Math.PI*o))*(t-e));var o}const Op=(e,t=!0)=>{var n,o;const i=(null==(o=null==(n=e.graph)?void 0:n.list_of_graphcanvas)?void 0:o[0])||null;if(!i)return;const[r,s]=e.pos,[a,l]=e.size;(([e,t],n)=>{const o=n.ds,i=document.body.clientWidth,r=document.body.clientHeight,s=o.scale,a=.5*i/s-e,l=.5*r/s-t,c=Date.now()+250,u=o.offset[0],d=o.offset[1],p=()=>{const e=c-Date.now();if(!(Date.now(){const t=Cp(e);t&&Op(t)},Tp=(e,t=(()=>graph.links??[])())=>t[e],Ip=e=>e.toLowerCase().replace(/_./g,(e=>e.replace("_","").toUpperCase())),Np=e=>"easy getNode"===e.type,Pp=e=>"easy setNode"===e.type,Dp=e=>Np(e)||Pp(e),jp=(e=(()=>graph._nodes??[])())=>e.filter((e=>Dp(e))),Mp=(e,t,n=0)=>{e.widgets_values||(e.widgets_values=[]),e.widgets_values[n]=t,e.widgets[n].value=t},Rp=e=>graph.add(e),$p=e=>graph.remove(e),Gp=(e,t=0)=>{var n,o;if("Reroute"!==e.type)return[e,t];const i=e,r=null==(o=null==(n=i.inputs)?void 0:n[0])?void 0:o.link;if(!r)return[i,t];const s=Tp(r);if(!s)return[i,t];const a=Cp(s.origin_id);return a?(setTimeout((()=>{$p(i)})),Gp(a,s.origin_slot)):[i,t]},Bp=e=>{var t,n,o;if("Reroute"!==e.type)return e;const i=e,r=null==(n=null==(t=i.outputs)?void 0:t[0])?void 0:n.links;if(!r)return i;const s=r[0];if(!s)return i;const a=Tp(s);if(!a)return i;const l=Cp(a.target_id);return l?(1===(null==(o=i.outputs[0].links)?void 0:o.length)&&setTimeout((()=>{$p(i)})),Bp(l)):i};const Fp=new class{constructor(){v(this,"element",_(`div.${L}toast`)),v(this,"children",HTMLElement),v(this,"container",document.body),this.container.appendChild(this.element)}async show(e){let t=_(`div.${L}toast-container`,[_("div",[_("span",[...e.icon?[_("i",{className:e.icon})]:[],_("span",e.content)])])]);t.setAttribute("toast-id",e.id),this.element.replaceChildren(t),this.container.appendChild(this.element),await W(64),t.style.marginTop=`-${t.offsetHeight}px`,await W(64),t.classList.add("show"),e.duration&&(await W(e.duration),this.hide(e.id))}async hide(e){const t=document.querySelector(`.${L}toast > [toast-id="${e}"]`);(null==t?void 0:t.classList.contains("show"))&&(t.classList.remove("show"),await W(750)),t&&t.remove()}async clearAllMessages(){let e=document.querySelector(`.${L}container`);e&&(e.innerHTML="")}async info(e,t=3e3,n=[]){this.show({id:"toast-info",icon:`mdi mdi-information ${L}theme`,content:e,duration:t})}async success(e,t=3e3){this.show({id:"toast-success",icon:`mdi mdi-check-circle ${L}success`,content:e,duration:t})}async error(e,t=3e3){this.show({id:"toast-error",icon:`mdi mdi-close-circle ${L}error`,content:e,duration:t})}async warn(e,t=3e3){this.show({id:"toast-warn",icon:`mdi mdi-alert-circle ${L}warning`,content:e,duration:t})}async showLoading(e,t=0){this.show({id:"toast-loading",icon:"mdi mdi-rotate-right loading",content:e,duration:t})}async hideLoading(){this.hide("toast-loading")}},Up=["rescale_after_model","rescale","lora_name","upscale_method","image_output","add_noise","info","sampler_name","ckpt_B_name","ckpt_C_name","save_model","refiner_ckpt_name","num_loras","num_controlnet","mode","toggle","resolution","ratio","target_parameter","input_count","replace_count","downscale_mode","range_mode","text_combine_mode","input_mode","lora_count","ckpt_count","conditioning_mode","preset","use_tiled","use_batch","num_embeds","easing_mode","guider","scheduler","inpaint_mode","t5_type","rem_mode"],zp=["LIGHT - SD1.5 only (low strength)","STANDARD (medium strength)","VIT-G (medium strength)","PLUS (high strength)","PLUS FACE (portraits)","FULL FACE - SD1.5 only (portraits stronger)"],Vp=["FACEID","FACEID PLUS - SD1.5 only","FACEID PLUS V2","FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"],Hp=["easy seed","easy latentNoisy","easy wildcards","easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingSdTurbo","easy preSamplingCascade","easy preSamplingDynamicCFG","easy preSamplingLayerDiffusion","easy fullkSampler","easy fullCascadeKSampler"],Wp=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy hyditLoader","easy pixArtLoader"],Yp=["easy imageSize","easy imageSizeBySide","easy imageSizeByLongerSide","easy imageSizeShow","easy imageRatio","easy imagePixelPerfect"];function Zp(e,t){const n=e.comfyClass,o=t.value;switch(t.name){case"range_mode":Sp(e,wp(e,"step"),"step"==o),Sp(e,wp(e,"num_steps"),"num_steps"==o),kp(e);break;case"text_combine_mode":Sp(e,wp(e,"replace_text"),"replace"==o);break;case"lora_name":["lora_model_strength","lora_clip_strength"].map((t=>Sp(e,wp(e,t),"None"!==o)));break;case"resolution":"自定义 x 自定义"===o&&(t.value="width x height (custom)"),["empty_latent_width","empty_latent_height"].map((t=>Sp(e,wp(e,t),"width x height (custom)"===o)));break;case"ratio":["empty_latent_width","empty_latent_height"].map((t=>Sp(e,wp(e,t),"custom"===o)));break;case"num_loras":var i=o+1,r=wp(e,"mode").value;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));for(let t=i;t<21;t++)["lora_"+t+"_name","lora_"+t+"_strength","lora_"+t+"_model_strength","lora_"+t+"_clip_strength"].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"num_controlnet":i=o+1,r=wp(e,"mode").value;for(let t=0;tSp(e,wp(e,t),!0))),["start_percent_"+t,"end_percent_"+t].map((t=>Sp(e,wp(e,t),"simple"!==r)));for(let t=i;t<21;t++)["controlnet_"+t,"controlnet_"+t+"_strength","scale_soft_weight_"+t,"start_percent_"+t,"end_percent_"+t].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"mode":switch(null==e?void 0:e.comfyClass){case"easy loraStack":i=wp(e,"num_loras").value+1,r=o;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));kp(e);break;case"easy controlnetStack":i=wp(e,"num_controlnet").value+1,r=o;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));kp(e);break;case"easy icLightApply":r=o;["lighting","remove_bg"].map((t=>Sp(e,wp(e,t),"Foreground"===r))),Sp(e,wp(e,"source"),"Foreground"!==r),kp(e)}break;case"toggle":t.type="toggle",t.options={on:"Enabled",off:"Disabled"};break;case"t5_type":["clip_name","padding"].map((t=>Sp(e,wp(e,t),"sd3"==o))),["t5_name","device","dtype"].map((t=>Sp(e,wp(e,t),"t5v11"==o))),kp(e);break;case"preset":if(zp.includes(o)){let t=wp(e,"use_tiled");Sp(e,wp(e,"lora_strength")),Sp(e,wp(e,"provider")),Sp(e,wp(e,"weight_faceidv2")),Sp(e,wp(e,"weight_kolors")),Sp(e,wp(e,"use_tiled"),!0),Sp(e,wp(e,"sharpening"),t&&t.value)}else Vp.includes(o)&&(Sp(e,wp(e,"weight_faceidv2"),!!["FACEID PLUS V2","FACEID PLUS KOLORS"].includes(o)),Sp(e,wp(e,"weight_kolors"),!!["FACEID PLUS KOLORS"].includes(t.value)),["FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"].includes(o)?Sp(e,wp(e,"lora_strength"),!1):Sp(e,wp(e,"lora_strength"),!0),Sp(e,wp(e,"provider"),!0),Sp(e,wp(e,"use_tiled")),Sp(e,wp(e,"sharpening")));kp(e);break;case"use_tiled":Sp(e,wp(e,"sharpening"),!!o),kp(e);break;case"num_embeds":i=o+1;for(let t=0;tSp(e,wp(e,t),!1)));break;case"brushnet_random":case"brushnet_segmentation":["dtype","scale","start_at","end_at"].map((t=>Sp(e,wp(e,t),!0))),["fitting","function"].map((t=>Sp(e,wp(e,t),!1)));break;case"powerpaint":["dtype","fitting","function","scale","start_at","end_at"].map((t=>Sp(e,wp(e,t),!0)))}kp(e);break;case"image_output":Sp(e,wp(e,"link_id"),!!["Sender","Sender&Save"].includes(o)),Sp(e,wp(e,"decode_vae_name"),!!["Hide","Hide&Save"].includes(o)),["save_prefix","output_path","embed_workflow","number_padding","overwrite_existing"].map((t=>Sp(e,wp(e,t),!!["Save","Hide&Save","Sender&Save"].includes(o))));break;case"add_noise":var s=wp(e,"control_before_generate"),a=wp(e,"control_after_generate")||s;"disable"===o?(Sp(e,wp(e,"seed")),a&&(a.last_value=a.value,a.value="fixed",Sp(e,a))):(Sp(e,wp(e,"seed"),!0),a&&((null==a?void 0:a.last_value)&&(a.value=a.last_value),Sp(e,a,!0))),kp(e);break;case"guider":switch(o){case"Basic":["cfg","cfg_negative"].map((t=>Sp(e,wp(e,t))));break;case"CFG":Sp(e,wp(e,"cfg"),!0),Sp(e,wp(e,"cfg_negative"));break;case"IP2P+DualCFG":case"DualCFG":["cfg","cfg_negative"].map((t=>Sp(e,wp(e,t),!0)))}kp(e);break;case"scheduler":["karrasADV","exponentialADV","polyExponential"].includes(o)?(["sigma_max","sigma_min"].map((t=>Sp(e,wp(e,t),!0))),["denoise","beta_d","beta_min","eps_s","coeff"].map((t=>Sp(e,wp(e,t))),!1),Sp(e,wp(e,"rho"),"exponentialADV"!=o)):"vp"==o?(["sigma_max","sigma_min","denoise","rho","coeff"].map((t=>Sp(e,wp(e,t)))),["beta_d","beta_min","eps_s"].map((t=>Sp(e,wp(e,t),!0)))):(["sigma_max","sigma_min","beta_d","beta_min","eps_s","rho"].map((t=>Sp(e,wp(e,t)))),Sp(e,wp(e,"coeff"),"gits"==o),Sp(e,wp(e,"denoise"),!0)),kp(e);break;case"conditioning_mode":["replace","concat","combine"].includes(o)?["average_strength","old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t)))):"average"==o?(Sp(e,wp(e,"average_strength"),!0),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t),!1)))):"timestep"==o&&(["average_strength"].map((t=>Sp(e,wp(e,t),!1))),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t)))));break;case"rescale":wp(e,"rescale_after_model").value,Sp(e,wp(e,"width"),"to Width/Height"===o),Sp(e,wp(e,"height"),"to Width/Height"===o),Sp(e,wp(e,"percent"),"by percentage"===o),Sp(e,wp(e,"longer_side"),"to longer side - maintain aspect"===o),kp(e);break;case"upscale_method":["factor","crop"].map((t=>Sp(e,wp(e,t),"None"!==o)));break;case"target_parameter":switch(n){case"easy XYInputs: Steps":["first_step","last_step"].map((t=>Sp(e,wp(e,t),"steps"==o))),["first_start_step","last_start_step"].map((t=>Sp(e,wp(e,t),"start_at_step"==o))),["first_end_step","last_end_step"].map((t=>Sp(e,wp(e,t),"end_at_step"==o)));break;case"easy XYInputs: Sampler/Scheduler":let t=wp(e,"input_count").value+1;for(let n=0;nSp(e,wp(e,t),"strength"==o))),["first_start_percent","last_start_percent"].map((t=>Sp(e,wp(e,t),"start_percent"==o))),["first_end_percent","last_end_percent"].map((t=>Sp(e,wp(e,t),"end_percent"==o))),["strength","start_percent","end_percent"].map((t=>Sp(e,wp(e,t),o!=t))),kp(e)}case"replace_count":i=o+1;for(let t=0;tSp(e,wp(e,t),!l)));for(let t=i;t<11;t++)["lora_name_"+t,"model_str_"+t,"clip_str_"+t].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"ckpt_count":i=o+1;var c=-1!=wp(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=wp(e,"input_mode").value.indexOf("VAE");for(let t=0;tSp(e,wp(e,t),!1)));kp(e);break;case"input_count":i=o+1;var d=wp(e,"target_parameter").value;for(let t=0;tSp(e,wp(e,n),!t)));["model_strength","clip_strength"].map((n=>Sp(e,wp(e,n),!t)));break;case"easy XYInputs: Checkpoint":i=wp(e,"ckpt_count").value+1,c=-1!=wp(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=wp(e,"input_mode").value.indexOf("VAE");for(let n=0;ne.name===t));if(-1!==e){for(let t=e;t{var e;const t=this.computeSize();t[0]"info"===e.name));if(-1!==e&&this.widgets[e]){this.widgets[e].value=t}}requestAnimationFrame((()=>{var e;const t=this.computeSize();t[0]"prompt"==e.name));this.addWidget("button","get values from COMBO link","",(()=>{var t,o;const i=(null==(o=null==(t=this.outputs[1])?void 0:t.links)?void 0:o.length)>0?this.outputs[1].links[0]:null,r=n.graph._nodes.find((e=>{var t;return null==(t=e.inputs)?void 0:t.find((e=>e.link==i))}));if(i&&r){const t=r.inputs.find((e=>e.link==i)).widget.name,n=r.widgets.find((e=>e.name==t));let o=(null==n?void 0:n.options.values)||null;o&&(o=o.join("\n"),e.value=o)}else Fp.error(V("No COMBO link"),3e3)}),{serialize:!1})}),Wp.includes(t.name)){let t=function(e){var t="";for(let n=0;ne.name===t+"_prompt")),o="comfy-multiline-input wildcard_"+t+"_"+this.id.toString();if(-1==n&&e){const n=document.createElement("textarea");n.className=o,n.placeholder="Wildcard Prompt ("+t+")";const i=this.addDOMWidget(t+"_prompt","customtext",n,{getValue:e=>n.value,setValue(e){n.value=e},serialize:!1});i.inputEl=n,i.inputEl.readOnly=!0,n.addEventListener("input",(()=>{var e;null==(e=i.callback)||e.call(i,i.value)})),i.value=e}else if(this.widgets[n])if(e){this.widgets[n].value=e}else{this.widgets.splice(n,1);const e=document.getElementsByClassName(o);e&&e[0]&&e[0].remove()}}};e.prototype.onExecuted=function(e){null==a||a.apply(this,arguments);const o=t(e.positive),i=t(e.negative);n.call(this,o,"positive"),n.call(this,i,"negative")}}if(["easy sv3dLoader"].includes(t.name)){let t=function(e,t,n){switch(e){case"azimuth":return n.readOnly=!0,n.style.opacity=.6,"0:(0.0,0.0)"+(t>1?`\n${t-1}:(360.0,0.0)`:"");case"elevation":return n.readOnly=!0,n.style.opacity=.6,"0:(-90.0,0.0)"+(t>1?`\n${t-1}:(90.0,0.0)`:"");case"custom":return n.readOnly=!1,n.style.opacity=1,"0:(0.0,0.0)\n9:(180.0,0.0)\n20:(360.0,0.0)"}};e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>"easing_mode"==e.name)),n=this.widgets.find((e=>"batch_size"==e.name)),o=this.widgets.find((e=>"scheduler"==e.name));setTimeout((i=>{o.value||(o.value=t(e.value,n.value,o.inputEl))}),1),e.callback=e=>{o.value=t(e,n.value,o.inputEl)},n.callback=n=>{o.value=t(e.value,n,o.inputEl)}}}if(Hp.includes(o)&&(e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),o=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));if("easy seed"==t.name){const t=this.addWidget("button","🎲 Manual Random Seed",null,(t=>{"fixed"!=o.value&&(o.value="fixed"),e.value=Math.floor(Math.random()*P),n.queuePrompt(0,1)}),{serialize:!1});e.linkedWidgets=[t,o]}},e.prototype.onAdded=async function(){i&&i.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),t=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));setTimeout((n=>{"control_before_generate"==t.name&&0===e.value&&(e.value=Math.floor(Math.random()*P))}),1)}),"easy convertAnything"==o&&(e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>"output_type"==e.name)),t=t=>{this.outputs[0].type=e.value.toUpperCase(),this.outputs[0].name=e.value,this.outputs[0].label=e.value};setTimeout((e=>t()),10),e.callback=e=>t()}),"easy imageInsetCrop"==o){let t=function(e){const t=e.widgets[0];for(let n=1;n<=4;n++)"Pixels"===t.value?(e.widgets[n].options.step=80,e.widgets[n].options.max=8192):(e.widgets[n].options.step=10,e.widgets[n].options.max=99)};e.prototype.onAdded=async function(e){const n=this.widgets[0];let o=n.callback;n.callback=(...e)=>{t(this),o&&o.apply(n,[...e])},setTimeout((e=>{t(this)}),1)}}},nodeCreated(e){if(e.comfyClass.startsWith("easy ")){if(e.widgets)for(const n of e.widgets){if(!Up.includes(n.name))continue;let t=n.value;Zp(e,n),Object.defineProperty(n,"value",{get:e=>t,set(o){o!==t&&(t=o,Zp(e,n))}})}const t=e.comfyClass;if("easy preDetailerFix"==t){const t=e.widgets.find((e=>"customtext"===e.type));if(!t)return;t.dynamicPrompts=!1,t.inputEl.placeholder="wildcard spec: if kept empty, this option will be ignored",t.serializeValue=()=>t.value}if("easy wildcards"==t){const t=e.widgets.find((e=>"text"==e.name));let n=1;Object.defineProperty(e.widgets[n],"value",{set:e=>{if((new Error).stack.includes("inner_value_change")&&"Select the LoRA to add to the text"!=e){let n=e;n.endsWith(".safetensors")&&(n=n.slice(0,-12)),t.value+=``}},get:e=>"Select the LoRA to add to the text"}),Object.defineProperty(e.widgets[n+1],"value",{set:e=>{(new Error).stack.includes("inner_value_change")&&"Select the Wildcard to add to the text"!=e&&(""!=t.value&&(t.value+=", "),t.value+=e)},get:e=>"Select the Wildcard to add to the text"}),e.widgets[n].serializeValue=e=>"Select the LoRA to add to the text",e.widgets[n+1].serializeValue=e=>"Select the Wildcard to add to the text"}if(Yp.includes(t)){const t=document.createElement("textarea");t.className="comfy-multiline-input",t.readOnly=!0;const n=e.addDOMWidget("info","customtext",t,{getValue:e=>t.value,setValue:e=>t.value=e,serialize:!1});n.inputEl=t,t.addEventListener("input",(()=>{var e;null==(e=n.callback)||e.call(n,n.value)}))}}}}),y.registerExtension({name:"easy bookmark",registerCustomNodes(){class e{constructor(){v(this,"type","easy bookmark"),v(this,"title","🔖"),v(this,"slot_start_y",-20),v(this,"___collapsed_width",0),v(this,"isVirtualNode",!0),v(this,"serialize_widgets",!0),v(this,"keypressBound",null),this.addWidget("text","shortcut_key","1",(e=>{""!==(e=e.trim()[0]||"1")&&(this.title="🔖 "+e)}),{y:8}),this.addWidget("number","zoom",1,(e=>{}),{y:8+LiteGraph.NODE_WIDGET_HEIGHT+4,max:2,min:.5,precision:2}),this.keypressBound=this.onKeypress.bind(this)}get _collapsed_width(){return this.___collapsed_width}set _collapsed_width(e){const t=y.canvas,n=t.canvas.getContext("2d");if(n){const e=n.font;n.font=t.title_text_font,this.___collapsed_width=40+n.measureText(this.title).width,n.font=e}}onAdded(){setTimeout((e=>{const t=this.widgets[0].value;t&&(this.title="🔖 "+t)}),1),window.addEventListener("keydown",this.keypressBound)}onRemoved(){window.removeEventListener("keydown",this.keypressBound)}onKeypress(e){const t=e.target;["input","textarea"].includes(t.localName)||this.widgets[0]&&e.key.toLocaleLowerCase()===this.widgets[0].value.toLocaleLowerCase()&&this.canvasToBookmark()}canvasToBookmark(){var e,t;const n=y.canvas;(null==(e=null==n?void 0:n.ds)?void 0:e.offset)&&(n.ds.offset[0]=16-this.pos[0],n.ds.offset[1]=40-this.pos[1]),null!=(null==(t=null==n?void 0:n.ds)?void 0:t.scale)&&(n.ds.scale=Number(this.widgets[1].value||1)),n.setDirty(!0,!0)}}LiteGraph.registerNodeType("easy bookmark",Object.assign(e,{title:"Bookmark 🔖"})),e.category="EasyUse/Util"}}),y.registerExtension({name:"Comfy.EasyUse.ChainNode",init(){y.canvas._mousemove_callback=e=>{if(!A("EasyUse.Nodes.ChainGetSet",null,!0))return;((e,t=!1,n={})=>{var o,i,r,s,a;if(0===e.length)return;const l=n.inputX||160,c=n.ouputX||60;if(e.filter((e=>Dp(e))).length>1)return;for(const d of e){let s=0,a=0;const u=n.inputY||10,p=n.outputY||30,f=[];if(d.graph){for(const e of d.inputs??[]){const t=e.link;if(!t)continue;const{origin_id:n,target_slot:o}=Tp(t),i=Cp(n);if(!i)continue;if(!Dp(i))continue;const r=d.getConnectionPos(!0,o);i.pos=[r[0]-l,r[1]+15+s*u],s+=1,f.push(i),i.flags.collapsed=!0}for(const e of d.outputs??[])if(e.links&&d.graph)for(const t of e.links){const{target_id:e}=Tp(t),n=Cp(e);if(!n)continue;if(!Dp(n))continue;const i=null==(o=n.outputs)?void 0:o.links;if((null==i?void 0:i.length)>1)return;const r=d.getConnectionPos(!1,0);n.pos=[r[0]+c,r[1]+15+a*p],a+=1,f.push(n),n.flags.collapsed=!0}if(t&&1===e.length){const e=[d,...f];(null==(r=null==(i=d.graph)?void 0:i.list_of_graphcanvas)?void 0:r[0]).selectNodes(e)}}}const u=e[0];if(!u)return;(null==(a=null==(s=u.graph)?void 0:s.list_of_graphcanvas)?void 0:a[0]).setDirty(!0,!0)})(Ap())};const e=LGraphCanvas.prototype.showLinkMenu;LGraphCanvas.prototype.showLinkMenu=function(t,n){return n.shiftKey?(((e,t=!1)=>{var n,o,i,r,s,a,l,c,u,d;const{type:p}=e;if("*"===p)return;let{origin_id:f,target_id:h,origin_slot:m,target_slot:g}=e,v=Cp(f),y=Cp(h);if(!v||!y)return!1;if("Reroute"===v.type){let e=0;[v,e]=Gp(v),f=null==v?void 0:v.id,m=e,void 0!==m&&-1!==m||(m=0)}if("Reroute"===y.type&&(y=Bp(y),h=null==y?void 0:y.id,g=null==y?void 0:y.inputs.findIndex((e=>e.type===p)),void 0!==g&&-1!==g||(g=0)),void 0===f||void 0===h||!v||!y)return!1;if(t&&(Dp(v)||Dp(y)))return!1;let b=Ip((null==(n=y.getInputInfo(g))?void 0:n.name)??p.toLowerCase());b||(b=Ip((null==(i=null==(o=null==v?void 0:v.outputs)?void 0:o[m])?void 0:i.name)??(null==(s=null==(r=null==v?void 0:v.outputs)?void 0:r[m])?void 0:s.type.toString())??b+`_from_${f}_to_${h}`));let _,w=!1,S=!1;if(Dp(v))b=xp(v),S=!0;else{const e=null==(l=null==(a=v.outputs)?void 0:a[m])?void 0:l.links;if(e)for(const t of e){const e=Cp((null==(c=Tp(t))?void 0:c.target_id)??-1);e&&Dp(e)&&Pp(e)&&(b=xp(e),S=!0)}if(!S){for(const e of jp()){if(b!==xp(e)||!Pp(e))continue;const t=null==(u=e.inputs[0])?void 0:u.link;(null==(d=Tp(t))?void 0:d.origin_id)===v.id?S=!0:w=!0}w&&(b+=`_from_${f}_to_${h}`)}}if(!S){_=LiteGraph.createNode("easy setNode"),_.is_auto_link=!0;const e=v.getConnectionPos(!1,m);_.pos=[e[0]+20,e[1]],_.inputs[0].name=b,_.inputs[0].type=p,_.inputs[0].widget=y.inputs[g].widget,Mp(_,b),Rp(_),_.flags.collapsed=!0;let t=[];v.widgets?t=Object.values(v.widgets).map((e=>e.value)):v.widgets_values&&(t=JSON.parse(JSON.stringify(v.widgets_values))),v.connect(m,_,0),v.widgets_values=t,"PrimitiveNode"===v.type&&setTimeout((()=>{if(v){v.connect(m,_,0);for(const[e,n]of t.entries())Mp(v,n,e);null!==_&&_.setSize(_.computeSize())}}))}const x=LiteGraph.createNode("easy getNode"),k=y.getConnectionPos(!0,g);x.pos=[k[0]-150,k[1]],x.outputs[0].name=b,x.outputs[0].type=p,x.outputs[0].widget=y.inputs[g].widget,Rp(x),Mp(x,b),null===x||(x.flags.collapsed=!0,x.setSize(x.computeSize()),x.connect(0,y,g))})(t),!1):(e.apply(this,[t,n]),!1)}}});let Kp=[];function Xp(e,t,n,o,i){var r=LGraphCanvas.active_canvas,s=r.getCanvasWindow(),a=r.graph;if(a)return function e(t,o){var l=LiteGraph.getNodeTypesCategories(r.filter||a.filter).filter((function(e){return e.startsWith(t)})),c=[];l.map((function(n){if(n){var o=new RegExp("^("+t+")"),i=n.replace(o,"").split("/")[0],r=""===t?i+"/":t+i+"/",s=i;-1!=s.indexOf("::")&&(s=s.split("::")[1]),-1===c.findIndex((function(e){return e.value===r}))&&c.push({value:r,content:s,has_submenu:!0,callback:function(t,n,o,i){e(t.value,i)}})}})),LiteGraph.getNodeTypesInCategory(t.slice(0,-1),r.filter||a.filter).map((function(e){if(!e.skip_list){var t={value:e.type,content:e.title,has_submenu:!1,callback:function(e,t,n,o){var s=o.getFirstEvent();r.graph.beforeChange();var a=LiteGraph.createNode(e.value);a&&(a.pos=r.convertEventToCanvasOffset(s),r.graph.add(a)),i&&i(a),r.graph.afterChange()}};c.push(t)}}));const u=A("EasyUse.ContextMenu.NodesSort",null,!0);""===t&&u&&(c=function(e){let t=[],n=[];return e.forEach((e=>{(null==e?void 0:e.value)&&D.includes(e.value.split("/")[0])?t.push(e):n.push(e)})),[{title:V("ComfyUI Basic"),is_category_title:!0},...t,{title:V("Others A~Z"),is_category_title:!0},...n.sort(((e,t)=>e.content.localeCompare(t.content)))]}(c)),new LiteGraph.ContextMenu(c,{event:n,parentMenu:o},s)}("",o),!1}function Qp(e,t,n){var o=this;n=n||{};var i=document.createElement("div");i.className="litemenu-entry submenu";var r=!1;function s(e){var t=this.value,i=!0;(o.current_submenu&&o.current_submenu.close(e),n.callback)&&(!0===n.callback.call(this,t,n,e,o,n.node)&&(i=!1));if(t){if(t.callback&&!n.ignore_item_callbacks&&!0!==t.disabled)!0===t.callback.call(this,t,n,e,o,n.extra)&&(i=!1);if(t.submenu){if(!t.submenu.options)throw"ContextMenu submenu needs options";new o.constructor(t.submenu.options,{callback:t.submenu.callback,event:e,parentMenu:o,ignore_item_callbacks:t.submenu.ignore_item_callbacks,title:t.submenu.title,extra:t.submenu.extra,autoopen:n.autoopen}),i=!1}}i&&!o.lock&&o.close()}return null===t?i.classList.add("separator"):t.is_category_title?(i.classList.remove("litemenu-entry"),i.classList.remove("submenu"),i.classList.add("litemenu-title"),i.innerHTML=t.title):(i.innerHTML=t&&t.title?t.title:e,i.value=t,t&&(t.disabled&&(r=!0,i.classList.add("disabled")),(t.submenu||t.has_submenu)&&i.classList.add("has_submenu")),"function"==typeof t?(i.dataset.value=e,i.onclick_callback=t):i.dataset.value=t,t.className&&(i.className+=" "+t.className)),this.root.appendChild(i),r||i.addEventListener("click",s),!r&&n.autoopen&&LiteGraph.pointerListenerAdd(i,"enter",(function(e){var t=this.value;if(!t||!t.has_submenu)return;s.call(this,e)})),i}function Jp(e){return e.substring(0,e.lastIndexOf("."))}function qp(e){return e.substring(e.lastIndexOf(".")+1)}y.registerExtension({name:"Comfy.EasyUse.ContextMenu",async setup(){LGraphCanvas.onMenuAdd=Xp;const e=await b.fetchApi("/easyuse/models/thumbnail");if(200===e.status){let t=await e.json();Kp=t}else Fp.error(V("Too many thumbnails, have closed the display"));const t=LiteGraph.ContextMenu;LiteGraph.ContextMenu=function(e,n){var o,i;if(n.parentMenu);else if(n.extra)null==(o=n.extra.constructor)||o.name;else if(n.scale){if(A("EasyUse.ContextMenu.SubDirectories",null,!0)){const o=function(e,t){const n=e,o=[...n],i={},r=[],s=[],a=["ckpt","pt","bin","pth","safetensors"];if((null==e?void 0:e.length)>0){const t=qp(e[e.length-1]);if(!a.includes(t))return null}for(const l of n){const e=l.indexOf("/")>-1?"/":"\\",t=l.split(e);if(t.length>1){const n=t.shift();i[n]=i[n]||[],i[n].push(t.join(e))}else"CHOOSE"===l||l.startsWith("DISABLE ")?r.push(l):s.push(l)}if(Object.values(i).length>0){const e=t.callback;t.callback=null;const n=(t,n)=>{["None","无","無","なし"].includes(t.content)?e("None",n):e(o.find((e=>e.endsWith(t.content)),n))},l=(e,t="")=>{const o=t?t+"\\"+Jp(e):Jp(e),i=qp(e),r=(new Date).getTime();let s,l="";if(a.includes(i))for(let n=0;n{let n=[],o=[];const r=e.map((e=>{const r={},s=e.indexOf("/")>-1?"/":"\\",a=e.split(s);if(a.length>1){const e=a.shift();r[e]=r[e]||[],r[e].push(a.join(s))}if(Object.values(i).length>0){let t=Object.keys(r)[0];t&&r[t]?n.push({key:t,value:r[t][0]}):o.push(l(e,t))}return l(e,t)}));if(n.length>0){let e={};return n.forEach((t=>{e[t.key]=e[t.key]||[],e[t.key].push(t.value)})),[...Object.entries(e).map((e=>({content:e[0],has_submenu:!0,callback:()=>{},submenu:{options:u(e[1],e[0])}}))),...o]}return r};for(const[t,o]of Object.entries(i))c.push({content:t,has_submenu:!0,callback:()=>{},submenu:{options:u(o,t)}});return c.push(...s.map((e=>l(e,"")))),r.length>0&&c.push(...r.map((e=>l(e,"")))),c}return null}(e,n);if(o)return t.call(this,o,n)}}else n.hasOwnProperty("extra")&&(e.unshift(null),i=window.location.host,["192.168.","10.","127.",/^172\.((1[6-9]|2[0-9]|3[0-1])\.)/].some((e=>"string"==typeof e?i.startsWith(e):e.test(i)))&&e.unshift({content:`${V("Reboot ComfyUI")}`,callback:e=>async function(){if(confirm(V("Are you sure you'd like to reboot the server?")))try{b.fetchApi("/easyuse/reboot")}catch(e){}}()}),e.unshift({content:`${V("Cleanup Of GPU Usage")}`,callback:e=>async function(){try{const{Running:e,Pending:t}=await b.getQueue();if(e.length>0||t.length>0)return void Fp.error(V("Clean Failed")+":"+V("Please stop all running tasks before cleaning GPU"));200==(await b.fetchApi("/easyuse/cleangpu",{method:"POST"})).status?Fp.success(V("Clean SuccessFully")):Fp.error(V("Clean Failed"))}catch(e){}}()}));return t.apply(this,[...arguments])},LiteGraph.ContextMenu.prototype=t.prototype,LiteGraph.ContextMenu.prototype.addItem=Qp}});class ef extends w{constructor(){super(),this.element.classList.add("easyuse-model-metadata")}show(e){super.show(_("div",Object.keys(e).map((t=>_("div",[_("label",{textContent:t}),_("span",{textContent:e[t]})])))))}}class tf extends w{constructor(e){super(),this.name=e,this.element.classList.add("easyuse-model-info")}get customNotes(){return this.metadata["easyuse.notes"]}set customNotes(e){this.metadata["easyuse.notes"]=e}get hash(){return this.metadata["easyuse.sha256"]}async show(e,t){this.type=e;const n=b.fetchApi("/easyuse/metadata/"+encodeURIComponent(`${e}/${t}`));this.info=_("div",{style:{flex:"auto"}}),this.imgCurrent=0,this.imgList=_("div.easyuse-preview-list",{style:{display:"none"}}),this.imgWrapper=_("div.easyuse-preview",[_("div.easyuse-preview-group",[this.imgList])]),this.main=_("main",{style:{display:"flex"}},[this.imgWrapper,this.info]),this.content=_("div.easyuse-model-content",[_("div.easyuse-model-header",[_("h2",{textContent:this.name})]),this.main]);const o=_("div",{textContent:"ℹ️ Loading...",parent:this.content});super.show(this.content),this.metadata=await(await n).json(),this.viewMetadata.style.cursor=this.viewMetadata.style.opacity="",this.viewMetadata.removeAttribute("disabled"),o.remove(),this.addInfo()}createButtons(){const e=super.createButtons();return this.viewMetadata=_("button",{type:"button",textContent:"View raw metadata",disabled:"disabled",style:{opacity:.5,cursor:"not-allowed"},onclick:e=>{this.metadata&&(new ef).show(this.metadata)}}),e.unshift(this.viewMetadata),e}parseNote(){if(!this.customNotes)return[];let e=[];const t=new RegExp("(\\bhttps?:\\/\\/[^\\s]+)","g");let n,o=0;do{let i;n=t.exec(this.customNotes);let r=0;n?(i=n.index,r=n.index+n[0].length):i=this.customNotes.length;let s=this.customNotes.substring(o,i);s&&(s=s.replaceAll("\n","
"),e.push(_("span",{innerHTML:s}))),n&&e.push(_("a",{href:n[0],textContent:n[0],target:"_blank"})),o=r}while(n);return e}addInfoEntry(e,t){return _("p",{parent:this.info},["string"==typeof e?_("label",{textContent:e+": "}):e,"string"==typeof t?_("span",{textContent:t}):t])}async getCivitaiDetails(){const e=await fetch("https://civitai.com/api/v1/model-versions/by-hash/"+this.hash);if(200===e.status)return await e.json();throw 404===e.status?new Error("Model not found"):new Error(`Error loading info (${e.status}) ${e.statusText}`)}addCivitaiInfo(){const e=this.getCivitaiDetails(),t=_("span",{textContent:"ℹ️ Loading..."});return this.addInfoEntry(_("label",[_("img",{style:{width:"18px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),_("span",{textContent:"Civitai: "})]),t),e.then((e=>{var t,n;this.imgWrapper.style.display="block";let o=this.element.querySelector(".easyuse-model-header");o&&o.replaceChildren(_("h2",{textContent:this.name}),_("div.easyuse-model-header-remark",[_("h5",{textContent:V("Updated At:")+O(new Date(e.updatedAt),"yyyy/MM/dd")}),_("h5",{textContent:V("Created At:")+O(new Date(e.updatedAt),"yyyy/MM/dd")})]));let i=null,r=this.parseNote.call(this),s=V("✏️ Edit"),a=_("div.easyuse-model-detail-textarea",[_("p",(null==r?void 0:r.length)>0?r:{textContent:V("No notes")})]);if(r&&0!=r.length?a.classList.remove("empty"):a.classList.add("empty"),this.info.replaceChildren(_("div.easyuse-model-detail",[_("div.easyuse-model-detail-head.flex-b",[_("span",V("Notes")),_("a",{textContent:s,href:"#",style:{fontSize:"12px",float:"right",color:"var(--warning-color)",textDecoration:"none"},onclick:async e=>{if(e.preventDefault(),i){if(i.value!=this.customNotes){toast.showLoading(V("Saving Notes...")),this.customNotes=i.value;const e=await b.fetchApi("/easyuse/metadata/notes/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:this.customNotes});if(toast.hideLoading(),200!==e.status)return toast.error(V("Saving Failed")),void alert(`Error saving notes (${e.status}) ${e.statusText}`);toast.success(V("Saving Succeed")),r=this.parseNote.call(this),a.replaceChildren(_("p",(null==r?void 0:r.length)>0?r:{textContent:V("No notes")})),i.value?a.classList.remove("empty"):a.classList.add("empty")}else a.replaceChildren(_("p",{textContent:V("No notes")})),a.classList.add("empty");e.target.textContent=s,i.remove(),i=null}else e.target.textContent="💾 Save",i=_("textarea",{placeholder:V("Type your notes here"),style:{width:"100%",minWidth:"200px",minHeight:"50px",height:"100px"},textContent:this.customNotes}),a.replaceChildren(i),i.focus()}})]),a]),_("div.easyuse-model-detail",[_("div.easyuse-model-detail-head",{textContent:V("Details")}),_("div.easyuse-model-detail-body",[_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Type")}),_("div.easyuse-model-detail-item-value",{textContent:e.model.type})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("BaseModel")}),_("div.easyuse-model-detail-item-value",{textContent:e.baseModel})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Download")}),_("div.easyuse-model-detail-item-value",{textContent:(null==(t=e.stats)?void 0:t.downloadCount)||0})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Trained Words")}),_("div.easyuse-model-detail-item-value",{textContent:(null==e?void 0:e.trainedWords.join(","))||"-"})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Source")}),_("div.easyuse-model-detail-item-value",[_("label",[_("img",{style:{width:"14px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),_("a",{href:"https://civitai.com/models/"+e.modelId,textContent:"View "+e.model.name,target:"_blank"})])])])])])),null==(n=e.images)?void 0:n.length){this.imgCurrent=0,this.isSaving=!1,e.images.map((e=>e.url&&this.imgList.appendChild(_("div.easyuse-preview-slide",[_("div.easyuse-preview-slide-content",[_("img",{src:e.url}),_("div.save",{textContent:"Save as preview",onclick:async()=>{if(this.isSaving)return;this.isSaving=!0,toast.showLoading(V("Saving Preview..."));const t=await(await fetch(e.url)).blob(),n="temp_preview."+new URL(e.url).pathname.split(".")[1],o=new FormData;o.append("image",new File([t],n)),o.append("overwrite","true"),o.append("type","temp");if(200!==(await b.fetchApi("/upload/image",{method:"POST",body:o})).status)return this.isSaving=!1,toast.error(V("Saving Failed")),toast.hideLoading(),void alert(`Error saving preview (${req.status}) ${req.statusText}`);await b.fetchApi("/easyuse/save/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:JSON.stringify({filename:n,type:"temp"}),headers:{"content-type":"application/json"}}).then((e=>{toast.success(V("Saving Succeed")),toast.hideLoading()})),this.isSaving=!1,app.refreshComboInNodes()}})])]))));let t=this;this.imgDistance=(-660*this.imgCurrent).toString(),this.imgList.style.display="",this.imgList.style.transform="translate3d("+this.imgDistance+"px, 0px, 0px)",this.slides=this.imgList.querySelectorAll(".easyuse-preview-slide"),this.slideLeftButton=_("button.left",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{e.images.length<=2||(t.imgList.classList.remove("no-transition"),0==t.imgCurrent?(t.imgCurrent=e.images.length/2-1,this.slides[this.slides.length-1].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d(660px, 0px, 0px)",setTimeout((e=>{this.slides[this.slides.length-1].style.transform="translate3d(0px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)):(t.imgCurrent=t.imgCurrent-1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"))}}),this.slideRightButton=_("button.right",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{if(!(e.images.length<=2))if(t.imgList.classList.remove("no-transition"),t.imgCurrent>=e.images.length/2-1){t.imgCurrent=0;const n=e.images.length/2;this.slides[0].style.transform="translate3d("+(660*n).toString()+"px, 0px, 0px)",this.slides[1].style.transform="translate3d("+(660*n).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d("+(-660*n).toString()+"px, 0px, 0px)",setTimeout((e=>{this.slides[0].style.transform="translate3d(0px, 0px, 0px)",this.slides[1].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)}else t.imgCurrent=t.imgCurrent+1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"}})}return e.description&&_("div",{parent:this.content,innerHTML:e.description,style:{marginTop:"10px"}}),e})).catch((e=>{this.imgWrapper.style.display="none",t.textContent="⚠️ "+e.message})).finally((e=>{}))}}class nf extends tf{async addInfo(){await this.addCivitaiInfo()}}class of extends tf{getTagFrequency(){if(!this.metadata.ss_tag_frequency)return[];const e=JSON.parse(this.metadata.ss_tag_frequency),t={};for(const n in e){const o=e[n];for(const e in o)e in t?t[e]+=o[e]:t[e]=o[e]}return Object.entries(t).sort(((e,t)=>t[1]-e[1]))}getResolutions(){let e=[];if(this.metadata.ss_bucket_info){const t=JSON.parse(this.metadata.ss_bucket_info);if(null==t?void 0:t.buckets)for(const{resolution:n,count:o}of Object.values(t.buckets))e.push([o,`${n.join("x")} * ${o}`])}e=e.sort(((e,t)=>t[0]-e[0])).map((e=>e[1]));let t=this.metadata.ss_resolution;if(t){const n=t.split(","),o=n[0].replace("(",""),i=n[1].replace(")","");e.push(`${o.trim()}x${i.trim()} (Base res)`)}else(t=this.metadata["modelspec.resolution"])&&e.push(t+" (Base res");return e.length||e.push("⚠️ Unknown"),e}getTagList(e){return e.map((e=>_("li.easyuse-model-tag",{dataset:{tag:e[0]},$:e=>{e.onclick=()=>{e.classList.toggle("easyuse-model-tag--selected")}}},[_("p",{textContent:e[0]}),_("span",{textContent:e[1]})])))}addTags(){let e,t=this.getTagFrequency();if(null==t?void 0:t.length){const n=t.length;let o;n>500&&(t=t.slice(0,500),e=_("p",[_("span",{textContent:"⚠️ Only showing first 500 tags "}),_("a",{href:"#",textContent:`Show all ${n}`,onclick:()=>{o.replaceChildren(...this.getTagList(this.getTagFrequency())),e.remove()}})])),o=_("ol.easyuse-model-tags-list",this.getTagList(t)),this.tags=_("div",[o])}else this.tags=_("p",{textContent:"⚠️ No tag frequency metadata found"});this.content.append(this.tags),e&&this.content.append(e)}async addInfo(){const e=this.addCivitaiInfo();this.addTags();const t=await e;t&&_("div",{parent:this.content,innerHTML:t.description,style:{maxHeight:"250px",overflow:"auto"}})}createButtons(){const e=super.createButtons();function t(e,t){const n=_("textarea",{parent:document.body,style:{position:"fixed"},textContent:t.map((e=>e.dataset.tag)).join(", ")});n.select();try{document.execCommand("copy"),e.target.dataset.text||(e.target.dataset.text=e.target.textContent),e.target.textContent="Copied "+t.length+" tags",setTimeout((()=>{e.target.textContent=e.target.dataset.text}),1e3)}catch(o){prompt("Copy to clipboard: Ctrl+C, Enter",text)}finally{document.body.removeChild(n)}}return e.unshift(_("button",{type:"button",textContent:"Copy Selected",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag--selected")])}}),_("button",{type:"button",textContent:"Copy All",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag")])}})),e}}const rf=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy kolorsLoader","easy hunyuanDiTLoader","easy pixArtLoader"],sf=["easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingLayerDiffusion","easy fullkSampler"],af=["KSamplerSelect","SamplerEulerAncestral","SamplerEulerAncestralCFG++","SamplerLMS","SamplerDPMPP_3M_SDE","SamplerDPMPP_2M_SDE","SamplerDPMPP_SDE","SamplerDPMAdaptative","SamplerLCMUpscale","SamplerTCD","SamplerTCD EulerA"],lf=["BasicScheduler","KarrasScheduler","ExponentialScheduler","PolyexponentialScheduler","VPScheduler","BetaSamplingScheduler","SDTurboScheduler","SplitSigmas","SplitSigmasDenoise","FlipSigmas","AlignYourStepsScheduler","GITSScheduler"],cf=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerLayerDiffusion"],uf=["easy controlnetLoader","easy controlnetLoaderADV","easy controlnetLoader++","easy instantIDApply","easy instantIDApplyADV"],df=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition","easy ipadapterApplyFromParams","easy pulIDApply","easy pulIDApplyADV"],pf=["easy positive","easy wildcards"],ff=["easy loadImageBase64","LoadImage","LoadImageMask"],hf=["easy applyBrushNet","easy applyPowerPaint","easy applyInpaint"],mf={positive_prompt:{text:"positive",positive:"text"},loaders:{ckpt_name:"ckpt_name",vae_name:"vae_name",clip_skip:"clip_skip",lora_name:"lora_name",resolution:"resolution",empty_latent_width:"empty_latent_width",empty_latent_height:"empty_latent_height",positive:"positive",negative:"negative",batch_size:"batch_size",a1111_prompt_style:"a1111_prompt_style"},preSampling:{steps:"steps",cfg:"cfg",cfg_scale_min:"cfg",sampler_name:"sampler_name",scheduler:"scheduler",denoise:"denoise",seed_num:"seed_num",seed:"seed"},kSampler:{image_output:"image_output",save_prefix:"save_prefix",link_id:"link_id"},controlnet:{control_net_name:"control_net_name",strength:["strength","cn_strength"],scale_soft_weights:["scale_soft_weights","cn_soft_weights"],cn_strength:["strength","cn_strength"],cn_soft_weights:["scale_soft_weights","cn_soft_weights"]},ipadapter:{preset:"preset",lora_strength:"lora_strength",provider:"provider",weight:"weight",weight_faceidv2:"weight_faceidv2",start_at:"start_at",end_at:"end_at",cache_mode:"cache_mode",use_tiled:"use_tiled",insightface:"insightface",pulid_file:"pulid_file"},load_image:{image:"image",base64_data:"base64_data",channel:"channel"},inpaint:{dtype:"dtype",fitting:"fitting",function:"function",scale:"scale",start_at:"start_at",end_at:"end_at"},sampler:{},sigmas:{}},gf={loaders:{optional_lora_stack:"optional_lora_stack",positive:"positive",negative:"negative"},preSampling:{pipe:"pipe",image_to_latent:"image_to_latent",latent:"latent"},kSampler:{pipe:"pipe",model:"model"},controlnet:{pipe:"pipe",image:"image",image_kps:"image_kps",control_net:"control_net",positive:"positive",negative:"negative",mask:"mask"},positive_prompt:{},ipadapter:{model:"model",image:"image",image_style:"image",attn_mask:"attn_mask",optional_ipadapter:"optional_ipadapter"},inpaint:{pipe:"pipe",image:"image",mask:"mask"},sampler:{},sigmas:{}},vf={loaders:{pipe:"pipe",model:"model",vae:"vae",clip:null,positive:null,negative:null,latent:null},preSampling:{pipe:"pipe"},kSampler:{pipe:"pipe",image:"image"},controlnet:{pipe:"pipe",positive:"positive",negative:"negative"},positive_prompt:{text:"positive",positive:"text"},load_image:{IMAGE:"IMAGE",MASK:"MASK"},ipadapter:{model:"model",tiles:"tiles",masks:"masks",ipadapter:"ipadapter"},inpaint:{pipe:"pipe"},sampler:{SAMPLER:"SAMPLER"},sigmas:{SIGMAS:"SIGMAS"}};function yf(e,t,n){return function(){!function(e,t,n){const o=LiteGraph.createNode(t);if(o){if(y.graph.add(o),o.pos=e.pos.slice(),o.size=e.size.slice(),e.widgets.forEach((e=>{if(mf[n][e.name]){const i=mf[n][e.name];if(i){const n=(t=i,o.widgets.find((e=>"object"==typeof t?t.includes(e.name):e.name===t)));n&&(n.value=e.value,"seed_num"==e.name&&(n.linkedWidgets[0].value=e.linkedWidgets[0].value),"converted-widget"==e.type&&Cf(o,n,e))}}var t})),e.inputs&&e.inputs.forEach(((t,i)=>{if(t&&t.link&&gf[n][t.name]){const i=gf[n][t.name];if(null===i)return;const r=o.findInputSlot(i);if(-1!==r){const n=e.graph.links[t.link];if(n){const t=e.graph.getNodeById(n.origin_id);t&&t.connect(n.origin_slot,o,r)}}}})),e.outputs&&e.outputs.forEach(((t,i)=>{if(t&&t.links&&vf[n]&&vf[n][t.name]){const i=vf[n][t.name];if(null===i)return;const r=o.findOutputSlot(i);-1!==r&&t.links.forEach((t=>{const n=e.graph.links[t];if(n){const t=e.graph.getNodeById(n.target_id);t&&o.connect(r,t,n.target_slot)}}))}})),y.graph.remove(e),"easy fullkSampler"==o.type){const e=o.outputs[0].links;if(e&&e[0]){const t=y.graph._nodes.find((t=>t.inputs&&t.inputs[0]&&t.inputs[0].link==e[0]));t&&y.graph.remove(t)}}else if(sf.includes(o.type)){const e=o.outputs[0].links;if(!e||!e[0]){const e=LiteGraph.createNode("easy kSampler");y.graph.add(e),e.pos=o.pos.slice(),e.pos[0]=e.pos[0]+o.size[0]+20;const t=o.findInputSlot("pipe");-1!==t&&o&&o.connect(0,e,t)}}o.setSize([o.size[0],o.computeSize()[1]])}}(e,t,n)}}const bf=(e,t)=>{const n=e.prototype.getExtraMenuOptions;e.prototype.getExtraMenuOptions=function(){const e=n.apply(this,arguments);return t.apply(this,arguments),e}},_f=(e,t,n,o,i=!0)=>{bf(o,(function(o,r){r.unshift({content:e,has_submenu:i,callback:(e,o,i,r,s)=>wf(e,o,i,r,s,t,n)}),"loaders"==t&&(r.unshift({content:V("💎 View Lora Info..."),callback:(e,t,n,o,i)=>{let r=i.widgets.find((e=>"lora_name"==e.name)).value;r&&"None"!=r&&new of(r).show("loras",r)}}),r.unshift({content:V("💎 View Checkpoint Info..."),callback:(e,t,n,o,i)=>{let r=i.widgets[0].value;r&&"None"!=r&&new nf(r).show("checkpoints",r)}}))}))},wf=(e,t,n,o,i,r,s)=>{const a=[];return s.map((e=>{i.type!==e&&a.push({content:`${e}`,callback:yf(i,e,r)})})),new LiteGraph.ContextMenu(a,{event:n,callback:null,parentMenu:o,node:i}),!1},Sf="converted-widget",xf=Symbol();function kf(e,t,n=""){if(t.origType=t.type,t.origComputeSize=t.computeSize,t.origSerializeValue=t.serializeValue,t.computeSize=()=>[0,-4],t.type=Sf+n,t.serializeValue=()=>{if(!e.inputs)return;let n=e.inputs.find((e=>{var n;return(null==(n=e.widget)?void 0:n.name)===t.name}));return n&&n.link?t.origSerializeValue?t.origSerializeValue():t.value:void 0},t.linkedWidgets)for(const o of t.linkedWidgets)kf(e,o,":"+t.name)}function Cf(e,t,n){kf(e,t);const{type:o}=function(e){let t=e[0];t instanceof Array&&(t="COMBO");return{type:t}}(n),i=e.size;t.options&&t.options.forceInput||e.addInput(t.name,o,{widget:{name:t.name,[xf]:()=>n}});for(const r of e.widgets)r.last_y+=LiteGraph.NODE_SLOT_HEIGHT;e.setSize([Math.max(i[0],e.size[0]),Math.max(i[1],e.size[1])])}const Af=function(e){var t,n,o,i;const r=e.constructor.type,s=e.properties.origVals||{},a=s.title||e.title,l=s.color||e.color,c=s.bgcolor||e.bgcolor,u=e,d={size:[...e.size],color:l,bgcolor:c,pos:[...e.pos]};let p=[],f=[];if(e.inputs)for(const y of e.inputs)if(y.link){const t=y.name,n=e.findInputSlot(t),o=e.getInputNode(n),i=e.getInputLink(n);p.push([i.origin_slot,o,t])}if(e.outputs)for(const y of e.outputs)if(y.links){const e=y.name;for(const t of y.links){const n=graph.links[t],o=graph._nodes_by_id[n.target_id];f.push([e,o,n.target_slot])}}y.graph.remove(e);const h=y.graph.add(LiteGraph.createNode(r,a,d));function m(){if(u.widgets)for(let e of u.widgets)if("converted-widget"===e.type){const t=h.widgets.find((t=>t.name===e.name));for(let n of u.inputs)n.name===e.name&&Cf(h,t,n.widget)}for(let e of p){const[t,n,o]=e;n.connect(t,h.id,o)}for(let e of f){const[t,n,o]=e;h.connect(t,n,o)}}let g=u.widgets_values;if(!g&&(null==(t=h.widgets)?void 0:t.length)>0)return h.widgets.forEach(((e,t)=>{const n=u.widgets[t];e.name===n.name&&e.type===n.type&&(e.value=n.value)})),void m();const v=(null==g?void 0:g.length)<=(null==(n=h.widgets)?void 0:n.length);let b=v?0:g.length-1;function _(e,t){var n,o,i,r,s,a;if(!0===e||!1===e){if((null==(n=t.options)?void 0:n.on)&&(null==(o=t.options)?void 0:o.off))return{value:e,pass:!0}}else if("number"==typeof e){if((null==(i=t.options)?void 0:i.min)<=e&&e<=(null==(r=t.options)?void 0:r.max))return{value:e,pass:!0}}else{if(null==(a=null==(s=t.options)?void 0:s.values)?void 0:a.includes(e))return{value:e,pass:!0};if(t.inputEl&&"string"==typeof e)return{value:e,pass:!0}}return{value:t.value,pass:!1}}const w=e=>{var t;const n=u.widgets[e];let o=h.widgets[e];if(o.name===n.name&&o.type===n.type){for(;v?b=0;){let{value:e,pass:t}=_(g[b],o);if(t&&null!==e){o.value=e;break}b+=v?1:-1}b++,v||(b=g.length-((null==(t=h.widgets)?void 0:t.length)-1-e))}};if(v&&(null==(o=h.widgets)?void 0:o.length)>0)for(let y=0;y0)for(let y=h.widgets.length-1;y>=0;y--)w(y);m()};y.registerExtension({name:"Comfy.EasyUse.ExtraMenu",async beforeRegisterNodeDef(e,t,n){bf(e,(function(e,n){n.unshift({content:V("🔃 Reload Node"),callback:(e,t,n,o,i)=>{let r=LGraphCanvas.active_canvas;if(!r.selected_nodes||Object.keys(r.selected_nodes).length<=1)Af(i);else for(let s in r.selected_nodes)Af(r.selected_nodes[s])}}),"easy ckptNames"==t.name&&n.unshift({content:V("💎 View Checkpoint Info..."),callback:(e,t,n,o,i)=>{i.widgets[0].value}})})),pf.includes(t.name)&&_f("↪️ Swap EasyPrompt","positive_prompt",pf,e),rf.includes(t.name)&&_f("↪️ Swap EasyLoader","loaders",rf,e),sf.includes(t.name)&&_f("↪️ Swap EasyPreSampling","preSampling",sf,e),cf.includes(t.name)&&_f("↪️ Swap EasyKSampler","preSampling",cf,e),af.includes(t.name)&&_f("↪️ Swap Custom Sampler","sampler",af,e),lf.includes(t.name)&&_f("↪️ Swap Custom Sigmas","sigmas",lf,e),uf.includes(t.name)&&_f("↪️ Swap EasyControlnet","controlnet",uf,e),df.includes(t.name)&&_f("↪️ Swap EasyAdapater","ipadapter",df,e),ff.includes(t.name)&&_f("↪️ Swap LoadImage","load_image",ff,e),hf.includes(t.name)&&_f("↪️ Swap InpaintNode","inpaint",hf,e)}});const Ef="➡️";y.registerExtension({name:"easy setNode",registerCustomNodes(){class e{constructor(){v(this,"defaultVisibility",!0),v(this,"serialize_widgets",!0),this.properties||(this.properties={previousName:""}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("text","Constant","",((e,n,o,i,r)=>{t.validateName(t.graph),""!==this.widgets[0].value&&(this.title=Ef+this.widgets[0].value),this.update(),this.properties.previousName=this.widgets[0].value}),{}),this.addInput("*","*"),this.onConnectionsChange=function(e,n,o,i,r){if(1!=e||o||(this.inputs[n].type="*",this.inputs[n].name="*",this.title="Set"),i&&t.graph&&1==e&&o){const e=t.graph._nodes.find((e=>e.id==i.origin_id)).outputs[i.origin_slot],n=e.type,o=t.is_auto_link?this.widgets[0].value:e.name;"Set"===this.title&&(this.title=Ef+o,this.widgets[0].value=o),"*"===this.widgets[0].value&&(this.widgets[0].value=o),this.validateName(t.graph),this.inputs[0].type=n,this.inputs[0].name=o,setTimeout((e=>{this.title=Ef+this.widgets[0].value}),1)}this.update()},this.validateName=function(e){let n=t.widgets[0].value;if(""!=n){let o=0,i=[];do{i=e._nodes.filter((e=>e!=this&&("easy setNode"==e.type&&e.widgets[0].value===n))),i.length>0&&(n=t.widgets[0].value+o),o++}while(i.length>0);t.widgets[0].value=n,this.update()}},this.clone=function(){const t=e.prototype.clone.apply(this);return t.inputs[0].name="*",t.inputs[0].type="*",t.properties.previousName="",t.size=t.computeSize(),t},this.onAdded=function(e){this.validateName(e)},this.update=function(){if(t.graph){this.findGetters(t.graph).forEach((e=>{e.setType(this.inputs[0].type)})),this.widgets[0].value&&this.findGetters(t.graph,!0).forEach((e=>{e.setName(this.widgets[0].value)}));t.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues()}))}},this.findGetters=function(e,t){const n=t?this.properties.previousName:this.widgets[0].value;return e._nodes.filter((e=>"easy getNode"==e.type&&e.widgets[0].value===n&&""!=n))},this.isVirtualNode=!0}onRemoved(){this.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues([this])}))}}LiteGraph.registerNodeType("easy setNode",Object.assign(e,{title:"Set"})),e.category="EasyUse/Util"}}),y.registerExtension({name:"easy getNode",registerCustomNodes(){class e{constructor(){v(this,"defaultVisibility",!0),v(this,"serialize_widgets",!0),this.properties||(this.properties={}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("combo","Constant","",(e=>{this.onRename()}),{values:()=>t.graph._nodes.filter((e=>"easy setNode"==e.type)).map((e=>e.widgets[0].value)).sort()}),this.addOutput("*","*"),this.onConnectionsChange=function(e,t,n,o,i){this.validateLinks(),2!=e||n?(this.onRename(),setTimeout((e=>{this.title="⬅️"+this.widgets[0].value}),1)):(this.outputs[t].type="*",this.outputs[t].name="*",this.title="Get")},this.setName=function(e){t.widgets[0].value=e,t.onRename(),t.serialize()},this.onRename=function(e=0){const n=this.findSetter(t.graph);if(n){const t=n.inputs[0].type,o=n.inputs[0].name;this.setType(t,o),this.outputs[e].type=t,this.outputs[e].name=o,this.title="⬅️"+n.widgets[0].value}else this.setType("*","*"),this.outputs[e].type="*",this.outputs[e].name="*"},this.clone=function(){const t=e.prototype.clone.apply(this);return t.size=t.computeSize(),t},this.validateLinks=function(){"*"!=this.outputs[0].type&&this.outputs[0].links&&this.outputs[0].links.forEach((e=>{const n=t.graph.links[e];n&&n.type!=this.outputs[0].type&&"*"!=n.type&&t.graph.removeLink(e)}))},this.setType=function(e,t){this.outputs[0].name=t,this.outputs[0].type=e,this.validateLinks()},this.findSetter=function(e){const t=this.widgets[0].value;return e._nodes.find((e=>"easy setNode"==e.type&&e.widgets[0].value===t&&""!=t))},this.isVirtualNode=!0}getInputLink(e){const t=this.findSetter(this.graph);if(t){const n=t.inputs[e];return this.graph.links[n.link]}throw new Error("No setter found for "+this.widgets[0].value+"("+this.type+")")}onAdded(e){}}LiteGraph.registerNodeType("easy getNode",Object.assign(e,{title:"Get"})),e.category="EasyUse/Util"}}),b.addEventListener("easyuse-global-seed",(function(e){let t=app.graph._nodes_by_id;for(let n in t){let o=t[n];if("easy globalSeed"==o.type){if(o.widgets){const t=o.widgets.find((e=>"value"==e.name));o.widgets.find((e=>"last_seed"==e.name)).value=t.value,t.value=e.detail.value}}else if(o.widgets){const t=o.widgets.find((e=>"seed_num"==e.name||"seed"==e.name||"noise_seed"==e.name));t&&null!=e.detail.seed_map[o.id]&&(t.value=e.detail.seed_map[o.id])}}}));const Of=b.queuePrompt;b.queuePrompt=async function(e,{output:t,workflow:n}){n.seed_widgets={};for(let o in app.graph._nodes_by_id){let e=app.graph._nodes_by_id[o].widgets;if(e)for(let t in e)"seed_num"!=e[t].name&&"seed"!=e[t].name&&"noise_seed"!=e[t].name||"converted-widget"==e[t].type||(n.seed_widgets[o]=parseInt(t))}return await Of.call(b,e,{output:t,workflow:n})};const Lf=["easy imageSave","easy fullkSampler","easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo","easy detailerFix"];y.registerExtension({name:"Comfy.EasyUse.SaveImageExtraOutput",async beforeRegisterNodeDef(e,t,n){if(Lf.includes(t.name)){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0,o=this.widgets.find((e=>"filename_prefix"===e.name||"save_prefix"===e.name));return o.serializeValue=()=>x(n,o.value),e}}else{const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0;return this.properties&&"Node name for S&R"in this.properties||this.addProperty("Node name for S&R",this.constructor.type,"string"),e}}}});const Tf=["easy wildcards","easy positive","easy negative","easy stylesSelector","easy promptConcat","easy promptReplace"],If=["easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingDynamicCFG","easy preSamplingSdTurbo","easy preSamplingLayerDiffusion"],Nf=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo"],Pf=["easy controlnetLoader","easy controlnetLoaderADV"],Df=["easy instantIDApply","easy instantIDApplyADV"],jf=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition"],Mf=["easy pipeIn","easy pipeOut","easy pipeEdit"],Rf=["easy XYPlot","easy XYPlotAdvanced"],$f=["easy setNode"],Gf=["Reroute","RescaleCFG","LoraLoaderModelOnly","LoraLoader","FreeU","FreeU_v2",...jf,...$f],Bf={"easy seed":{from:{INT:["Reroute",...If,"easy fullkSampler"]}},"easy positive":{from:{STRING:["Reroute",...Tf]}},"easy negative":{from:{STRING:["Reroute",...Tf]}},"easy wildcards":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy stylesSelector":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy promptConcat":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy promptReplace":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy fullLoader":{from:{PIPE_LINE:["Reroute",...If,"easy fullkSampler",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy a1111Loader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy comfyLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy hunyuanDiTLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy kolorsLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy pixArtLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy svdLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy zero123Loader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy sv3dLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy preSampling":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingAdvanced":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingDynamicCFG":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingCustom":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingLayerDiffusion":{from:{PIPE_LINE:["Reroute","easy kSamplerLayerDiffusion",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingNoiseIn":{from:{PIPE_LINE:["Reroute",...Nf,...Mf,...Pf,...Rf,...$f]}},"easy fullkSampler":{from:{PIPE_LINE:["Reroute",...Mf.reverse(),"easy preDetailerFix","easy preMaskDetailerFix",...If,...$f]}},"easy kSampler":{from:{PIPE_LINE:["Reroute",...Mf.reverse(),"easy preDetailerFix","easy preMaskDetailerFix","easy hiresFix",...If,...$f]}},"easy controlnetLoader":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f]}},"easy controlnetLoaderADV":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f]}},"easy instantIDApply":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{COMBO:["Reroute","easy promptLine"]}},"easy instantIDApplyADV":{from:{PIPE_LINE:["Reroute",...If,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApply":{to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApplyADV":{to:{STRING:["Reroute","easy sliderControl",...Tf],COMBO:["Reroute","easy promptLine"]}},"easy ipadapterStyleComposition":{to:{COMBO:["Reroute","easy promptLine"]}},"easy preDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Mf,...$f]},to:{PIPE_LINE:["Reroute","easy ultralyticsDetectorPipe","easy samLoaderPipe","easy kSampler","easy fullkSampler"]}},"easy preMaskDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Mf,...$f]}},"easy samLoaderPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Mf,...$f]}},"easy ultralyticsDetectorPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Mf,...$f]}},"easy cascadeLoader":{from:{PIPE_LINE:["Reroute","easy fullCascadeKSampler","easy preSamplingCascade",...Pf,...Mf,...$f],MODEL:Gf.filter((e=>!jf.includes(e)))}},"easy fullCascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Mf,...$f]}},"easy preSamplingCascade":{from:{PIPE_LINE:["Reroute","easy cascadeKSampler",...Mf,...$f]}},"easy cascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Mf,...$f]}}};y.registerExtension({name:"Comfy.EasyUse.Suggestions",async setup(e){LGraphCanvas.prototype.createDefaultNodeForSlot=function(e){e=e||{};var t,n=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,position:[],nodeType:null,posAdd:[0,0],posSizeFix:[0,0]},e),o=n.nodeFrom&&null!==n.slotFrom,i=!o&&n.nodeTo&&null!==n.slotTo;if(!o&&!i)return!1;if(!n.nodeType)return!1;var r=o?n.nodeFrom:n.nodeTo,s=o?n.slotFrom:n.slotTo,a=r.type,l=!1;switch(typeof s){case"string":l=o?r.findOutputSlot(s,!1):r.findInputSlot(s,!1),s=o?r.outputs[s]:r.inputs[s];break;case"object":l=o?r.findOutputSlot(s.name):r.findInputSlot(s.name);break;case"number":l=s,s=o?r.outputs[s]:r.inputs[s];break;default:return!1}var c=s.type==LiteGraph.EVENT?"_event_":s.type,u=o?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in;if(u&&u[c]){s.link;let e=!1;const i=o?"from":"to";if(Bf[a]&&Bf[a][i]&&(null==(t=Bf[a][i][c])?void 0:t.length)>0){for(var d in Bf[a][i][c])if(n.nodeType==Bf[a][i][c][d]||"AUTO"==n.nodeType){e=Bf[a][i][c][d];break}}else if("object"==typeof u[c]||"array"==typeof u[c]){for(var d in u[c])if(n.nodeType==u[c][d]||"AUTO"==n.nodeType){e=u[c][d];break}}else n.nodeType!=u[c]&&"AUTO"!=n.nodeType||(e=u[c]);if(e){var p=!1;"object"==typeof e&&e.node&&(p=e,e=e.node);var f=LiteGraph.createNode(e);if(f){if(p){if(p.properties)for(var h in p.properties)f.addProperty(h,p.properties[h]);if(p.inputs)for(var h in f.inputs=[],p.inputs)f.addOutput(p.inputs[h][0],p.inputs[h][1]);if(p.outputs)for(var h in f.outputs=[],p.outputs)f.addOutput(p.outputs[h][0],p.outputs[h][1]);p.title&&(f.title=p.title),p.json&&f.configure(p.json)}return this.graph.add(f),f.pos=[n.position[0]+n.posAdd[0]+(n.posSizeFix[0]?n.posSizeFix[0]*f.size[0]:0),n.position[1]+n.posAdd[1]+(n.posSizeFix[1]?n.posSizeFix[1]*f.size[1]:0)],o?n.nodeFrom.connectByType(l,f,c):n.nodeTo.connectByTypeOutput(l,f,c),!0}}}return!1},LGraphCanvas.prototype.showConnectionMenu=function(e){e=e||{};var t,n=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,e:null},e),o=this,i=n.nodeFrom&&n.slotFrom,r=!i&&n.nodeTo&&n.slotTo;if(!i&&!r)return!1;var s=i?n.nodeFrom:n.nodeTo,a=i?n.slotFrom:n.slotTo,l=!1;switch(typeof a){case"string":l=i?s.findOutputSlot(a,!1):s.findInputSlot(a,!1),a=i?s.outputs[a]:s.inputs[a];break;case"object":l=i?s.findOutputSlot(a.name):s.findInputSlot(a.name);break;case"number":l=a,a=i?s.outputs[a]:s.inputs[a];break;default:return!1}var c=["Add Node",null];o.allow_searchbox&&(c.push("Search"),c.push(null));var u=a.type==LiteGraph.EVENT?"_event_":a.type,d=i?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in,p=s.type;if(d&&d[u]){const e=i?"from":"to";if(Bf[p]&&Bf[p][e]&&(null==(t=Bf[p][e][u])?void 0:t.length)>0)for(var f in Bf[p][e][u])c.push(Bf[p][e][u][f]);else if("object"==typeof d[u]||"array"==typeof d[u])for(var f in d[u])c.push(d[u][f]);else c.push(d[u])}var h=new LiteGraph.ContextMenu(c,{event:n.e,title:(a&&""!=a.name?a.name+(u?" | ":""):"")+(a&&u?u:""),callback:function(e,t,r){switch(e){case"Add Node":LGraphCanvas.onMenuAdd(null,null,r,h,(function(e){i?n.nodeFrom.connectByType(l,e,u):n.nodeTo.connectByTypeOutput(l,e,u)}));break;case"Search":i?o.showSearchBox(r,{node_from:n.nodeFrom,slot_from:a,type_filter_in:u}):o.showSearchBox(r,{node_to:n.nodeTo,slot_from:a,type_filter_out:u});break;default:o.createDefaultNodeForSlot(Object.assign(n,{position:[n.e.canvasX,n.e.canvasY],nodeType:e}))}}});return!1}}}),y.registerExtension({name:"Comfy.EasyUse.TimeTaken",setup(){const e=new Map;let t=0;b.addEventListener("executing",(n=>{if(!A("EasyUse.Nodes.Runtime",null,!0))return;const o=(null==n?void 0:n.node)||(null==n?void 0:n.detail)||null,i=Cp(o);i&&(i.executionDuration="");const r=e.get(t);if(e.delete(t),t&&r){const e=Date.now()-r,n=Cp(t);n&&(n.executionDuration=`${(e/1e3).toFixed(2)}${V("s")}`)}t=o,e.set(o,Date.now())}))},beforeRegisterNodeDef(e,t){const n=e.prototype.onDrawForeground;e.prototype.onDrawForeground=function(...e){const[t]=e;return function(e,t){if(!t)return;e.save(),e.fillStyle=LiteGraph.NODE_DEFAULT_BGCOLOR,function(e,t,n,o,i,r){e.beginPath(),e.moveTo(t+r,n),e.lineTo(t+o-r,n),e.arcTo(t+o,n,t+o,n+r,r),e.lineTo(t+o,n+i-r),e.arcTo(t+o,n+i,t+o-r,n+i,r),e.lineTo(t+r,n+i),e.arcTo(t,n+i,t,n+i-r,r),e.lineTo(t,n+r),e.arcTo(t,n,t+r,n,r),e.closePath()}(e,0,-LiteGraph.NODE_TITLE_HEIGHT-20,e.measureText(t).width+10,LiteGraph.NODE_TITLE_HEIGHT-10,4),e.fill(),function(e,t,n,o,i="#000",r=12,s="Inter"){e.font=`${r}px ${s}`,e.fillStyle=i,e.fillText(t,n,o)}(e,t,8,-LiteGraph.NODE_TITLE_HEIGHT-6,LiteGraph.NODE_TITLE_COLOR),e.restore()}(t,this.executionDuration||""),null==n?void 0:n.apply(this,e)}}});const Ff="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function Uf(e,t,n,o){e.addEventListener?e.addEventListener(t,n,o):e.attachEvent&&e.attachEvent("on".concat(t),n)}function zf(e,t,n,o){e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent&&e.detachEvent("on".concat(t),n)}function Vf(e,t){const n=t.slice(0,t.length-1);for(let o=0;o=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}const Wf={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Ff?173:189,"=":Ff?61:187,";":Ff?59:186,"'":222,"[":219,"]":221,"\\":220},Yf={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Zf={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Kf={16:!1,18:!1,17:!1,91:!1},Xf={};for(let by=1;by<20;by++)Wf["f".concat(by)]=111+by;let Qf=[],Jf=null,qf="all";const eh=new Map,th=e=>Wf[e.toLowerCase()]||Yf[e.toLowerCase()]||e.toUpperCase().charCodeAt(0);function nh(e){qf=e||"all"}function oh(){return qf||"all"}function ih(e){if(void 0===e)Object.keys(Xf).forEach((e=>{Array.isArray(Xf[e])&&Xf[e].forEach((e=>rh(e))),delete Xf[e]})),ch(null);else if(Array.isArray(e))e.forEach((e=>{e.key&&rh(e)}));else if("object"==typeof e)e.key&&rh(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o{let{key:t,scope:n,method:o,splitKey:i="+"}=e;Hf(t).forEach((e=>{const t=e.split(i),r=t.length,s=t[r-1],a="*"===s?"*":th(s);if(!Xf[a])return;n||(n=oh());const l=r>1?Vf(Yf,t):[],c=[];Xf[a]=Xf[a].filter((e=>{const t=(!o||e.method===o)&&e.scope===n&&function(e,t){const n=e.length>=t.length?e:t,o=e.length>=t.length?t:e;let i=!0;for(let r=0;rch(e)))}))};function sh(e,t,n,o){if(t.element!==o)return;let i;if(t.scope===n||"all"===t.scope){i=t.mods.length>0;for(const e in Kf)Object.prototype.hasOwnProperty.call(Kf,e)&&(!Kf[e]&&t.mods.indexOf(+e)>-1||Kf[e]&&-1===t.mods.indexOf(+e))&&(i=!1);(0!==t.mods.length||Kf[16]||Kf[18]||Kf[17]||Kf[91])&&!i&&"*"!==t.shortcut||(t.keys=[],t.keys=t.keys.concat(Qf),!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function ah(e,t){const n=Xf["*"];let o=e.keyCode||e.which||e.charCode;if(!lh.filter.call(this,e))return;if(93!==o&&224!==o||(o=91),-1===Qf.indexOf(o)&&229!==o&&Qf.push(o),["ctrlKey","altKey","shiftKey","metaKey"].forEach((t=>{const n=Zf[t];e[t]&&-1===Qf.indexOf(n)?Qf.push(n):!e[t]&&Qf.indexOf(n)>-1?Qf.splice(Qf.indexOf(n),1):"metaKey"===t&&e[t]&&3===Qf.length&&(e.ctrlKey||e.shiftKey||e.altKey||(Qf=Qf.slice(Qf.indexOf(n))))})),o in Kf){Kf[o]=!0;for(const e in Yf)Yf[e]===o&&(lh[e]=!0);if(!n)return}for(const a in Kf)Object.prototype.hasOwnProperty.call(Kf,a)&&(Kf[a]=e[Zf[a]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===Qf.indexOf(17)&&Qf.push(17),-1===Qf.indexOf(18)&&Qf.push(18),Kf[17]=!0,Kf[18]=!0);const i=oh();if(n)for(let a=0;a1&&(i=Vf(Yf,e)),(e="*"===(e=e[e.length-1])?"*":th(e))in Xf||(Xf[e]=[]),Xf[e].push({keyup:l,keydown:c,scope:r,mods:i,shortcut:o[a],method:n,key:o[a],splitKey:u,element:s});if(void 0!==s&&window){if(!eh.has(s)){const e=function(){return ah(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event,s)},t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event;ah(e,s),function(e){let t=e.keyCode||e.which||e.charCode;const n=Qf.indexOf(t);if(n>=0&&Qf.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&Qf.splice(0,Qf.length),93!==t&&224!==t||(t=91),t in Kf){Kf[t]=!1;for(const e in Yf)Yf[e]===t&&(lh[e]=!1)}}(e)};eh.set(s,{keydownListener:e,keyupListenr:t,capture:d}),Uf(s,"keydown",e,d),Uf(s,"keyup",t,d)}if(!Jf){const e=()=>{Qf=[]};Jf={listener:e,capture:d},Uf(window,"focus",e,d)}}}function ch(e){const t=Object.values(Xf).flat();if(t.findIndex((t=>{let{element:n}=t;return n===e}))<0){const{keydownListener:t,keyupListenr:n,capture:o}=eh.get(e)||{};t&&n&&(zf(e,"keyup",n,o),zf(e,"keydown",t,o),eh.delete(e))}if(t.length<=0||eh.size<=0){if(Object.keys(eh).forEach((e=>{const{keydownListener:t,keyupListenr:n,capture:o}=eh.get(e)||{};t&&n&&(zf(e,"keyup",n,o),zf(e,"keydown",t,o),eh.delete(e))})),eh.clear(),Object.keys(Xf).forEach((e=>delete Xf[e])),Jf){const{listener:e,capture:t}=Jf;zf(window,"focus",e,t),Jf=null}}}const uh={getPressedKeyString:function(){return Qf.map((e=>{return t=e,Object.keys(Wf).find((e=>Wf[e]===t))||(e=>Object.keys(Yf).find((t=>Yf[t]===e)))(e)||String.fromCharCode(e);var t}))},setScope:nh,getScope:oh,deleteScope:function(e,t){let n,o;e||(e=oh());for(const i in Xf)if(Object.prototype.hasOwnProperty.call(Xf,i))for(n=Xf[i],o=0;o{let{element:t}=e;return ch(t)}))}else o++;oh()===e&&nh(t||"all")},getPressedKeyCodes:function(){return Qf.slice(0)},getAllKeyCodes:function(){const e=[];return Object.keys(Xf).forEach((t=>{Xf[t].forEach((t=>{let{key:n,scope:o,mods:i,shortcut:r}=t;e.push({scope:o,shortcut:r,mods:i,keys:n.split("+").map((e=>th(e)))})}))})),e},isPressed:function(e){return"string"==typeof e&&(e=th(e)),-1!==Qf.indexOf(e)},filter:function(e){const t=e.target||e.srcElement,{tagName:n}=t;let o=!0;const i="INPUT"===n&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(i||"TEXTAREA"===n||"SELECT"===n)&&!t.readOnly)&&(o=!1),o},trigger:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(Xf).forEach((n=>{Xf[n].filter((n=>n.scope===t&&n.shortcut===e)).forEach((e=>{e&&e.method&&e.method()}))}))},unbind:ih,keyMap:Wf,modifier:Yf,modifierMap:Zf};for(const by in uh)Object.prototype.hasOwnProperty.call(uh,by)&&(lh[by]=uh[by]);if("undefined"!=typeof window){const e=window.hotkeys;lh.noConflict=t=>(t&&window.hotkeys===lh&&(window.hotkeys=e),lh),window.hotkeys=lh}let dh=null;y.registerExtension({name:"Comfy.EasyUse.HotKeys",setup(){if(void 0!==lh){lh("up,down,left,right",(function(e,t){var n,o,i,r,s,a,l,c,u,d,p,f,h,m,g;e.preventDefault();if(!A("EasyUse.Hotkeys.JumpNearestNodes",null,!0))return;const v=Ap();if(0===v.length)return;const y=v[0];switch(t.key){case"up":case"left":let e=null;if(Np(y)){const e=null==(n=y.widgets_values)?void 0:n[0],t=null==(o=y.graph)?void 0:o._nodes,i=null==t?void 0:t.find((t=>{var n;if(Pp(t)){if((null==(n=t.widgets_values)?void 0:n[0])===e)return t}return null}));i&&Op(i)}else if((null==(i=y.inputs)?void 0:i.length)>0){for(let t=0;t{var n;if(Np(t)){if((null==(n=t.widgets_values)?void 0:n[0])===e)return t}return null}));n&&Op(n)}else if((null==(d=y.outputs)?void 0:d.length)>0){for(let e=0;e0&&y.outputs[e].links[0]){t=y.outputs[e].links[0];break}if(t){const e=null==(f=y.graph)?void 0:f.links;if(e[t]){const n=null==(h=e[t])?void 0:h.target_id,o=null==(g=null==(m=y.graph)?void 0:m._nodes_by_id)?void 0:g[n];o&&Op(o)}}}}})),lh("shift+up,shift+down,shift+left,shift+right",(function(e,t){e.preventDefault();if(!A("EasyUse.Hotkeys.AlignSelectedNodes",null,!0))return;const n=Ap();if(n.length<=1)return;const o=n;switch(t.key){case"shift+up":LGraphCanvas.alignNodes(o,"top",o[0]);break;case"shift+down":LGraphCanvas.alignNodes(o,"bottom",o[0]);break;case"shift+left":LGraphCanvas.alignNodes(o,"left",o[0]);break;case"shift+right":LGraphCanvas.alignNodes(o,"right",o[0])}dh||(dh=np()),dh&&dh.update()})),lh("shift+g",(function(e,t){e.preventDefault();A("EasyUse.Hotkeys.AddGroup",null,!0)&&(fh(),dh||(dh=np()),dh&&dh.update())}));const e=[];Array.from(Array(10).keys()).forEach((t=>e.push(`alt+${t}`))),lh(e.join(","),(async function(e,t){e.preventDefault();if(!A("EasyUse.Hotkeys.NodesTemplate",null,!0))return;const n=t.key;let o=parseInt(n.split("+")[1]);const i=await b.getUserData("comfy.templates.json");let r=null;if(200==i.status)try{r=await i.json()}catch(a){Fp.error(V("Get Node Templates File Failed"))}else localStorage["Comfy.NodeTemplates"]?r=JSON.parse(localStorage["Comfy.NodeTemplates"]):Fp.warn(V("No Node Templates Found"));if(!r)return void Fp.warn(V("No Node Templates Found"));o=0===o?9:o-1;const s=r[o];if(s)try{const e=(null==s?void 0:s.name)||"Group",t=(null==s?void 0:s.data)?JSON.parse(s.data):[];ph((async()=>{await k.registerFromWorkflow(t.groupNodes,{}),localStorage.litegrapheditor_clipboard=s.data,y.canvas.pasteFromClipboard(),t.groupNodes||fh(e)}))}catch(a){Fp.error(a)}else Fp.warn(V("Node template with {key} not set").replace("{key}",n))}));const t=async function(e){if(("b"===e.key||"m"==e.key)&&(e.metaKey||e.ctrlKey)){if(0===Ap().length)return;dh||(dh=np()),dh&&dh.update()}};window.addEventListener("keydown",t,!0)}}});const ph=async e=>{const t=localStorage.litegrapheditor_clipboard;await e(),localStorage.litegrapheditor_clipboard=t},fh=e=>{const t=Ap();if(0===t.length)return;const n=t;let o=new LiteGraph.LGraphGroup;o.title=e||"Group",((e,t=[],n=20)=>{var o,i,r,s,a,l,c,u,d,p;for(var f of(i=r=s=a=-1,l=c=u=d=-1,[e._nodes,t]))for(var h in f)l=(p=f[h]).pos[0],c=p.pos[1],u=p.pos[0]+p.size[0],d=p.pos[1]+p.size[1],"Reroute"!=p.type&&(c-=LiteGraph.NODE_TITLE_HEIGHT),(null==(o=p.flags)?void 0:o.collapsed)&&(d=c+LiteGraph.NODE_TITLE_HEIGHT,(null==p?void 0:p._collapsed_width)&&(u=l+Math.round(p._collapsed_width))),(-1==i||ls)&&(s=u),(-1==a||d>a)&&(a=d);r-=Math.round(1.4*e.font_size),e.pos=[i-n,r-n],e.size=[s-i+2*n,a-r+2*n]})(o,n),y.canvas.graph.add(o)};function hh(e,t,n,o){const i=[];return e.workflow.links.forEach((e=>{n&&e[1]===t&&!i.includes(e[3])&&i.push(e[3]),o&&e[3]===t&&!i.includes(e[1])&&i.push(e[1])})),i}async function mh(e,t=!1){const n=structuredClone(await y.graphToPrompt()),o=[];if(n.workflow.nodes.forEach((e=>{o.push(e.id)})),n.workflow.links=n.workflow.links.filter((e=>o.includes(e[1])&&o.includes(e[3]))),t)for(;!y.graph._nodes_by_id[e].isChooser;)e=hh(n,e,!0,!1)[0];const i=function(e,t){const n=[],o=[t];for(;o.length>0;){const t=o.pop();n.push(t),o.push(...hh(e,t,!0,!1).filter((e=>!(n.includes(e)||o.includes(e)))))}o.push(...n.filter((e=>e!=t)));const i=[t];for(;o.length>0;){const t=o.pop();i.push(t),o.push(...hh(e,t,!1,!0).filter((e=>!(i.includes(e)||o.includes(e)))))}const r=[];return r.push(...n),r.push(...i.filter((e=>!r.includes(e)))),r}(n,e);n.workflow.nodes=n.workflow.nodes.filter((t=>(t.id===e&&t.inputs.forEach((e=>{e.link=null})),i.includes(t.id)))),n.workflow.links=n.workflow.links.filter((e=>i.includes(e[1])&&i.includes(e[3])));const r={};for(const[l,c]of Object.entries(n.output))i.includes(parseInt(l))&&(r[l]=c);const s={};for(const[l,c]of Object.entries(r[e.toString()].inputs))Array.isArray(c)||(s[l]=c);r[e.toString()].inputs=s,n.output=r;const a=y.graphToPrompt;y.graphToPrompt=()=>(y.graphToPrompt=a,n),y.queuePrompt(0)}const gh=new class{constructor(){this.current_node_id=void 0,this.class_of_current_node=null,this.current_node_is_chooser=!1}update(){var e,t;return y.runningNodeId!=this.current_node_id&&(this.current_node_id=y.runningNodeId,this.current_node_id?(this.class_of_current_node=null==(t=null==(e=y.graph)?void 0:e._nodes_by_id[y.runningNodeId.toString()])?void 0:t.comfyClass,this.current_node_is_chooser="easy imageChooser"===this.class_of_current_node):(this.class_of_current_node=void 0,this.current_node_is_chooser=!1),!0)}},vh=class e{constructor(){}static idle(){return!y.runningNodeId}static paused(){return!0}static paused_here(t){return e.here(t)}static running(){return!e.idle()}static here(e){return y.runningNodeId==e}static state(){return"Paused"}};v(vh,"cancelling",!1);let yh=vh;function bh(e,t){const n=new FormData;n.append("message",t),n.append("id",e),b.fetchApi("/easyuse/image_chooser_message",{method:"POST",body:n})}function _h(){bh(-1,"__cancel__"),yh.cancelling=!0,b.interrupt(),yh.cancelling=!1}var wh=0;function Sh(){wh+=1}const xh=["easy kSampler","easy kSamplerTiled","easy fullkSampler"];function kh(e){const t=y.graph._nodes_by_id[e.detail.id];if(t){t.selected=new Set,t.anti_selected=new Set;const n=function(e,t){var n;return e.imgs=[],t.forEach((t=>{const n=new Image;e.imgs.push(n),n.onload=()=>{y.graph.setDirtyCanvas(!0)},n.src=`/view?filename=${encodeURIComponent(t.filename)}&type=temp&subfolder=${y.getPreviewFormatParam()}`})),null==(n=e.setSizeForImage)||n.call(e),e.imgs}(t,e.detail.urls);return{node:t,image:n,isKSampler:xh.includes(t.type)}}}function Ch(e,t,n){var o;if(e.imageRects)o=e.imageRects[t];else{const t=e.imagey;o=[1,t+1,e.size[0]-2,e.size[1]-t-2]}n.strokeRect(o[0]+1,o[1]+1,o[2]-2,o[3]-2)}class Ah extends w{constructor(){super(),this.node=null,this.select_index=[],this.dialog_div=null}show(e,t){this.select_index=[],this.node=t;const n=e.map(((e,n)=>{const o=_("img",{src:e.src,onclick:e=>{this.select_index.includes(n)?(this.select_index=this.select_index.filter((e=>e!==n)),o.classList.remove("selected")):(this.select_index.push(n),o.classList.add("selected")),t.selected.has(n)?t.selected.delete(n):t.selected.add(n)}});return o}));super.show(_("div.comfyui-easyuse-chooser-dialog",[_("h5.comfyui-easyuse-chooser-dialog-title",V("Choose images to continue")),_("div.comfyui-easyuse-chooser-dialog-images",n)]))}createButtons(){const e=super.createButtons();return e[0].onclick=e=>{yh.running()&&_h(),super.close()},e.unshift(_("button",{type:"button",textContent:V("Choose Selected Images"),onclick:e=>{bh(this.node.id,[...this.node.selected,-1,...this.node.anti_selected]),yh.idle()&&(Sh(),mh(this.node.id).then((()=>{bh(this.node.id,[...this.node.selected,-1,...this.node.anti_selected])}))),super.close()}})),e}}function Eh(){const e=y.graph._nodes_by_id[this.node_id];if(e){const t=[...e.selected];(null==t?void 0:t.length)>0&&e.setProperty("values",t),bh(e.id,[...e.selected,-1,...e.anti_selected]),yh.idle()&&(Sh(),mh(e.id).then((()=>{bh(e.id,[...e.selected,-1,...e.anti_selected])})))}}function Oh(){yh.running()&&_h()}function Lh(e){Object.defineProperty(e,"clicked",{get:function(){return this._clicked},set:function(e){this._clicked=e&&""!=this.name}})}function Th(e){e.options||(e.options={}),e.options.serialize=!1}y.registerExtension({name:"Comfy.EasyUse.imageChooser",init(){window.addEventListener("beforeunload",_h,!0)},setup(e){const t=LGraphCanvas.prototype.draw;LGraphCanvas.prototype.draw=function(){gh.update()&&e.graph._nodes.forEach((e=>{e.update&&e.update()})),t.apply(this,arguments)},b.addEventListener("easyuse-image-choose",(function(e){const{node:t,image:n,isKSampler:o}=kh(e);if(o){(new Ah).show(n,t)}}));const n=b.interrupt;b.interrupt=function(){yh.cancelling||_h(),n.apply(this,arguments)},b.addEventListener("execution_start",(function(){(wh>0?(wh-=1,0):(bh(-1,"__start__"),1))&&e.graph._nodes.forEach((e=>{(e.selected||e.anti_selected)&&(e.selected.clear(),e.anti_selected.clear(),e.update())}))}))},async nodeCreated(e,t){if("easy imageChooser"==e.comfyClass){e.setProperty("values",[]),void 0===(null==e?void 0:e.imageIndex)&&Object.defineProperty(e,"imageIndex",{get:function(){return null},set:function(t){e.overIndex=t}}),void 0===(null==e?void 0:e.imagey)&&Object.defineProperty(e,"imagey",{get:function(){return null},set:function(t){return e.widgets[e.widgets.length-1].last_y+LiteGraph.NODE_WIDGET_HEIGHT}});const t=e.onMouseDown;e.onMouseDown=function(n,o,i){if(n.isPrimary){const t=function(e,t){var n,o;if((null==(n=e.imgs)?void 0:n.length)>1)for(var i=0;i0&&n0&&oe.imagey)return 0;return-1}(e,o);t>=0&&this.imageClicked(t)}return t&&t.apply(this,arguments)},e.send_button_widget=e.addWidget("button","","",Eh),e.cancel_button_widget=e.addWidget("button","","",Oh),Lh(e.cancel_button_widget),Lh(e.send_button_widget),Th(e.cancel_button_widget),Th(e.send_button_widget)}},beforeRegisterNodeDef(e,t,n){if("easy imageChooser"==(null==t?void 0:t.name)){const t=e.prototype.onDrawBackground;e.prototype.onDrawBackground=function(e){t.apply(this,arguments),function(e,t){var n,o;if(e.imgs){if(e.imageRects)for(let n=0;n{Ch(e,n,t)})),t.strokeStyle="#F88",null==(o=null==e?void 0:e.anti_selected)||o.forEach((n=>{Ch(e,n,t)}))}}(this,e)},e.prototype.imageClicked=function(t){"easy imageChooser"===(null==e?void 0:e.comfyClass)&&(this.selected.has(t)?this.selected.delete(t):this.selected.add(t),this.update())};const n=e.prototype.update;e.prototype.update=function(){var e;if(n&&n.apply(this,arguments),this.send_button_widget){this.send_button_widget.node_id=this.id;const t=(this.selected?this.selected.size:0)+(this.anti_selected?this.anti_selected.size:0),n=(null==(e=this.imgs)?void 0:e.length)||0;yh.paused_here(this.id)&&t>0?this.send_button_widget.name=t>1?"Progress selected ("+t+"/"+n+")":"Progress selected image":this.send_button_widget.name=t>0?t>1?"Progress selected ("+t+"/"+n+")":"Progress selected image as restart":""}if(this.cancel_button_widget){const e=yh.running();this.cancel_button_widget.name=e?"Cancel current run":""}this.setDirtyCanvas(!0,!0)}}}}),Number.prototype.div=function(e){return function(e,t){let n,o,i=0,r=0,s="string"==typeof e?e:e.toString(),a="string"==typeof t?t:t.toString();try{i=s.toString().split(".")[1].length}catch(l){}try{r=a.toString().split(".")[1].length}catch(l){}return n=Number(s.toString().replace(".","")),o=Number(a.toString().replace(".","")),n/o*Math.pow(10,r-i)}(this,e)};let Ih=[],Nh=0;const Ph={sd3:6.5,"sd3-turbo":4};class Dh extends w{constructor(){super(),this.lists=[],this.dialog_div=null,this.user_div=null}addItem(e,t){return _("div.easyuse-account-dialog-item",[_("input",{type:"text",placeholder:"Enter name",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Ih[t].name=e.target.value},value:Ih[e].name}),_("input.key",{type:"text",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Ih[t].key=e.target.value},placeholder:"Enter APIKEY",value:Ih[e].key}),_("button.choose",{textContent:V("Choose"),onclick:async e=>{var n,o,i;const r=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);let s=Ih[r].name,a=Ih[r].key;if(!s)return void Fp.error(V("Please enter the account name"));if(!a)return void Fp.error(V("Please enter the APIKEY"));let l=!0;for(let t=0;t{(new Dh).show(t)}},[_("div.user",[_("div.avatar",r?[_("img",{src:r})]:"😀"),_("div.info",[_("h5.name",s),_("h6.remark","Credits: "+a)])]),_("div.edit",{textContent:V("Edit")})])),Fp.success(V("Save Succeed"))}else Fp.success(V("Save Succeed"));this.close()}else Fp.error(V("Save Failed"))}}),_("button.delete",{textContent:V("Delete"),onclick:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Ih.length<=1?Fp.error(V("At least one account is required")):(Ih.splice(t,1),this.dialog_div.removeChild(e.target.parentNode))}})])}show(e){Ih.forEach(((t,n)=>{this.lists.push(this.addItem(n,e))})),this.dialog_div=_("div.easyuse-account-dialog",this.lists),super.show(_("div.easyuse-account-dialog-main",[_("div",[_("a",{href:"https://platform.stability.ai/account/keys",target:"_blank",textContent:V("Getting Your APIKEY")})]),this.dialog_div]))}createButtons(){const e=super.createButtons();return e.unshift(_("button",{type:"button",textContent:V("Save Account Info"),onclick:e=>{let t=!0;for(let n=0;n{200==e.status?Fp.success(V("Save Succeed")):Fp.error(V("Save Failed"))}))}else Fp.error(V("APIKEY is not Empty"))}})),e.unshift(_("button",{type:"button",textContent:V("Add Account"),onclick:e=>{const t="Account "+Ih.length.toString();Ih.push({name:t,key:""});const n=this.addItem(Ih.length-1);this.lists.push(n),this.dialog_div.appendChild(n)}})),e}}y.registerExtension({name:"Comfy.EasyUse.API.SD3",async beforeRegisterNodeDef(e,t,n){if("easy stableDiffusion3API"==t.name){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=async function(){var e,n,o;t&&(null==t||t.apply(this,arguments));const i=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),r=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));let s=this.widgets.find((e=>"model"==e.name));s.callback=e=>{a.value="-"+Ph[e]};const a=this.addWidget("text","cost_credit","0",(e=>{}),{serialize:!1});a.disabled=!0,setTimeout((e=>{"control_before_generate"==r.name&&0===i.value&&(i.value=Math.floor(4294967294*Math.random())),a.value="-"+Ph[s.value]}),100);let l=_("div.easyuse-account-user",[V("Loading UserInfo...")]);this.addDOMWidget("account","btn",_("div.easyuse-account",l)),b.addEventListener("stable-diffusion-api-generate-succeed",(async({detail:e})=>{var t;let n=l.querySelectorAll(".remark");if(n&&n[0]){const t=(null==e?void 0:e.model)?Ph[e.model]:0;if(t){let e=function(e,t){let n,o,i,r,s,a;s="string"==typeof e?e:e.toString(),a="string"==typeof t?t:t.toString();try{n=s.split(".")[1].length}catch(l){n=0}try{o=a.split(".")[1].length}catch(l){o=0}return i=Math.pow(10,Math.max(n,o)),r=n>=o?n:o,((e*i-t*i)/i).toFixed(r)}(parseFloat(n[0].innerText.replace(/Credits: /g,"")),t);e>0&&(n[0].innerText="Credits: "+e.toString())}}await W(1e4);const o=await b.fetchApi("/easyuse/stability/balance");if(200==o.status){const e=await o.json();if(null==e?void 0:e.balance){const o=(null==(t=e.balance)?void 0:t.credits)||0;n&&n[0]&&(n[0].innerText="Credits: "+o)}}}));const c=await b.fetchApi("/easyuse/stability/api_keys");if(200==c.status){let t=await c.json();if(Ih=t.keys,Nh=t.current,Ih.length>0&&void 0!==Nh){const t=Ih[Nh].key,i=Ih[Nh].name;if(t){const t=await b.fetchApi("/easyuse/stability/user_info");if(200==t.status){const i=await t.json();if((null==i?void 0:i.account)&&(null==i?void 0:i.balance)){const t=(null==(e=i.account)?void 0:e.profile_picture)||null,r=(null==(n=i.account)?void 0:n.email)||null,s=(null==(o=i.balance)?void 0:o.credits)||0;l.replaceChildren(_("div.easyuse-account-user-info",{onclick:e=>{(new Dh).show(l)}},[_("div.user",[_("div.avatar",t?[_("img",{src:t})]:"😀"),_("div.info",[_("h5.name",r),_("h6.remark","Credits: "+s)])]),_("div.edit",{textContent:V("Edit")})]))}}}else l.replaceChildren(_("div.easyuse-account-user-info",{onclick:e=>{(new Dh).show(l)}},[_("div.user",[_("div.avatar","😀"),_("div.info",[_("h5.name",i),_("h6.remark",V("Click to set the APIKEY first"))])]),_("div.edit",{textContent:V("Edit")})]))}}}}}});let jh=null;function Mh(){jh&&(jh.removeEventListeners(),jh.dropdown.remove(),jh=null)}function Rh(e,t,n,o=!1){Mh(),new $h(e,t,n,o)}class $h{constructor(e,t,n,o=!1){this.dropdown=document.createElement("ul"),this.dropdown.setAttribute("role","listbox"),this.dropdown.classList.add("easy-dropdown"),this.selectedIndex=-1,this.inputEl=e,this.suggestions=t,this.onSelect=n,this.isDict=o,this.focusedDropdown=this.dropdown,this.buildDropdown(),this.onKeyDownBound=this.onKeyDown.bind(this),this.onWheelBound=this.onWheel.bind(this),this.onClickBound=this.onClick.bind(this),this.addEventListeners()}buildDropdown(){this.isDict?this.buildNestedDropdown(this.suggestions,this.dropdown):this.suggestions.forEach(((e,t)=>{this.addListItem(e,t,this.dropdown)}));const e=this.inputEl.getBoundingClientRect();this.dropdown.style.top=e.top+e.height-10+"px",this.dropdown.style.left=e.left+"px",document.body.appendChild(this.dropdown),jh=this}buildNestedDropdown(e,t){let n=0;Object.keys(e).forEach((o=>{const i=e[o];if("object"==typeof i&&null!==i){const e=document.createElement("ul");e.setAttribute("role","listbox"),e.classList.add("easy-nested-dropdown");const r=document.createElement("li");r.classList.add("folder"),r.textContent=o,r.appendChild(e),r.addEventListener("mouseover",this.onMouseOver.bind(this,n,t)),t.appendChild(r),this.buildNestedDropdown(i,e),n+=1}else{const e=document.createElement("li");e.classList.add("item"),e.setAttribute("role","option"),e.textContent=o,e.addEventListener("mouseover",this.onMouseOver.bind(this,n,t)),e.addEventListener("mousedown",this.onMouseDown.bind(this,o)),t.appendChild(e),n+=1}}))}addListItem(e,t,n){const o=document.createElement("li");o.setAttribute("role","option"),o.textContent=e,o.addEventListener("mouseover",this.onMouseOver.bind(this,t)),o.addEventListener("mousedown",this.onMouseDown.bind(this,e)),n.appendChild(o)}addEventListeners(){document.addEventListener("keydown",this.onKeyDownBound),this.dropdown.addEventListener("wheel",this.onWheelBound),document.addEventListener("click",this.onClickBound)}removeEventListeners(){document.removeEventListener("keydown",this.onKeyDownBound),this.dropdown.removeEventListener("wheel",this.onWheelBound),document.removeEventListener("click",this.onClickBound)}onMouseOver(e,t){t&&(this.focusedDropdown=t),this.selectedIndex=e,this.updateSelection()}onMouseOut(){this.selectedIndex=-1,this.updateSelection()}onMouseDown(e,t){t.preventDefault(),this.onSelect(e),this.dropdown.remove(),this.removeEventListeners()}onKeyDown(e){const t=Array.from(this.focusedDropdown.children),n=t[this.selectedIndex];if(jh)if(38===e.keyCode)e.preventDefault(),this.selectedIndex=Math.max(0,this.selectedIndex-1),this.updateSelection();else if(40===e.keyCode)e.preventDefault(),this.selectedIndex=Math.min(t.length-1,this.selectedIndex+1),this.updateSelection();else if(39===e.keyCode){if(e.preventDefault(),n&&n.classList.contains("folder")){const e=n.querySelector(".easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=0,this.updateSelection())}}else if(37===e.keyCode&&this.focusedDropdown!==this.dropdown){const e=this.focusedDropdown.closest(".easy-dropdown, .easy-nested-dropdown").parentNode.closest(".easy-dropdown, .easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=Array.from(e.children).indexOf(this.focusedDropdown.parentNode),this.updateSelection())}else if((13===e.keyCode||9===e.keyCode)&&this.selectedIndex>=0){e.preventDefault(),n.classList.contains("item")&&(this.onSelect(t[this.selectedIndex].textContent),this.dropdown.remove(),this.removeEventListeners());const o=n.querySelector(".easy-nested-dropdown");o&&(this.focusedDropdown=o,this.selectedIndex=0,this.updateSelection())}else 27===e.keyCode&&(this.dropdown.remove(),this.removeEventListeners())}onWheel(e){const t=parseInt(this.dropdown.style.top);localStorage.getItem("Comfy.Settings.Comfy.InvertMenuScrolling")?this.dropdown.style.top=t+(e.deltaY<0?10:-10)+"px":this.dropdown.style.top=t+(e.deltaY<0?-10:10)+"px"}onClick(e){this.dropdown.contains(e.target)||e.target===this.inputEl||(this.dropdown.remove(),this.removeEventListeners())}updateSelection(){Array.from(this.focusedDropdown.children).forEach(((e,t)=>{t===this.selectedIndex?e.classList.add("selected"):e.classList.remove("selected")}))}}function Gh(e){const t=e.min||0,n=e.max||0,o=e.step||1;if(0===o)return[];const i=[];let r=t;for(;r<=n;){if(Number.isInteger(o))i.push(Math.round(r)+"; ");else{let e=r.toFixed(3);-0==e&&(e="0.000"),/\.\d{3}$/.test(e)||(e+="0"),i.push(e+"; ")}r+=o}return n>=0&&t>=0?i:i.reverse()}let Bh={},Fh={};function Uh(e,t){String(e.id);const n=t.name,o=t.value.replace(/^(loader|preSampling):\s/,"");Fh[n]?Fh[n]!=Bh[o]&&(Fh[n]=Bh[o]):Fh={...Fh,[n]:Bh[o]}}y.registerExtension({name:"Comfy.EasyUse.XYPlot",async beforeRegisterNodeDef(e,t,n){if("easy XYPlot"===t.name){Bh=t.input.hidden.plot_dict[0];for(const e in Bh){const t=Bh[e];if(Array.isArray(t)){let n=[];for(const e of t)n.push(e+"; ");Bh[e]=n}else Bh[e]="object"==typeof t?"seed"==e?t+"; ":Gh(t):t+"; "}Bh.None=[],Bh["---------------------"]=[]}},nodeCreated(e){"easy XYPlot"===e.comfyClass&&(function(e){if(e.widgets)for(const t of e.widgets)if("x_axis"===t.name||"y_axis"===t.name){let n=t.value;Object.defineProperty(t,"value",{get:()=>n,set(o){o!==n&&(n=o,Uh(e,t))}})}}(e),function(e){if(e.widgets){const t=e.widgets.filter((e=>"customtext"===e.type&&!1!==e.dynamicPrompts||e.dynamicPrompts));for(const e of t){let t=function(e,t,o,i){return e&&(t[o]=e),t.map((e=>n(e,i))).filter((e=>""!==e)).join("")},n=function(e,t){if(e=o(e),i(e,t))return e+"; ";let n=r(e,t);return 1===n.length||2===n.length?n[0]:i(s(e),t)?s(e)+"; ":""},o=function(e){return e.replace(/(\n|;| )/g,"")},i=function(e,t){return t.includes(e+"; ")},r=function(e,t){return t.filter((t=>t.toLowerCase().includes(e.toLowerCase())))},s=function(e){return Number(e)?Number(e).toFixed(3):["0","0.","0.0","0.00","00"].includes(e)?"0.000":e};const a=function(){const n=e.name[0]+"_axis";let o=(null==Fh?void 0:Fh[n])||[];if(0===o.length)return;const i=e.inputEl.value,r=e.inputEl.selectionStart;let s=i.split("; ");const a=i.substring(0,r).split("; ").length-1,l=s[a].replace(/\n/g,"").toLowerCase(),c=o.filter((e=>e.toLowerCase().includes(l))).map((e=>e.replace(/; /g,"")));if(c.length>0)Rh(e.inputEl,c,(n=>{const i=t(n,s,a,o);e.inputEl.value=i}));else{Mh();const n=t(null,s,a,o);e.inputEl.value=n}};e.inputEl.removeEventListener("input",a),e.inputEl.addEventListener("input",a),e.inputEl.removeEventListener("mouseup",a),e.inputEl.addEventListener("mouseup",a)}}}(e))}});const zh=_s("graphStore",{state:e=>({selectors:[],selectors_styles:{},seg_selectors:[],slider_controls:[]}),actions:{setSelectors(e){this.selectors=tp(e)},setStyles(e,t){this.selectors_styles[e]||(this.selectors_styles[e]=t)},setSegSelectors(e){this.seg_selectors=tp(e)},setSliderControls(e){this.slider_controls=tp(e)}}}),Vh=["data-id"],Hh=[Zi("i",{class:"mdi mdi-trash-can"},null,-1)],Wh=Zi("i",{class:"mdi mdi-magnify"},null,-1),Yh=["placeholder"],Zh=["onMouseenter","onMouseleave"],Kh=["onClick"],Xh=["name","checked"],Qh=["src"],Jh={key:0},qh=Zi("span",{class:"comfyui-easyuse-success"},"positive:",-1),em={key:1},tm=Zi("span",{class:"comfyui-easyuse-error"},"negative:",-1),nm="comfyui-easyuse-selector",om={__name:"stylesSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selectedStyles:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["chooseStyle"],setup(e,{emit:t}){const n=e,o=zh(),{selectors_styles:i}=ws(o),r=pn([]);bi((e=>n.type),(async e=>{r.value=[],e&&await(async e=>{if(i.value[n.type])return!0;const t=await b.fetchApi(`/easyuse/prompt/styles?name=${e}`);if(200===t.status){let e=(await t.json()).map(((e,t)=>(e.index=t,e)));return await o.setStyles(n.type,e),!0}return Fp.error(V("Get styles list Failed")),!1})(e)&&a()}),{immediate:!0});const s=t,a=e=>{const t=n.selectedStyles,o=tp(i.value[n.type]);r.value=o.sort(((e,t)=>e.index-t.index)).sort(((e,n)=>t.includes(n.name)-t.includes(e.name)))},l=pn(""),c=e=>e.toLowerCase(),u=Xt({}),d=e=>{u.src="",u.name="",u.positive="",u.negative=""},p=async e=>{const t=await b.fetchApi(`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`);if(200===t.status){const o=await t.text();if(o.startsWith("http"))return o;return`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`}},f=e=>{e.target.src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QNLaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuMSAoMjAyMzA5MDUubS4yMzE2IDk3OWM4NmQpICAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjA3NEU1QzNCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjA3NEU1QzRCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGMDc0RTVDMUI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGMDc0RTVDMkI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHB8fHx8fHx8fHx8BBwcHDQwNGBAQGBoVERUaHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fH//AABEIAIAAgAMBEQACEQEDEQH/xACLAAEAAgMBAQEAAAAAAAAAAAAABAUCAwYBBwgBAQADAQEBAAAAAAAAAAAAAAABAgMEBQYQAAEEAgECAwUHAwUAAAAAAAEAAgMEEQUhEgYxEwdBYSIyFFFxgVJyIxWRoTOxwdFiJBEBAAICAQQBBAIDAAAAAAAAAAECEQMxIUESBBOB0SIyUXGCIwX/2gAMAwEAAhEDEQA/AP1SgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDXJYgj+d4afsVopM8KWvEcy8it1pXdMcjXO/Lnn+im2u0cwV2VniW1UXEBAQEBAQEBAQEBAQRNlc+mgyDh7zhv+5WunX5Sw37fCHM2dh48r06ank7N6rn2Ja7qa4hw5BBwQV010uK+/DsO29v/J68SOI86Jxjl95HIP4gryPc0fHfHaXu+j7Py68zzHSVquV2iAgICAgICAgICDyTr6HdHz4PTnwypjnqic46OauNbY6mGX99p+L8w9xaeV6OufHt0eXtr59M9VFb194E9LmuH3kf6rv17avO2ets7YVcuuuk/uOa3PgBlxP4BdMbq9nLPqbJ5xDbSM9azFXpyujuSO+Bo5kcf0NPyj25We2YtEzaPxdfr6519Kz+UvqEIlELBKQZQ0eYRwC7HOPxXzVsZ6cPpK5x15ZKEiAgICAgICAgICCNc1tG40CzA2XHg4j4h9zhyFpr22p+s4Z7NNL/ALRlTX+1dVFBJOJrcTI2lxZHYcBx+sldWv3bzOMVn6fZy39OkRnNo+v3aoOx9JOxks8tqwHDPS+1IW8+IzGWZVrf9DZHSMR/j9yvo656zMz9V1rdLqdYwsoVIqwd87mNAc79Tvmd+JXJt332ftMy6temlP1jCasmggICAgICAgICAgwlmiib1SPDB7zhWrWZ4VtaI5QXb2l5ojYHvLjjIGB/dbR61sZlhPtVziFb3PYdd0luCvAZbXludVZ1huZQPgyTx4/atvWj4rxaZ6d/6Ye1/t1zSI6zx/bzti5YqaOpBeg8u41n/oa14cA4ccH7lPs1jZebVn8eyPUtOrXFbR+XdYx9xa90pjeXROaSCXDj+oysZ9S+Mx1bR7uvOJ6LGOWKVgfG8PafAtOQueazHLqraJjMMlCRAQEBAQEBAQRLNp4HTFx/2/4WtKR3Y32T2Udl8j3knk/aeSu6kREPPvaZlpY3DmyY8DyrzPZWv8tkvmFv7bg12RyR1DGeeMj2KnjE9JaeUx1hi1sgaet/U7JIOMcE8Dj7FMREcK2zPKMasr5XO6fmOVt5xEOadVplYU45IAOhxa72kLm2TFuXXqrNeF1WtlwDZeHfmHguO+vHDupszylLJsICAgICAg8cMjCQiYR5IVpFmc1Q5qLXHPgfbhbV2MLaYlqNQAYA4V/kV+PDA1fcp81fjYurtYMu4CmLZRNYhtZWBAI8CqzdaKN8df3LObtIokxwe5ZzZrFUloIGFnLWHqhIgICAgICAgxMbSpyjDAwAq3kr4MTWCnzR4MX02PGHDISNmETqieWba7QABwB4KJumKNgjaFXK0VZYChYQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEHzvuv1G7k1W9s6/Xamtaq15oaonmnsCR008HntaI4K8/s4HOeEGXZXqTud7uqtG7r6kNa5HdMU9aaw9zZde+FkrHsnr1+M2MZBPIKDRe9cO2K2mjs/V0m7X61lWzq32W+ZFEbfkSSO4B+GL9zw4QWm99TqFVmjsaSu7fUtxeNM2aTmSMBbHI9zWHqHVJlnDTxjPKCJL6sea502t1D7Ouhr0rNqxNM2CSNuwnkgjAi6ZOotdEc/Egibf1j/j+7JNL9DWdWg84TWn2ywtdFKyMZb5Tg0nLyG55x48IJ3bXqe/ea/a26dFtyTXtldDUqyOdNL5VqaDHS5gwXRxMe3xz1Y9iDKP1Sa7uefUnR7TyYqUVoEU5jY6pJZIz1RY4ZiMYd7TkexBA749Wr2gtCKlrIpGs17NjK29LLWmPmMsyiFkbIZsPEdKQu6y0eAQWdD1E2L93W1tzRyCDY3paev2NaxVlhIjidMfMb5vmse1kbi9pZ7MeKDt0BAQEBAQfEPU+lFY2++q2K1uSSezTnrReVsTTmiZVYHOd9LVuQyubIwANkbxz4FA7FsQ0NrrLNXX7N0eo1+3darGDYPjb5j6prxVRajjDetsRAjj4yM4CDre2uxO7q2hqtm7nua6w9rp5tfXgoSxwyTOMr42PlrPe4Nc8jJJQRDb3Oz1fYFrcV7As0mu3u7nbWkBZ9LSfG5nlxs/yySWRiNozwcBBx9EXadGTXz62+LG41+jZS6adhzS6vfnlkEjgzEZax7T8ePFBu3nbPdUXqJZsw6S5cqbCW1YdIY2lxhhfEGMjfHtoG9HxucwPEZy4/A7kMC87aq2Kmv7mdvxuqGmklFjUU4G2Yp21rdyW00t+kJkFl88pY9vDgwNDvEoK9np73FBcHdkrt2+rZd5FjQx7O0b8WvbzDKZhN1SSse573QdeAHkN+Ichj3p2rBvZq9vUnY2tcNQPqpZYZpJ44GxXqzHdVlzZZpib73mLHViI85c1BZ6OpsIe/6/XSuntevdsz6+8+pI0/yM1dtWVr2Z644P8rmyuj6S53jxkh9aQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBB/9k="};return(t,o)=>($i(),Ui("div",{class:Me(nm+` ${nm}-styles`),"data-id":e.id,onMouseleave:d},[r.value.length>0&&e.show?($i(),Ui(Ni,{key:0},[Zi("div",{class:Me(nm+"__header")},[Zi("div",{class:Me(nm+"__header_button"),onClick:o[0]||(o[0]=e=>(s("chooseStyle",[]),void(l.value="")))},Hh,2),Zi("div",{class:Me(nm+"__header_search")},[Wh,Hn(Zi("textarea",{class:"search","onUpdate:modelValue":o[1]||(o[1]=e=>l.value=e),dir:"ltr",rows:1,placeholder:hn(V)("Type here to search styles ...")},null,8,Yh),[[Zr,l.value]])],2)],2),Zi("div",{class:Me(nm+"__content"),onMouseleave:a},[($i(!0),Ui(Ni,null,bo(r.value,((t,o)=>($i(),Ui("div",{class:Me(nm+"-item"),key:o,onMouseenter:e=>(async e=>{if(!e.imageSrc){if(e.imageLoading)return;e.imageLoading=!0;const t=await p(e.imgName).finally((()=>e.imageLoading=!1));e.imageSrc=t}u.name="zh-CN"==z&&e.name_cn?e.name_cn:e.name,u.positive=e.prompt,u.negative=e.negative_prompt,u.src=e.imageSrc})(t),onMouseleave:Qr((e=>d()),["stop"])},[Zi("span",{class:Me([nm+"-item__tag",{hide:!(e.selectedStyles.includes(t.name)||-1!=c(t.name).indexOf(c(l.value))||t.name_cn&&-1!=c(t.name_cn).indexOf(c(l.value)))}]),onClick:e=>(e=>{let t=n.selectedStyles;t.includes(e.name)?t=t.filter((t=>t!==e.name)):t.push(e.name),s("chooseStyle",t)})(t)},[Zi("input",{type:"checkbox",name:t.name,checked:e.selectedStyles.includes(t.name)},null,8,Xh),Zi("span",null,Be("zh-CN"==hn(z)&&t.name_cn?t.name_cn:t.name),1)],10,Kh)],42,Zh)))),128))],34),(null==u?void 0:u.src)?($i(),Ui("div",{key:0,class:Me(nm+"-preview")},[Zi("img",{src:u.src,ref:"image",alt:"preview",onError:f},null,40,Qh),Zi("div",{class:Me(nm+"-preview__text")},[Zi("b",null,Be(u.name),1),Zi("div",{class:Me(nm+"-preview__prompt")},[u.positive?($i(),Ui("h6",Jh,[qh,Zi("span",null,Be(u.positive),1)])):Ji("",!0),u.negative?($i(),Ui("h6",em,[tm,Zi("span",null,Be(u.negative),1)])):Ji("",!0)],2)],2)],2)):Ji("",!0)],64)):Ji("",!0)],42,Vh))}},im=["data-id"],rm=["onClick"],sm=["name","checked"],am="comfyui-easyuse-selector",lm={__name:"segSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selected:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:t}){const n=e,o=pn([]);bi((e=>n.type),(async e=>{switch(e){case"selfie_multiclass_256x256":o.value=["Background","Hair","Body","Face","Clothes","Others"];break;case"human_parsing_lip":o.value=["Background","Hat","Hair","Glove","Sunglasses","Upper-clothes","Dress","Coat","Socks","Pants","Jumpsuits","Scarf","Skirt","Face","Left-arm","Right-arm","Left-leg","Right-leg","Left-shoe","Right-shoe"]}}),{immediate:!0});const i=t;return(t,r)=>{var s;return $i(),Ui("div",{class:Me(am+` ${am}-seg`),"data-id":e.id},[(null==(s=o.value)?void 0:s.length)>0&&e.show?($i(!0),Ui(Ni,{key:0},bo(o.value,((t,o)=>($i(),Ui("div",{class:Me(am+"-item"),key:o},[Zi("span",{class:Me(am+"-item__tag"),onClick:e=>(e=>{let t=tp(n.selected);t.includes(e)?t=t.filter((t=>t!==e)):t.push(e),i("select",t)})(t)},[Zi("input",{type:"checkbox",name:t,checked:e.selected.includes(t)},null,8,sm),Zi("span",null,Be(hn(V)(t)),1)],10,rm)],2)))),128)):Ji("",!0)],10,im)}}},cm=["data-id"],um=["onMousedown","onDblclick"],dm="comfyui-easyuse-slider",pm="ipadapter layer weights",fm={__name:"sliderControl",props:{id:{type:String|Number,default:""},mode:{type:String,default:""},type:{type:String,default:""},values:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["changeValues","showSlider"],setup(e,{emit:t}){const n=e,o=t,i=(e,t,n)=>(e-t)/(n-t)*100,r=(e,t,o=void 0)=>{if(n.mode===pm){let n={3:2.5,6:1}[t]||0;return{default:12==e?n:0,min:-1,max:3,step:.05,value:void 0!==o?o:12==e?n:0,top:void 0!==o?100-i(o,-1,3)+"%":null,height:void 0!==o?i(o,-1,3)+"%":null}}};bi((e=>n.mode),(async(e,t)=>{var i;if(e!==t&&e===pm)if(!t&&(null==(i=n.values)?void 0:i.length)>0){const e=n.values.map((e=>{const t=e.split(":");return r(n.values.length,t[0],parseFloat(t[1]))}));await o("changeValues",e)}else{let e="sd1"==n.type?16:12,t=Array.from({length:e},((t,n)=>r(e,n)));await o("changeValues",t)}o("showSlider")}),{immediate:!0}),bi((e=>n.type),((e,t)=>{if(e!=t&&n.mode==pm){let e="sd1"==n.type?16:12,t=Array.from({length:e},((t,n)=>r(e,n)));o("changeValues",t)}}));const s=pn(null),a=pn(null);return oo((()=>{document.onmouseup=e=>document.onmousemove=null})),(t,r)=>{var l;return $i(),Ui("div",{class:Me(dm),"data-id":e.id},[(null==(l=e.values)?void 0:l.length)>0&&e.show?($i(!0),Ui(Ni,{key:0},bo(e.values,((t,r)=>($i(),Ui("div",{class:Me([dm+"-item",{positive:3==r&&"sdxl"==e.type&&e.mode==pm},{negative:6==r&&"sdxl"==e.type&&e.mode==pm}]),key:r},[Zi("div",{class:Me(dm+"-item-input")},Be(t.value),3),Zi("div",{class:Me(dm+"-item-scroll"),ref_for:!0,ref_key:"scroll",ref:s},[Zi("div",{class:Me(dm+"-item-bar"),ref_for:!0,ref_key:"bar",ref:a,style:Ie({top:t.top||100-i(t.default,t.min,t.max)+"%"}),onMousedown:e=>((e,t,i)=>{let r=e||window.event,l=s.value[i],c=a.value[i],u=tp(n.values),d=r.clientY-c.offsetTop;document.onmousemove=e=>{let n=(e||window.event).clientY-d;n<0?n=0:n>l.offsetHeight-c.offsetHeight&&(n=l.offsetHeight-c.offsetHeight);let r=(t.max-t.min)/t.step,s=(l.offsetHeight-c.offsetHeight)/r;n=Math.round(n/s)*s;const a=Math.floor(n/(l.offsetHeight-c.offsetHeight)*100)+"%",p=Math.floor((l.offsetHeight-c.offsetHeight-n)/(l.offsetHeight-c.offsetHeight)*100)+"%",f=parseFloat(parseFloat(t.max-(t.max-t.min)*(n/(l.offsetHeight-c.offsetHeight))).toFixed(2));u[i]={...u[i],top:a,height:p,value:f},o("changeValues",u),window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}})(e,t,r),onDblclick:e=>((e,t,i)=>{let r=tp(n.values);r[i]={...r[i],top:null,height:null,value:t.default},o("changeValues",r)})(0,t,r)},null,46,um),Zi("div",{class:Me(dm+"-item-area"),style:Ie({height:t.height||i(t.default,t.min,t.max)+"%"})},null,6)],2),Zi("div",{class:Me(dm+"-item-label")},[Zi("span",null,Be(t.label),1)],2)],2)))),128)):Ji("",!0)],8,cm)}}},hm={__name:"index",setup(e){const t=zh(),{selectors:n,seg_selectors:o,slider_controls:i}=ws(t),r=pn({}),s=async e=>{var o,i,s,a,l,c;await W(1);const u=wp(e,"styles"),d=(null==(o=e.properties.values)?void 0:o.length)>0?e.properties.values:[];let p=tp(n.value);p.push({id:e.id,type:u.value,value:d,show:!1});const f=p.length-1;await t.setSelectors(p);let h=null==(a=null==(s=null==(i=r.value[e.id])?void 0:i._)?void 0:s.vnode)?void 0:a.el;if(!h)return;let m=e.addDOMWidget("select_styles","btn",h);e.properties.values||e.setProperty("values",[]),p[f].show=!0,await t.setSelectors(p);let g=u.value;Object.defineProperty(u,"value",{set:n=>{g=n,p[f].type=n,e.properties.values=[],p[f].value=[],t.setSelectors(p)},get:e=>g}),Object.defineProperty(m,"value",{set:e=>{setTimeout((n=>{p[f].value=e.split(","),t.setSelectors(p)}),150)},get:t=>{var o,i;return e.properties.values=(null==(i=null==(o=n.value)?void 0:o[f])?void 0:i.value)||[],e.properties.values.join(",")}}),((null==(l=e.size)?void 0:l[0])<150||(null==(c=e.size)?void 0:c[1])<150)&&e.setSize([425,500]);const v=e.onRemoved;e.onRemoved=function(){if(v&&(null==v||v.apply(this,arguments)),void 0!==n.value.findIndex((t=>t.id==e.id))){let e=tp(n.value);e.splice(f,1),t.setSelectors(e)}return v}},a=pn({}),l=async e=>{var n,i,r,s;await W(1);const l=wp(e,"method"),c=(null==(n=e.properties.values)?void 0:n.length)>0?e.properties.values:[];let u=tp(o.value);u.push({id:e.id,type:l.value,value:c,show:!1});const d=u.length-1;await t.setSegSelectors(u);let p=null==(s=null==(r=null==(i=a.value[e.id])?void 0:i._)?void 0:r.vnode)?void 0:s.el;if(!p)return;let f=e.addDOMWidget("mask_components","btn",p);e.properties.values||e.setProperty("values",[]),u[d].show=!0,await t.setSegSelectors(u);let h=l.value;Object.defineProperty(l,"value",{set:n=>{h=n,u[d].type=n,e.properties.values=[],u[d].value=[],Sp(e,wp(e,"confidence"),"selfie_multiclass_256x256"===h),e.setSize([300,"selfie_multiclass_256x256"===h?260:500]),t.setSegSelectors(u)},get:e=>h}),Object.defineProperty(f,"value",{set:e=>{setTimeout((n=>{u[d].value=e.split(","),t.setSegSelectors(u)}),150)},get:t=>{var n;return e.properties.values=(null==(n=o.value)?void 0:n[d].value)||[],e.properties.values.join(",")}}),Sp(e,wp(e,"confidence"),"selfie_multiclass_256x256"===h),e.setSize([300,"selfie_multiclass_256x256"===h?260:500]);const m=e.onRemoved;e.onRemoved=function(){if(m&&(null==m||m.apply(this,arguments)),void 0!==o.value.findIndex((t=>t.id==e.id))){let e=tp(o.value);e.splice(d,1),t.setSegSelectors(e)}return m}},c=pn({}),u=async e=>{var n,o,r,s;await W(1);const a=wp(e,"mode"),l=wp(e,"model_type"),u=(null==(n=e.properties.values)?void 0:n.length)>0?e.properties.values:[];let d=tp(i.value);d.push({id:e.id,type:l.value,mode:a.value,value:u,show:!1});const p=d.length-1;await t.setSliderControls(d);let f=null==(s=null==(r=null==(o=c.value[e.id])?void 0:o._)?void 0:r.vnode)?void 0:s.el;if(!f)return;let h=e.addDOMWidget("values","btn",f);e.properties.values||e.setProperty("values",[]),Object.defineProperty(h,"value",{set:function(){},get:t=>{var n;const o=(null==(n=i.value)?void 0:n[p].value)||[];return e.properties.values=o.map(((e,t)=>`${t}:${e.value}`)),e.properties.values.join(",")}}),e.setSize("sdxl"==l.value?[375,320]:[455,320]),l.callback=n=>{d=tp(i.value),d[p].type!=n&&(e.setSize("sdxl"==n?[375,320]:[455,320]),d[p].value=[],d[p].type=n,t.setSliderControls(d))};const m=e.onRemoved;e.onRemoved=function(){if(m&&(null==m||m.apply(this,arguments)),void 0!==i.value.findIndex((t=>t.id==e.id))){let e=tp(i.value);e.splice(p,1),t.setSliderControls(e)}return m}};return oo((e=>{y.registerExtension({name:"Comfy.EasyUse.Components",async beforeRegisterNodeDef(e,t){const n=e.prototype.onNodeCreated;"easy stylesSelector"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await s(this),n}),"easy humanSegmentation"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await l(this),n}),"easy sliderControl"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await u(this),n})}})})),(e,s)=>($i(),Ui(Ni,null,[($i(!0),Ui(Ni,null,bo(hn(n),((e,o)=>($i(),zi(om,{ref_for:!0,ref:t=>{t&&(r.value[e.id]=t)},type:e.type,key:o,id:e.id,show:e.show,selectedStyles:e.value,onChooseStyle:e=>((e,o)=>{let i=tp(n.value);i[o].value=e,t.setSelectors(i)})(e,o)},null,8,["type","id","show","selectedStyles","onChooseStyle"])))),128)),($i(!0),Ui(Ni,null,bo(hn(o),((e,n)=>($i(),zi(lm,{ref_for:!0,ref:t=>{t&&(a.value[e.id]=t)},type:e.type,key:n,id:e.id,show:e.show,selected:e.value,onSelect:e=>((e,n)=>{let i=tp(o.value);i[n].value=e,t.setSegSelectors(i)})(e,n)},null,8,["type","id","show","selected","onSelect"])))),128)),($i(!0),Ui(Ni,null,bo(hn(i),((e,n)=>($i(),zi(fm,{ref_for:!0,ref:t=>{t&&(c.value[e.id]=t)},type:e.type,key:n,id:e.id,show:e.show,mode:e.mode,values:e.value,onChangeValues:e=>((e,n)=>{let o=tp(i.value);o[n].value=e,t.setSliderControls(o)})(e,n),onShowSlider:e=>(e=>{let n=tp(i.value);n[e].show=!0,t.setSliderControls(n)})(n)},null,8,["type","id","show","mode","values","onChangeValues","onShowSlider"])))),128))],64))}};var mm=Object.defineProperty,gm=Object.getOwnPropertySymbols,vm=Object.prototype.hasOwnProperty,ym=Object.prototype.propertyIsEnumerable,bm=(e,t,n)=>t in e?mm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function _m(e){return null==e||""===e||Array.isArray(e)&&0===e.length||!(e instanceof Date)&&"object"==typeof e&&0===Object.keys(e).length}function wm(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Sm(e){return!_m(e)}function xm(e,t=!0){return e instanceof Object&&e.constructor===Object&&(t||0!==Object.keys(e).length)}function km(e,...t){return wm(e)?e(...t):e}function Cm(e,t=!0){return"string"==typeof e&&(t||""!==e)}function Am(e){return Cm(e)?e.replace(/(-|_)/g,"").toLowerCase():e}function Em(e,t="",n={}){const o=Am(t).split("."),i=o.shift();return i?xm(e)?Em(km(e[Object.keys(e).find((e=>Am(e)===i))||""],n),o.join("."),n):void 0:km(e,n)}function Om(e,t=!0){return Array.isArray(e)&&(t||0!==e.length)}function Lm(e){return Sm(e)&&!isNaN(e)}function Tm(e,t){if(t){const n=t.test(e);return t.lastIndex=0,n}return!1}function Im(...e){const t=(e={},n={})=>{const o=((e,t)=>{for(var n in t||(t={}))vm.call(t,n)&&bm(e,n,t[n]);if(gm)for(var n of gm(t))ym.call(t,n)&&bm(e,n,t[n]);return e})({},e);return Object.keys(n).forEach((i=>{xm(n[i])&&i in e&&xm(e[i])?o[i]=t(e[i],n[i]):o[i]=n[i]})),o};return e.reduce(((e,n,o)=>0===o?n:t(e,n)),{})}function Nm(e){return e?e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":"):e}function Pm(e){return Cm(e)?e.replace(/(_)/g,"-").replace(/[A-Z]/g,((e,t)=>0===t?e:"-"+e.toLowerCase())).toLowerCase():e}function Dm(e){return Cm(e)?e.replace(/[A-Z]/g,((e,t)=>0===t?e:"."+e.toLowerCase())).toLowerCase():e}function jm(){const e=new Map;return{on(t,n){let o=e.get(t);return o?o.push(n):o=[n],e.set(t,o),this},off(t,n){let o=e.get(t);return o&&o.splice(o.indexOf(n)>>>0,1),this},emit(t,n){let o=e.get(t);o&&o.slice().map((e=>{e(n)}))},clear(){e.clear()}}}var Mm=Object.defineProperty,Rm=Object.defineProperties,$m=Object.getOwnPropertyDescriptors,Gm=Object.getOwnPropertySymbols,Bm=Object.prototype.hasOwnProperty,Fm=Object.prototype.propertyIsEnumerable,Um=(e,t,n)=>t in e?Mm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zm=(e,t)=>{for(var n in t||(t={}))Bm.call(t,n)&&Um(e,n,t[n]);if(Gm)for(var n of Gm(t))Fm.call(t,n)&&Um(e,n,t[n]);return e},Vm=(e,t)=>Rm(e,$m(t)),Hm=(e,t)=>{var n={};for(var o in e)Bm.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&Gm)for(var o of Gm(e))t.indexOf(o)<0&&Fm.call(e,o)&&(n[o]=e[o]);return n},Wm=jm();function Ym(e,t){Om(e)?e.push(...t||[]):xm(e)&&Object.assign(e,t)}function Zm(e,t=""){if(!["opacity","z-index","line-height","font-weight","flex","flex-grow","flex-shrink","order"].some((e=>t.endsWith(e)))){return`${e}`.trim().split(" ").map((e=>Lm(e)?`${e}px`:e)).join(" ")}return e}function Km(e="",t=""){return function(e){return e.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}(`${Cm(e,!1)&&Cm(t,!1)?`${e}-`:e}${t}`)}function Xm(e="",t=""){return`--${Km(e,t)}`}function Qm(e,t="",n="",o=[],i){if(Cm(e)){const r=/{([^}]*)}/g,s=e.trim();if(Tm(s,r)){const e=s.replaceAll(r,(e=>{const t=e.replace(/{|}/g,"").split(".").filter((e=>!o.some((t=>Tm(e,t)))));return`var(${Xm(n,Pm(t.join("-")))}${Sm(i)?`, ${i}`:""})`})),t=/(\d+\s+[\+\-\*\/]\s+\d+)/g,a=/var\([^)]+\)/g;return Tm(e.replace(a,"0"),t)?`calc(${e})`:e}return Zm(s,t)}if(Lm(e))return Zm(e,t)}function Jm(e,t){return e?`${e}{${t}}`:""}var qm=(...e)=>eg(og.getTheme(),...e),eg=(e={},t,n,o="variable")=>{if(t){const{variable:i,options:r}=og.defaults||{},{prefix:s,transform:a}=(null==e?void 0:e.options)||r||{},l=Tm(t,/{([^}]*)}/g)?t:`{${t}}`;return"value"===o||"strict"===a?og.getTokenValue(t):Qm(l,void 0,s,[i.excludedKeyRegex],n)}return""};function tg(e,t={}){const n=og.defaults.variable,{prefix:o=n.prefix,selector:i=n.selector,excludedKeyRegex:r=n.excludedKeyRegex}=t,s=(e,t="")=>Object.entries(e).reduce(((e,[n,i])=>{const a=Tm(n,r)?Km(t):Km(t,Pm(n)),l=function(e){return xm(e)&&e.hasOwnProperty("value")&&e.hasOwnProperty("type")?e.value:e}(i);if(xm(l)){const{variables:t,tokens:n}=s(l,a);Ym(e.tokens,n),Ym(e.variables,t)}else e.tokens.push((o?a.replace(`${o}-`,""):a).replaceAll("-",".")),function(e,t,n){Cm(t,!1)&&e.push(`${t}:${n};`)}(e.variables,Xm(a),Qm(l,a,o,[r]));return e}),{variables:[],tokens:[]}),{variables:a,tokens:l}=s(e,o);return{value:a,tokens:l,declarations:a.join(""),css:Jm(i,a.join(""))}}var ng={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(e){return{type:"class",selector:e,matched:this.pattern.test(e.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(e){return{type:"attr",selector:`:root${e}`,matched:this.pattern.test(e.trim())}}},media:{pattern:/^@media (.*)$/,resolve(e){return{type:"media",selector:`${e}{:root{[CSS]}}`,matched:this.pattern.test(e.trim())}}},system:{pattern:/^system$/,resolve(e){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(e.trim())}}},custom:{resolve:e=>({type:"custom",selector:e,matched:!0})}},resolve(e){const t=Object.keys(this.rules).filter((e=>"custom"!==e)).map((e=>this.rules[e]));return[e].flat().map((e=>{var n;return null!=(n=t.map((t=>t.resolve(e))).find((e=>e.matched)))?n:this.rules.custom.resolve(e)}))}},_toVariables:(e,t)=>tg(e,{prefix:null==t?void 0:t.prefix}),getCommon({name:e="",theme:t={},params:n,set:o,defaults:i}){var r,s,a,l;const{preset:c,options:u}=t;let d,p,f,h;if(Sm(c)){const{primitive:t,semantic:n}=c,m=n||{},{colorScheme:g}=m,v=Hm(m,["colorScheme"]),y=g||{},{dark:b}=y,_=Hm(y,["dark"]),w=Sm(t)?this._toVariables({primitive:t},u):{},S=Sm(v)?this._toVariables({semantic:v},u):{},x=Sm(_)?this._toVariables({light:_},u):{},k=Sm(b)?this._toVariables({dark:b},u):{},[C,A]=[null!=(r=w.declarations)?r:"",w.tokens],[E,O]=[null!=(s=S.declarations)?s:"",S.tokens||[]],[L,T]=[null!=(a=x.declarations)?a:"",x.tokens||[]],[I,N]=[null!=(l=k.declarations)?l:"",k.tokens||[]];d=this.transformCSS(e,C,"light","variable",u,o,i),p=A;f=`${this.transformCSS(e,`${E}${L}color-scheme:light`,"light","variable",u,o,i)}${this.transformCSS(e,`${I}color-scheme:dark`,"dark","variable",u,o,i)}`,h=[...new Set([...O,...T,...N])]}return{primitive:{css:d,tokens:p},semantic:{css:f,tokens:h}}},getPreset({name:e="",preset:t={},options:n,params:o,set:i,defaults:r,selector:s}){var a,l,c;const u=e.replace("-directive",""),d=t,{colorScheme:p}=d,f=Hm(d,["colorScheme"]),h=p||{},{dark:m}=h,g=Hm(h,["dark"]),v=Sm(f)?this._toVariables({[u]:f},n):{},y=Sm(g)?this._toVariables({[u]:g},n):{},b=Sm(m)?this._toVariables({[u]:m},n):{},[_,w]=[null!=(a=v.declarations)?a:"",v.tokens||[]],[S,x]=[null!=(l=y.declarations)?l:"",y.tokens||[]],[k,C]=[null!=(c=b.declarations)?c:"",b.tokens||[]],A=[...new Set([...w,...x,...C])];return{css:`${this.transformCSS(u,`${_}${S}`,"light","variable",n,i,r,s)}${this.transformCSS(u,k,"dark","variable",n,i,r,s)}`,tokens:A}},getPresetC({name:e="",theme:t={},params:n,set:o,defaults:i}){var r;const{preset:s,options:a}=t,l=null==(r=null==s?void 0:s.components)?void 0:r[e];return this.getPreset({name:e,preset:l,options:a,params:n,set:o,defaults:i})},getPresetD({name:e="",theme:t={},params:n,set:o,defaults:i}){var r;const s=e.replace("-directive",""),{preset:a,options:l}=t,c=null==(r=null==a?void 0:a.directives)?void 0:r[s];return this.getPreset({name:s,preset:c,options:l,params:n,set:o,defaults:i})},getColorSchemeOption(e,t){var n;return this.regex.resolve(null!=(n=e.darkModeSelector)?n:t.options.darkModeSelector)},getLayerOrder(e,t={},n,o){const{cssLayer:i}=t;if(i){return`@layer ${km(i.order||"primeui",n)}`}return""},getCommonStyleSheet({name:e="",theme:t={},params:n,props:o={},set:i,defaults:r}){const s=this.getCommon({name:e,theme:t,params:n,set:i,defaults:r}),a=Object.entries(o).reduce(((e,[t,n])=>e.push(`${t}="${n}"`)&&e),[]).join(" ");return Object.entries(s||{}).reduce(((e,[t,n])=>{if(null==n?void 0:n.css){const o=Nm(null==n?void 0:n.css),i=`${t}-variables`;e.push(``)}return e}),[]).join("")},getStyleSheet({name:e="",theme:t={},params:n,props:o={},set:i,defaults:r}){var s;const a={name:e,theme:t,params:n,set:i,defaults:r},l=null==(s=e.includes("-directive")?this.getPresetD(a):this.getPresetC(a))?void 0:s.css,c=Object.entries(o).reduce(((e,[t,n])=>e.push(`${t}="${n}"`)&&e),[]).join(" ");return l?``:""},createTokens(e={},t,n="",o="",i={}){return Object.entries(e).forEach((([e,r])=>{const s=Tm(e,t.variable.excludedKeyRegex)?n:n?`${n}.${Dm(e)}`:Dm(e),a=o?`${o}.${e}`:e;xm(r)?this.createTokens(r,t,s,a,i):(i[s]||(i[s]={paths:[],computed(e,t={}){if(e){const n=this.paths.find((t=>t.scheme===e))||this.paths.find((e=>"none"===e.scheme));return null==n?void 0:n.computed(e,t.binding)}return this.paths.map((e=>e.computed(e.scheme,t[e.scheme])))}}),i[s].paths.push({path:a,value:r,scheme:a.includes("colorScheme.light")?"light":a.includes("colorScheme.dark")?"dark":"none",computed(e,t={}){const n=/{([^}]*)}/g;let o=r;if(t.name=this.path,t.binding||(t.binding={}),Tm(r,n)){const s=r.trim().replaceAll(n,(n=>{var o,r;const s=n.replace(/{|}/g,"");return null==(r=null==(o=i[s])?void 0:o.computed(e,t))?void 0:r.value})),a=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,l=/var\([^)]+\)/g;o=Tm(s.replace(l,"0"),a)?`calc(${s})`:s}return _m(t.binding)&&delete t.binding,{colorScheme:e,path:this.path,paths:t,value:o.includes("undefined")?void 0:o}}}))})),i},getTokenValue(e,t,n){var o;const i=t.split(".").filter((e=>!Tm(e.toLowerCase(),n.variable.excludedKeyRegex))).join(".");const r=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,s=[null==(o=e[i])?void 0:o.computed(r)].flat().filter((e=>e));return 1===s.length?s[0].value:s.reduce(((e={},t)=>{const n=t,{colorScheme:o}=n,i=Hm(n,["colorScheme"]);return e[o]=i,e}),void 0)},transformCSS(e,t,n,o,i={},r,s,a){if(Sm(t)){const{cssLayer:l}=i;if("style"!==o){const e=this.getColorSchemeOption(i,s),o=a?Jm(a,t):t;t="dark"===n?e.reduce(((e,{selector:t})=>(Sm(t)&&(e+=t.includes("[CSS]")?t.replace("[CSS]",o):Jm(t,o)),e)),""):Jm(null!=a?a:":root",t)}if(l){const n={name:"primeui",order:"primeui"};xm(l)&&(n.name=km(l.name,{name:e,type:o})),Sm(n.name)&&(t=Jm(`@layer ${n.name}`,t),null==r||r.layerNames(n.name))}return t}return""}},og={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(e={}){const{theme:t}=e;t&&(this._theme=Vm(zm({},t),{options:zm(zm({},this.defaults.options),t.options)}),this._tokens=ng.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var e;return(null==(e=this.theme)?void 0:e.preset)||{}},get options(){var e;return(null==(e=this.theme)?void 0:e.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(e){this.update({theme:e}),Wm.emit("theme:change",e)},getPreset(){return this.preset},setPreset(e){this._theme=Vm(zm({},this.theme),{preset:e}),this._tokens=ng.createTokens(e,this.defaults),this.clearLoadedStyleNames(),Wm.emit("preset:change",e),Wm.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(e){this._theme=Vm(zm({},this.theme),{options:e}),this.clearLoadedStyleNames(),Wm.emit("options:change",e),Wm.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(e){this._layerNames.add(e)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(e){return this._loadedStyleNames.has(e)},setLoadedStyleName(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(e){return ng.getTokenValue(this.tokens,e,this.defaults)},getCommon(e="",t){return ng.getCommon({name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPresetC(n)},getDirective(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPresetD(n)},getCustomPreset(e="",t,n,o){const i={name:e,preset:t,options:this.options,selector:n,params:o,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPreset(i)},getLayerOrderCSS(e=""){return ng.getLayerOrder(e,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(e="",t,n="style",o){return ng.transformCSS(e,t,o,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(e="",t,n={}){return ng.getCommonStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(e,t,n={}){return ng.getStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(e){this._loadingStyles.add(e)},onStyleUpdated(e){this._loadingStyles.add(e)},onStyleLoaded(e,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),Wm.emit(`theme:${t}:load`,e),!this._loadingStyles.size&&Wm.emit("theme:load"))}};function ig(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className))}function rg(e,t){if(e&&t){const n=t=>{ig(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)};[t].flat().filter(Boolean).forEach((e=>e.split(" ").forEach(n)))}}function sg(e,t){if(e&&t){const n=t=>{e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")};[t].flat().filter(Boolean).forEach((e=>e.split(" ").forEach(n)))}}function ag(e,t){if(e instanceof HTMLElement){return e.offsetWidth}return 0}function lg(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function cg(e,t={}){if(lg(e)){const n=(t,o)=>{var i,r;const s=(null==(i=null==e?void 0:e.$attrs)?void 0:i[t])?[null==(r=null==e?void 0:e.$attrs)?void 0:r[t]]:[];return[o].flat().reduce(((e,o)=>{if(null!=o){const i=typeof o;if("string"===i||"number"===i)e.push(o);else if("object"===i){const i=Array.isArray(o)?n(t,o):Object.entries(o).map((([e,n])=>"style"!==t||!n&&0!==n?n?e:void 0:`${e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${n}`));e=i.length?e.concat(i.filter((e=>!!e))):e}}return e}),s)};Object.entries(t).forEach((([t,o])=>{if(null!=o){const i=t.match(/^on(.+)/);i?e.addEventListener(i[1].toLowerCase(),o):"p-bind"===t?cg(e,o):(o="class"===t?[...new Set(n("class",o))].join(" ").trim():"style"===t?n("style",o).join(";").trim():o,(e.$attrs=e.$attrs||{})&&(e.$attrs[t]=o),e.setAttribute(t,o))}}))}}function ug(e,t={},...n){if(e){const o=document.createElement(e);return cg(o,t),o.append(...n),o}}function dg(e,t){return lg(e)?e.matches(t)?e:e.querySelector(t):null}function pg(e,t){if(lg(e)){const n=e.getAttribute(t);return isNaN(n)?"true"===n||"false"===n?"true"===n:n:+n}}function fg(e){if(e){let t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),t}return 0}function hg(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function mg(e,t){if(e){return e.offsetHeight}return 0}function gg(e,t=[]){const n=hg(e);return null===n?t:gg(n,t.concat([n]))}function vg(e){let t=[];if(e){let n=gg(e);const o=/(auto|scroll)/,i=e=>{try{let t=window.getComputedStyle(e,null);return o.test(t.getPropertyValue("overflow"))||o.test(t.getPropertyValue("overflowX"))||o.test(t.getPropertyValue("overflowY"))}catch(t){return!1}};for(let e of n){let n=1===e.nodeType&&e.dataset.scrollselectors;if(n){let o=n.split(",");for(let n of o){let o=dg(e,n);o&&i(o)&&t.push(o)}}9!==e.nodeType&&i(e)&&t.push(e)}}return t}function yg(e){return!(null==e||!e.nodeName||!hg(e))}function bg(e){if(e){let t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth),t}return 0}var _g={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(e){return this._loadedStyleNames.has(e)},setLoadedStyleName:function(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName:function(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};function wg(e){return(wg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function xg(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=pn(!1),o=pn(e),i=pn(null),r="undefined"!=typeof window&&window.document&&window.document.createElement?window.document:void 0,s=t.document,a=void 0===s?r:s,l=t.immediate,c=void 0===l||l,u=t.manual,d=void 0!==u&&u,p=t.name,f=void 0===p?"style_".concat(++Cg):p,h=t.id,m=void 0===h?void 0:h,g=t.media,v=void 0===g?void 0:g,y=t.nonce,b=void 0===y?void 0:y,_=t.first,w=void 0!==_&&_,S=t.onMounted,x=void 0===S?void 0:S,k=t.onUpdated,C=void 0===k?void 0:k,A=t.onLoad,E=void 0===A?void 0:A,O=t.props,L=void 0===O?{}:O,T=function(){},I=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(a){var s=xg(xg({},L),r),l=s.name||f,c=s.id||m,u=s.nonce||b;i.value=a.querySelector('style[data-primevue-style-id="'.concat(l,'"]'))||a.getElementById(c)||a.createElement("style"),i.value.isConnected||(o.value=t||e,cg(i.value,{type:"text/css",id:c,media:v,nonce:u}),w?a.head.prepend(i.value):a.head.appendChild(i.value),function(e,t="",n){lg(e)&&null!=n&&e.setAttribute(t,n)}(i.value,"data-primevue-style-id",l),cg(i.value,s),i.value.onload=function(e){return null==E?void 0:E(e,{name:l})},null==x||x(l)),n.value||(T=bi(o,(function(e){i.value.textContent=e,null==C||C(l)}),{immediate:!0}),n.value=!0)}};return c&&!d&&function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ar()?oo(e):t?e():Pn(e)}(I),{id:m,name:f,el:i,css:o,unload:function(){a&&n.value&&(T(),yg(i.value)&&a.head.removeChild(i.value),n.value=!1)},load:I,isLoaded:Qt(n)}}function Eg(e){return(Eg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Og(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,s,a=[],l=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t);else for(;!(l=(o=r.call(n)).done)&&(a.push(o.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Lg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return e})(km(e,{dt:qm}));return n?Ag(Nm(n),Ig({name:this.name},t)):{}},loadCSS:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.load(this.css,e)},loadTheme:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.load(this.theme,t,(function(n){return og.transformCSS(t.name||e.name,n)}))},getCommonTheme:function(e){return og.getCommon(this.name,e)},getComponentTheme:function(e){return og.getComponent(this.name,e)},getDirectiveTheme:function(e){return og.getDirective(this.name,e)},getPresetTheme:function(e,t,n){return og.getCustomPreset(this.name,e,t,n)},getLayerOrderThemeCSS:function(){return og.getLayerOrderCSS(this.name)},getStyleSheet:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.css){var n=km(this.css,{dt:qm}),o=Nm("".concat(n).concat(e)),i=Object.entries(t).reduce((function(e,t){var n=Og(t,2),o=n[0],i=n[1];return e.push("".concat(o,'="').concat(i,'"'))&&e}),[]).join(" ");return'")}return""},getCommonThemeStyleSheet:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return og.getCommonStyleSheet(this.name,e,t)},getThemeStyleSheet:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[og.getStyleSheet(this.name,e,t)];if(this.theme){var o="base"===this.name?"global-style":"".concat(this.name,"-style"),i=km(this.theme,{dt:qm}),r=Nm(og.transformCSS(o,i)),s=Object.entries(t).reduce((function(e,t){var n=Og(t,2),o=n[0],i=n[1];return e.push("".concat(o,'="').concat(i,'"'))&&e}),[]).join(" ");n.push('"))}return n.join("")},extend:function(e){return Ig(Ig({},this),{},{css:void 0,theme:void 0},e)}},Dg={};var jg=function(){let e=[];const t=(t,n,o=0)=>[...e].reverse().find((e=>!0))||{key:t,value:o},n=e=>e&&parseInt(e.style.zIndex,10)||0;return{get:n,set:(n,o,i)=>{o&&(o.style.zIndex=String(((n,o,i=999)=>{const r=t(n,o,i),s=r.value+(r.key===n?0:i)+1;return e.push({key:n,value:s}),s})(n,!0,i)))},clear:t=>{var o;t&&(o=n(t),e=e.filter((e=>e.value!==o)),t.style.zIndex="")},getCurrent:e=>(e=>t(e).value)(e)}}();function Mg(e){return(Mg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rg(e,t,n){return t&&function(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:function(){};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.listener=n}),[{key:"bindScrollListener",value:function(){this.scrollableParents=vg(this.element);for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:"pv_id_")}var Fg=Pg.extend({name:"common"});function Ug(e){return(Ug="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zg(e){return Zg(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wg(e)||Hg()}function Vg(e,t){return Zg(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,s,a=[],l=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=r.call(n)).done)&&(a.push(o.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Wg(e,t)||Hg()}function Hg(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Wg(e,t){if(e){if("string"==typeof e)return Yg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yg(e,t):void 0}}function Yg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:function(){};_g.clearLoadedStyleNames(),Wm.on("theme:change",e)},_getHostInstance:function(e){return e?this.$options.hostName?e.$.type.name===this.$options.hostName?e:this._getHostInstance(e.$parentInstance):e.$parentInstance:void 0},_getPropValue:function(e){var t;return this[e]||(null===(t=this._getHostInstance(this))||void 0===t?void 0:t[e])},_getOptionValue:function(e){return Em(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})},_getPTValue:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=/./g.test(n)&&!!o[n.split(".")[0]],s=this._getPropValue("ptOptions")||(null===(e=this.$primevueConfig)||void 0===e?void 0:e.ptOptions)||{},a=s.mergeSections,l=void 0===a||a,c=s.mergeProps,u=void 0!==c&&c,d=i?r?this._useGlobalPT(this._getPTClassValue,n,o):this._useDefaultPT(this._getPTClassValue,n,o):void 0,p=r?void 0:this._getPTSelf(t,this._getPTClassValue,n,Xg(Xg({},o),{},{global:d||{}})),f=this._getPTDatasets(n);return l||!l&&p?u?this._mergeProps(u,d,p,f):Xg(Xg(Xg({},d),p),f):Xg(Xg({},p),f)},_getPTSelf:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=new Array(t>1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:"",o="data-pc-",i="root"===n&&Sm(null===(e=this.pt)||void 0===e?void 0:e["data-pc-section"]);return"transition"!==n&&Xg(Xg({},"root"===n&&Xg(Qg({},"".concat(o,"name"),Am(i?null===(t=this.pt)||void 0===t?void 0:t["data-pc-section"]:this.$.type.name)),i&&Qg({},"".concat(o,"extend"),Am(this.$.type.name)))),{},Qg({},"".concat(o,"section"),Am(n)))},_getPTClassValue:function(){var e=this._getOptionValue.apply(this,arguments);return Cm(e)||Om(e)?{class:e}:e},_getPT:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2?arguments[2]:void 0,i=function(e){var i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=o?o(e):e,a=Am(n),l=Am(t.$name);return null!==(i=r?a!==l?null==s?void 0:s[a]:void 0:null==s?void 0:s[a])&&void 0!==i?i:s};return null!=e&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:i(e.originalValue),value:i(e.value)}:i(e,!0)},_usePT:function(e,t,n,o){var i=function(e){return t(e,n,o)};if(null!=e&&e.hasOwnProperty("_usept")){var r,s=e._usept||(null===(r=this.$primevueConfig)||void 0===r?void 0:r.ptOptions)||{},a=s.mergeSections,l=void 0===a||a,c=s.mergeProps,u=void 0!==c&&c,d=i(e.originalValue),p=i(e.value);if(void 0===d&&void 0===p)return;return Cm(p)?p:Cm(d)?d:l||!l&&p?u?this._mergeProps(u,d,p):Xg(Xg({},d),p):p}return i(e)},_useGlobalPT:function(e,t,n){return this._usePT(this.globalPT,e,t,n)},_useDefaultPT:function(e,t,n){return this._usePT(this.defaultPT,e,t,n)},ptm:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._getPTValue(this.pt,e,Xg(Xg({},this.$params),t))},ptmi:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nr(this.$_attrsWithoutPT,this.ptm(e,t))},ptmo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._getPTValue(e,t,Xg({instance:this},n),!1)},cx:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,e,Xg(Xg({},this.$params),t))},sx:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var n=this._getOptionValue(this.$style.inlineStyles,e,Xg(Xg({},this.$params),t));return[this._getOptionValue(Fg.inlineStyles,e,Xg(Xg({},this.$params),t)),n]}}},computed:{globalPT:function(){var e,t=this;return this._getPT(null===(e=this.$primevueConfig)||void 0===e?void 0:e.pt,void 0,(function(e){return km(e,{instance:t})}))},defaultPT:function(){var e,t=this;return this._getPT(null===(e=this.$primevueConfig)||void 0===e?void 0:e.pt,void 0,(function(e){return t._getOptionValue(e,t.$name,Xg({},t.$params))||km(e,Xg({},t.$params))}))},isUnstyled:function(){var e;return void 0!==this.unstyled?this.unstyled:null===(e=this.$primevueConfig)||void 0===e?void 0:e.unstyled},$theme:function(){var e;return null===(e=this.$primevueConfig)||void 0===e?void 0:e.theme},$style:function(){return Xg(Xg({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var e;return{nonce:null===(e=this.$primevueConfig)||void 0===e||null===(e=e.csp)||void 0===e?void 0:e.nonce}},$primevueConfig:function(){var e;return null===(e=this.$primevue)||void 0===e?void 0:e.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var e=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:e,props:null==e?void 0:e.$props,state:null==e?void 0:e.$data,attrs:null==e?void 0:e.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter((function(e){var t=Vg(e,1)[0];return null==t?void 0:t.startsWith("pt:")})).reduce((function(e,t){var n=Vg(t,2),o=n[0],i=n[1],r=zg(o.split(":")).slice(1);return null==r||r.reduce((function(e,t,n,o){return!e[t]&&(e[t]=n===o.length-1?i:{}),e[t]}),e),e}),{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter((function(e){var t=Vg(e,1)[0];return!(null!=t&&t.startsWith("pt:"))})).reduce((function(e,t){var n=Vg(t,2),o=n[0],i=n[1];return e[o]=i,e}),{})},$attrSelector:function(){return Bg("pc")}}},qg=Pg.extend({name:"baseicon",css:"\n.p-icon {\n display: inline-block;\n vertical-align: baseline;\n}\n\n.p-icon-spin {\n -webkit-animation: p-icon-spin 2s infinite linear;\n animation: p-icon-spin 2s infinite linear;\n}\n\n@-webkit-keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n@keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n"});function ev(e){return(ev="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function nv(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,o=Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=function(){var e=gv._getOptionValue.apply(gv,arguments);return Cm(e)||Om(e)?{class:e}:e},l=(null===(e=n.binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.ptOptions)||(null===(t=n.$primevueConfig)||void 0===t?void 0:t.ptOptions)||{},c=l.mergeSections,u=void 0===c||c,d=l.mergeProps,p=void 0!==d&&d,f=s?gv._useDefaultPT(n,n.defaultPT(),a,i,r):void 0,h=gv._usePT(n,gv._getPT(o,n.$name),a,i,hv(hv({},r),{},{global:f||{}})),m=gv._getPTDatasets(n,i);return u||!u&&h?p?gv._mergeProps(n,p,f,h,m):hv(hv(hv({},f),h),m):hv(hv({},h),m)},_getPTDatasets:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="data-pc-";return hv(hv({},"root"===t&&mv({},"".concat(n,"name"),Am(e.$name))),{},mv({},"".concat(n,"section"),Am(t)))},_getPT:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,o=function(e){var o,i=n?n(e):e,r=Am(t);return null!==(o=null==i?void 0:i[r])&&void 0!==o?o:i};return null!=e&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:o(e.originalValue),value:o(e.value)}:o(e)},_usePT:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=function(e){return n(e,o,i)};if(null!=t&&t.hasOwnProperty("_usept")){var s,a=t._usept||(null===(s=e.$primevueConfig)||void 0===s?void 0:s.ptOptions)||{},l=a.mergeSections,c=void 0===l||l,u=a.mergeProps,d=void 0!==u&&u,p=r(t.originalValue),f=r(t.value);if(void 0===p&&void 0===f)return;return Cm(f)?f:Cm(p)?p:c||!c&&f?d?gv._mergeProps(e,d,p,f):hv(hv({},p),f):f}return r(t)},_useDefaultPT:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return gv._usePT(e,t,n,o,i)},_loadStyles:function(e,t,n){var o,i=gv._getConfig(t,n),r={nonce:null==i||null===(o=i.csp)||void 0===o?void 0:o.nonce};gv._loadCoreStyles(e.$instance,r),gv._loadThemeStyles(e.$instance,r),gv._loadScopedThemeStyles(e.$instance,r),gv._themeChangeListener((function(){return gv._loadThemeStyles(e.$instance,r)}))},_loadCoreStyles:function(){var e,t,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;!_g.isStyleNameLoaded(null===(e=o.$style)||void 0===e?void 0:e.name)&&null!==(t=o.$style)&&void 0!==t&&t.name&&(Pg.loadCSS(i),o.isUnstyled()&&(null===(n=o.$style)||void 0===n||n.loadCSS(i)),_g.setLoadedStyleName(o.$style.name))},_loadThemeStyles:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(null==n||!n.isUnstyled()){if(!og.isStyleNameLoaded("common")){var i,r,s=(null===(i=n.$style)||void 0===i||null===(r=i.getCommonTheme)||void 0===r?void 0:r.call(i))||{},a=s.primitive,l=s.semantic;Pg.load(null==a?void 0:a.css,hv({name:"primitive-variables"},o)),Pg.load(null==l?void 0:l.css,hv({name:"semantic-variables"},o)),Pg.loadTheme(hv({name:"global-style"},o)),og.setLoadedStyleName("common")}if(!og.isStyleNameLoaded(null===(e=n.$style)||void 0===e?void 0:e.name)&&null!==(t=n.$style)&&void 0!==t&&t.name){var c,u,d,p,f=((null===(c=n.$style)||void 0===c||null===(u=c.getDirectiveTheme)||void 0===u?void 0:u.call(c))||{}).css;null===(d=n.$style)||void 0===d||d.load(f,hv({name:"".concat(n.$style.name,"-variables")},o)),null===(p=n.$style)||void 0===p||p.loadTheme(hv({name:"".concat(n.$style.name,"-style")},o)),og.setLoadedStyleName(n.$style.name)}if(!og.isStyleNameLoaded("layer-order")){var h,m,g=null===(h=n.$style)||void 0===h||null===(m=h.getLayerOrderThemeCSS)||void 0===m?void 0:m.call(h);Pg.load(g,hv({name:"layer-order",first:!0},o)),og.setLoadedStyleName("layer-order")}}},_loadScopedThemeStyles:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e.preset();if(n&&e.$attrSelector){var o,i,r,s=((null===(o=e.$style)||void 0===o||null===(i=o.getPresetTheme)||void 0===i?void 0:i.call(o,n,"[".concat(e.$attrSelector,"]")))||{}).css,a=null===(r=e.$style)||void 0===r?void 0:r.load(s,hv({name:"".concat(e.$attrSelector,"-").concat(e.$style.name)},t));e.scopedStyleEl=a.el}},_themeChangeListener:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};_g.clearLoadedStyleNames(),Wm.on("theme:change",e)},_hook:function(e,t,n,o,i,r){var s,a,l,c="on".concat(Cm(l=t,!1)?l[0].toUpperCase()+l.slice(1):l),u=gv._getConfig(o,i),d=null==n?void 0:n.$instance,p=gv._usePT(d,gv._getPT(null==o||null===(s=o.value)||void 0===s?void 0:s.pt,e),gv._getOptionValue,"hooks.".concat(c)),f=gv._useDefaultPT(d,null==u||null===(a=u.pt)||void 0===a||null===(a=a.directives)||void 0===a?void 0:a[e],gv._getOptionValue,"hooks.".concat(c)),h={el:n,binding:o,vnode:i,prevVnode:r};null==p||p(d,h),null==f||f(d,h)},_mergeProps:function(){for(var e=arguments.length>1?arguments[1]:void 0,t=arguments.length,n=new Array(t>2?t-2:0),o=2;o1&&void 0!==arguments[1]?arguments[1]:{},n=function(n,o,i,r,s){var a,l,c;o._$instances=o._$instances||{};var u=gv._getConfig(i,r),d=o._$instances[e]||{},p=_m(d)?hv(hv({},t),null==t?void 0:t.methods):{};o._$instances[e]=hv(hv({},d),{},{$name:e,$host:o,$binding:i,$modifiers:null==i?void 0:i.modifiers,$value:null==i?void 0:i.value,$el:d.$el||o||void 0,$style:hv({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},null==t?void 0:t.style),$primevueConfig:u,$attrSelector:o.$attrSelector,defaultPT:function(){return gv._getPT(null==u?void 0:u.pt,void 0,(function(t){var n;return null==t||null===(n=t.directives)||void 0===n?void 0:n[e]}))},isUnstyled:function(){var e,t;return void 0!==(null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.unstyled)?null===(t=o.$instance)||void 0===t||null===(t=t.$binding)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.unstyled:null==u?void 0:u.unstyled},theme:function(){var e;return null===(e=o.$instance)||void 0===e||null===(e=e.$primevueConfig)||void 0===e?void 0:e.theme},preset:function(){var e;return null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.dt},ptm:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gv._getPTValue(o.$instance,null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.pt,t,hv({},n))},ptmo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return gv._getPTValue(o.$instance,e,t,n,!1)},cx:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null!==(e=o.$instance)&&void 0!==e&&e.isUnstyled()?void 0:gv._getOptionValue(null===(t=o.$instance)||void 0===t||null===(t=t.$style)||void 0===t?void 0:t.classes,n,hv({},i))},sx:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?gv._getOptionValue(null===(e=o.$instance)||void 0===e||null===(e=e.$style)||void 0===e?void 0:e.inlineStyles,t,hv({},n)):void 0}},p),o.$instance=o._$instances[e],null===(a=(l=o.$instance)[n])||void 0===a||a.call(l,o,i,r,s),o["$".concat(e)]=o.$instance,gv._hook(e,n,o,i,r,s),o.$pd||(o.$pd={}),o.$pd[e]=hv(hv({},null===(c=o.$pd)||void 0===c?void 0:c[e]),{},{name:e,instance:o.$instance})};return{created:function(e,t,o,i){n("created",e,t,o,i)},beforeMount:function(e,t,o,i){e.$attrSelector=Bg("pd"),gv._loadStyles(e,t,o),n("beforeMount",e,t,o,i),function(e){var t,n,o,i,r,s=null===(t=e.$instance)||void 0===t?void 0:t.watch;null==s||null===(n=s.config)||void 0===n||n.call(e.$instance,null===(o=e.$instance)||void 0===o?void 0:o.$primevueConfig),cv.on("config:change",(function(t){var n,o=t.newValue,i=t.oldValue;return null==s||null===(n=s.config)||void 0===n?void 0:n.call(e.$instance,o,i)})),null==s||null===(i=s["config.ripple"])||void 0===i||i.call(e.$instance,null===(r=e.$instance)||void 0===r||null===(r=r.$primevueConfig)||void 0===r?void 0:r.ripple),cv.on("config:ripple:change",(function(t){var n,o=t.newValue,i=t.oldValue;return null==s||null===(n=s["config.ripple"])||void 0===n?void 0:n.call(e.$instance,o,i)}))}(e)},mounted:function(e,t,o,i){gv._loadStyles(e,t,o),n("mounted",e,t,o,i)},beforeUpdate:function(e,t,o,i){n("beforeUpdate",e,t,o,i)},updated:function(e,t,o,i){gv._loadStyles(e,t,o),n("updated",e,t,o,i)},beforeUnmount:function(e,t,o,i){n("beforeUnmount",e,t,o,i)},unmounted:function(e,t,o,i){var r;null===(r=e.$instance)||void 0===r||null===(r=r.scopedStyleEl)||void 0===r||null===(r=r.value)||void 0===r||r.remove(),n("unmounted",e,t,o,i)}}},extend:function(){var e=dv(gv._getMeta.apply(gv,arguments),2),t=e[0],n=e[1];return hv({extend:function(){var e=dv(gv._getMeta.apply(gv,arguments),2),t=e[0],o=e[1];return gv.extend(t,hv(hv(hv({},n),null==n?void 0:n.methods),o))}},gv._extend(t,n))}},vv=Pg.extend({name:"ripple-directive",theme:function(e){var t=e.dt;return"\n.p-ink {\n display: block;\n position: absolute;\n background: ".concat(t("ripple.background"),";\n border-radius: 100%;\n transform: scale(0);\n pointer-events: none;\n}\n\n.p-ink-active {\n animation: ripple 0.4s linear;\n}\n\n@keyframes ripple {\n 100% {\n opacity: 0;\n transform: scale(2.5);\n }\n}\n")},classes:{root:"p-ink"}});function yv(e){return(yv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bv(e){return function(e){if(Array.isArray(e))return _v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return _v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_v(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);ne.length)&&(t=e.length);for(var n=0,o=Array(t);n0||navigator.msMaxTouchPoints>0||o.hide(e),window.removeEventListener("resize",t)})),n.addEventListener("mouseleave",(function t(){o.hide(e),n.removeEventListener("mouseleave",t)})),this.bindScrollListener(e),jg.set("tooltip",n,e.$_ptooltipZIndex)}},show:function(e,t,n){var o=this;void 0!==n?this.timer=setTimeout((function(){return o.tooltipActions(e,t)}),n):this.tooltipActions(e,t)},tooltipRemoval:function(e){this.remove(e),this.unbindScrollListener(e)},hide:function(e,t){var n=this;clearTimeout(this.timer),void 0!==t?setTimeout((function(){return n.tooltipRemoval(e)}),t):this.tooltipRemoval(e)},getTooltipElement:function(e){return document.getElementById(e.$_ptooltipId)},create:function(e){var t=e.$_ptooltipModifiers,n=ug("div",{class:!this.isUnstyled()&&this.cx("arrow"),"p-bind":this.ptm("arrow",{context:t})}),o=ug("div",{class:!this.isUnstyled()&&this.cx("text"),"p-bind":this.ptm("text",{context:t})});e.$_ptooltipEscape?(o.innerHTML="",o.appendChild(document.createTextNode(e.$_ptooltipValue))):o.innerHTML=e.$_ptooltipValue;var i=ug("div",Iv(Iv({id:e.$_ptooltipIdAttr,role:"tooltip",style:{display:"inline-block",width:e.$_ptooltipFitContent?"fit-content":void 0,pointerEvents:!this.isUnstyled()&&e.$_ptooltipAutoHide&&"none"},class:[!this.isUnstyled()&&this.cx("root"),e.$_ptooltipClass]},this.$attrSelector,""),"p-bind",this.ptm("root",{context:t})),n,o);return document.body.appendChild(i),e.$_ptooltipId=i.id,this.$el=i,i},remove:function(e){if(e){var t=this.getTooltipElement(e);t&&t.parentElement&&(jg.clear(t),document.body.removeChild(t)),e.$_ptooltipId=null}},align:function(e){var t=e.$_ptooltipModifiers;t.top?(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignTop(e))):t.left?(this.alignLeft(e),this.isOutOfBounds(e)&&(this.alignRight(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignLeft(e))))):t.bottom?(this.alignBottom(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&this.alignBottom(e))):(this.alignRight(e),this.isOutOfBounds(e)&&(this.alignLeft(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignRight(e)))))},getHostOffset:function(e){var t=e.getBoundingClientRect();return{left:t.left+function(){let e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}(),top:t.top+function(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}()}},alignRight:function(e){this.preAlign(e,"right");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+ag(e),i=n.top+(mg(e)-mg(t))/2;t.style.left=o+"px",t.style.top=i+"px"},alignLeft:function(e){this.preAlign(e,"left");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left-ag(t),i=n.top+(mg(e)-mg(t))/2;t.style.left=o+"px",t.style.top=i+"px"},alignTop:function(e){this.preAlign(e,"top");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+(ag(e)-ag(t))/2,i=n.top-mg(t);t.style.left=o+"px",t.style.top=i+"px"},alignBottom:function(e){this.preAlign(e,"bottom");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+(ag(e)-ag(t))/2,i=n.top+mg(e);t.style.left=o+"px",t.style.top=i+"px"},preAlign:function(e,t){var n=this.getTooltipElement(e);n.style.left="-999px",n.style.top="-999px",sg(n,"p-tooltip-".concat(n.$_ptooltipPosition)),!this.isUnstyled()&&rg(n,"p-tooltip-".concat(t)),n.$_ptooltipPosition=t,n.setAttribute("data-p-position",t);var o=dg(n,'[data-pc-section="arrow"]');o.style.top="bottom"===t?"0":"right"===t||"left"===t||"right"!==t&&"left"!==t&&"top"!==t&&"bottom"!==t?"50%":null,o.style.bottom="top"===t?"0":null,o.style.left="right"===t||"right"!==t&&"left"!==t&&"top"!==t&&"bottom"!==t?"0":"top"===t||"bottom"===t?"50%":null,o.style.right="left"===t?"0":null},isOutOfBounds:function(e){var t=this.getTooltipElement(e),n=t.getBoundingClientRect(),o=n.top,i=n.left,r=ag(t),s=mg(t),a=function(){let e=window,t=document,n=t.documentElement,o=t.getElementsByTagName("body")[0];return{width:e.innerWidth||n.clientWidth||o.clientWidth,height:e.innerHeight||n.clientHeight||o.clientHeight}}();return i+r>a.width||i<0||o<0||o+s>a.height},getTarget:function(e){return ig(e,"p-inputwrapper")?dg(e,"input"):e},getModifiers:function(e){return e.modifiers&&Object.keys(e.modifiers).length?e.modifiers:e.arg&&"object"===Nv(e.arg)?Object.entries(e.arg).reduce((function(e,t){var n=Lv(t,2),o=n[0],i=n[1];return"event"!==o&&"position"!==o||(e[i]=!0),e}),{}):{}}}}),Dv={name:"Card",extends:{name:"BaseCard",extends:Jg,style:Pg.extend({name:"card",theme:function(e){var t=e.dt;return"\n.p-card {\n background: ".concat(t("card.background"),";\n color: ").concat(t("card.color"),";\n box-shadow: ").concat(t("card.shadow"),";\n border-radius: ").concat(t("card.border.radius"),";\n display: flex;\n flex-direction: column;\n}\n\n.p-card-caption {\n display: flex;\n flex-direction: column;\n gap: ").concat(t("card.caption.gap"),";\n}\n\n.p-card-body {\n padding: ").concat(t("card.body.padding"),";\n display: flex;\n flex-direction: column;\n gap: ").concat(t("card.body.gap"),";\n}\n\n.p-card-title {\n font-size: ").concat(t("card.title.font.size"),";\n font-weight: ").concat(t("card.title.font.weight"),";\n}\n\n.p-card-subtitle {\n color: ").concat(t("card.subtitle.color"),";\n}\n")},classes:{root:"p-card p-component",header:"p-card-header",body:"p-card-body",caption:"p-card-caption",title:"p-card-title",subtitle:"p-card-subtitle",content:"p-card-content",footer:"p-card-footer"}}),provide:function(){return{$pcCard:this,$parentInstance:this}}},inheritAttrs:!1};Dv.render=function(e,t,n,o,i,r){return $i(),Ui("div",nr({class:e.cx("root")},e.ptmi("root")),[e.$slots.header?($i(),Ui("div",nr({key:0,class:e.cx("header")},e.ptm("header")),[_o(e.$slots,"header")],16)):Ji("",!0),Zi("div",nr({class:e.cx("body")},e.ptm("body")),[e.$slots.title||e.$slots.subtitle?($i(),Ui("div",nr({key:0,class:e.cx("caption")},e.ptm("caption")),[e.$slots.title?($i(),Ui("div",nr({key:0,class:e.cx("title")},e.ptm("title")),[_o(e.$slots,"title")],16)):Ji("",!0),e.$slots.subtitle?($i(),Ui("div",nr({key:1,class:e.cx("subtitle")},e.ptm("subtitle")),[_o(e.$slots,"subtitle")],16)):Ji("",!0)],16)):Ji("",!0),Zi("div",nr({class:e.cx("content")},e.ptm("content")),[_o(e.$slots,"content")],16),e.$slots.footer?($i(),Ui("div",nr({key:1,class:e.cx("footer")},e.ptm("footer")),[_o(e.$slots,"footer")],16)):Ji("",!0)],16)],16)};const jv={class:"no-result-placeholder"},Mv={class:"no-result-placeholder-content"},Rv={key:0},$v={__name:"noResultsPlaceholder",props:{icon:{type:String,default:"",required:!1},iconSize:{type:String,default:"3rem",required:!1},title:{type:String,required:!0},message:{type:String,required:!1},buttonLabel:{type:String,default:"",required:!1}},emits:["action"],setup:e=>(t,n)=>($i(),Ui("div",jv,[Ki(hn(Dv),null,{content:Vn((()=>[Zi("div",Mv,[Zi("i",{class:Me(e.icon),style:Ie({"font-size":e.iconSize,"margin-bottom":".5rem"})},null,6),Zi("h3",null,Be(e.title),1),e.message?($i(),Ui("p",Rv,Be(e.message),1)):Ji("",!0),e.buttonLabel?($i(),zi(hn(Ev),{key:1,label:e.buttonLabel,onClick:n[0]||(n[0]=e=>t.$emit("action")),class:"p-button-text"},null,8,["label"])):Ji("",!0)])])),_:1})]))};var Gv=Pg.extend({name:"inputtext",theme:function(e){var t=e.dt;return"\n.p-inputtext {\n font-family: inherit;\n font-feature-settings: inherit;\n font-size: 1rem;\n color: ".concat(t("inputtext.color"),";\n background: ").concat(t("inputtext.background"),";\n padding: ").concat(t("inputtext.padding.y")," ").concat(t("inputtext.padding.x"),";\n border: 1px solid ").concat(t("inputtext.border.color"),";\n transition: background ").concat(t("inputtext.transition.duration"),", color ").concat(t("inputtext.transition.duration"),", border-color ").concat(t("inputtext.transition.duration"),", outline-color ").concat(t("inputtext.transition.duration"),", box-shadow ").concat(t("inputtext.transition.duration"),";\n appearance: none;\n border-radius: ").concat(t("inputtext.border.radius"),";\n outline-color: transparent;\n box-shadow: ").concat(t("inputtext.shadow"),";\n}\n\n.p-inputtext:enabled:hover {\n border-color: ").concat(t("inputtext.hover.border.color"),";\n}\n\n.p-inputtext:enabled:focus {\n border-color: ").concat(t("inputtext.focus.border.color"),";\n box-shadow: ").concat(t("inputtext.focus.ring.shadow"),";\n outline: ").concat(t("inputtext.focus.ring.width")," ").concat(t("inputtext.focus.ring.style")," ").concat(t("inputtext.focus.ring.color"),";\n outline-offset: ").concat(t("inputtext.focus.ring.offset"),";\n}\n\n.p-inputtext.p-invalid {\n border-color: ").concat(t("inputtext.invalid.border.color"),";\n}\n\n.p-inputtext.p-variant-filled {\n background: ").concat(t("inputtext.filled.background"),";\n}\n\n.p-inputtext.p-variant-filled:enabled:focus {\n background: ").concat(t("inputtext.filled.focus.background"),";\n}\n\n.p-inputtext:disabled {\n opacity: 1;\n background: ").concat(t("inputtext.disabled.background"),";\n color: ").concat(t("inputtext.disabled.color"),";\n}\n\n.p-inputtext::placeholder {\n color: ").concat(t("inputtext.placeholder.color"),";\n}\n\n.p-inputtext-sm {\n font-size: ").concat(t("inputtext.sm.font.size"),";\n padding: ").concat(t("inputtext.sm.padding.y")," ").concat(t("inputtext.sm.padding.x"),";\n}\n\n.p-inputtext-lg {\n font-size: ").concat(t("inputtext.lg.font.size"),";\n padding: ").concat(t("inputtext.lg.padding.y")," ").concat(t("inputtext.lg.padding.x"),";\n}\n\n.p-inputtext-fluid {\n width: 100%;\n}\n")},classes:{root:function(e){var t=e.instance,n=e.props;return["p-inputtext p-component",{"p-filled":t.filled,"p-inputtext-sm":"small"===n.size,"p-inputtext-lg":"large"===n.size,"p-invalid":n.invalid,"p-variant-filled":n.variant?"filled"===n.variant:"filled"===t.$primevue.config.inputStyle||"filled"===t.$primevue.config.inputVariant,"p-inputtext-fluid":t.hasFluid}]}}}),Bv={name:"InputText",extends:{name:"BaseInputText",extends:Jg,props:{modelValue:null,size:{type:String,default:null},invalid:{type:Boolean,default:!1},variant:{type:String,default:null},fluid:{type:Boolean,default:null}},style:Gv,provide:function(){return{$pcInputText:this,$parentInstance:this}}},inheritAttrs:!1,emits:["update:modelValue"],inject:{$pcFluid:{default:null}},methods:{getPTOptions:function(e){return("root"===e?this.ptmi:this.ptm)(e,{context:{filled:this.filled,disabled:this.$attrs.disabled||""===this.$attrs.disabled}})},onInput:function(e){this.$emit("update:modelValue",e.target.value)}},computed:{filled:function(){return null!=this.modelValue&&this.modelValue.toString().length>0},hasFluid:function(){return _m(this.fluid)?!!this.$pcFluid:this.fluid}}},Fv=["value","aria-invalid"];Bv.render=function(e,t,n,o,i,r){return $i(),Ui("input",nr({type:"text",class:e.cx("root"),value:e.modelValue,"aria-invalid":e.invalid||void 0,onInput:t[0]||(t[0]=function(){return r.onInput&&r.onInput.apply(r,arguments)})},r.getPTOptions("root")),null,16,Fv)};const Uv={class:"left flex-1"},zv={key:1,class:"edit"},Vv={key:2,class:"label"},Hv={class:"right toolbar"},Wv={key:0,class:"nodes"},Yv={__name:"group",props:{item:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup(e){const t=e,n=np(),o=pn(!1),i=pn(null),r=pn(""),s=e=>{var o,i;let r=t.item;if(!(null==(o=r.info)?void 0:o.is_edit)&&(null==(i=r.children)?void 0:i.length)>0){let e=y.canvas.graph._groups.find((e=>e.pos[0]==r.info.pos[0]&&e.pos[1]==r.info.pos[1]));e&&(e.show_nodes=!e.show_nodes,n.setGroups(y.canvas.graph._groups))}},a=async()=>{let e=t.item,i=y.canvas.graph._groups.find((t=>t.pos[0]==e.info.pos[0]&&t.pos[1]==e.info.pos[1]));i?(i.is_edit=!1,i.title=r.value,await n.setGroups(y.canvas.graph._groups),o.value=!1):o.value=!1};return(l,c)=>{var u,d,p;return $i(),Ui(Ni,null,[Zi("div",{class:Me("comfyui-easyuse-map-nodes-group"),onClick:s},[Zi("div",Uv,[e.item.children?($i(),Ui("i",{key:0,class:Me(["icon",e.item.info.show_nodes?"pi pi-folder-open":"pi pi-folder"]),style:Ie({color:e.item.info.color})},null,6)):Ji("",!0),(null==(u=e.item.info)?void 0:u.is_edit)?($i(),Ui("div",zv,[Ki(hn(Bv),{ref_key:"modifyRef",ref:i,modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=e=>r.value=e),variant:"outline",size:"small",type:"text",onBlur:a,onKeydown:[qr(a,["enter"]),qr(a,["esc"])],style:{width:"100%"}},null,8,["modelValue"])])):($i(),Ui("div",Vv,[Zi("span",{onDblclick:c[1]||(c[1]=Qr((s=>(async()=>{var e,s;if(o.value)return;let a=t.item,l=y.canvas.graph._groups.find((e=>e.pos[0]==a.info.pos[0]&&e.pos[1]==a.info.pos[1]));l&&(l.is_edit=!l.is_edit,r.value=l.is_edit?a.info.title:"",await n.setGroups(y.canvas.graph._groups),o.value=!0,null==(s=null==(e=i.value)?void 0:e[0])||s.$el.focus())})(e.item)),["stop"]))},Be(e.item.info.title),33)]))]),Zi("div",Hv,[(null==(d=e.item.children)?void 0:d.length)>0?($i(),zi(hn(Ev),{key:0,size:"small",icon:e.item.children.find((e=>e.mode==hn(j).ALWAYS))?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:c[2]||(c[2]=Qr((e=>l.$emit("changeMode")),["stop"])),onMousedown:c[3]||(c[3]=Qr((e=>l.$emit("mousedown")),["stop"])),onMouseup:c[4]||(c[4]=Qr((e=>l.$emit("mouseup")),["stop"]))},null,8,["icon"])):Ji("",!0)])]),(null==(p=e.item.children)?void 0:p.length)>0&&e.item.info.show_nodes?($i(),Ui("div",Wv,[_o(l.$slots,"default")])):Ji("",!0)],64)}}},Zv={key:1,class:"label error"},Kv={class:"right toolbar"},Xv={__name:"node",props:{node:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup:e=>(t,n)=>($i(),Ui("div",{class:Me(["comfyui-easyuse-map-nodes-node",{never:void 0!==e.node.mode&&e.node.mode==hn(j).NEVER},{bypass:void 0!==e.node.mode&&e.node.mode==hn(j).BYPASS}])},[void 0!==e.node.title?($i(),Ui("span",{key:0,class:"label",onDblclick:n[0]||(n[0]=Qr((t=>hn(Lp)(e.node.id)),["stop"]))},Be(e.node.title),33)):($i(),Ui("span",Zv,Be(e.node.type),1)),Zi("div",Kv,[Ki(hn(Ev),{size:"small",icon:e.node.mode==hn(j).ALWAYS?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:n[1]||(n[1]=Qr((e=>t.$emit("changeMode")),["stop"])),onMousedown:n[2]||(n[2]=Qr((e=>t.$emit("mousedown")),["stop"])),onMouseup:n[3]||(n[3]=Qr((e=>t.$emit("mouseup")),["stop"]))},null,8,["icon"])])],2))},Qv={class:"title"},Jv={class:"toolbar"},qv={key:0},ey={key:1,class:"no_result",style:{height:"100%"}},ty="comfyui-easyuse-map-nodes",ny={__name:"nodesMap",setup(e){const t=np(),{groups_nodes:n,groups:o}=ws(t),i=pn(!1),r=e=>{i.value=!i.value,y.canvas.graph._groups.forEach((e=>{e.show_nodes=i.value})),t.setGroups(y.canvas.graph._groups)};let s,a=0,l=0,c=!1;const u=(e,n=!1)=>{if(c)return void(c=!1);const o=e.children.find((e=>e.mode==j.ALWAYS)),i=e.children.map((e=>e.id));y.canvas.graph._nodes.forEach((e=>{i.includes(e.id)&&(e.mode=o?n?j.NEVER:j.BYPASS:j.ALWAYS,e.graph.change())})),t.setNodes(y.canvas.graph._nodes)},d=(e,n=!1)=>{if(c)return void(c=!1);const o=e.mode==j.ALWAYS,i=y.canvas.graph._nodes.find((t=>t.id==e.id));i&&(i.mode=o?n?j.NEVER:j.BYPASS:j.ALWAYS,i.graph.change(),t.setNodes(y.canvas.graph._nodes))},p=(e,t="group")=>{a=(new Date).getTime(),clearTimeout(s),s=setTimeout((n=>{"group"==t?u(e,!0):d(e,!0)}),500)},f=e=>{l=(new Date).getTime(),l-a>500&&(c=!0),clearTimeout(s)};return(e,t)=>{var s,a;return $i(),Ui("div",{class:Me(ty)},[Zi("div",{class:Me(ty+"__header")},[Zi("div",Qv,Be(hn(V)("Nodes Map",!0)),1),Zi("div",Jv,[(null==(s=hn(o))?void 0:s.length)>0?Hn(($i(),zi(hn(Ev),{key:0,icon:i.value?"pi pi-angle-double-down":"pi pi-angle-double-up",text:"",rounded:"",severity:"secondary",onClick:r,size:"small"},null,8,["icon"])),[[hn(Pv),i.value?hn(V)("Collapse All"):hn(V)("Expand All"),void 0,{right:!0}]]):Ji("",!0)])],2),Zi("div",{class:Me(ty+"__content")},[(null==(a=hn(n))?void 0:a.length)>0?($i(),Ui("ol",qv,[($i(!0),Ui(Ni,null,bo(hn(n),((e,t)=>($i(),Ui("li",{key:t},[void 0!==e.children?($i(),zi(Yv,{key:0,item:e,onChangeMode:t=>u(e),onMousedown:t=>p(e,"group"),onMouseup:f},{default:Vn((()=>[($i(!0),Ui(Ni,null,bo(e.children,((e,t)=>($i(),zi(Xv,{key:t,node:e,onChangeMode:t=>d(e),onMousedown:t=>p(e,"node"),onMouseup:f},null,8,["node","onChangeMode","onMousedown"])))),128))])),_:2},1032,["item","onChangeMode","onMousedown"])):($i(),zi(Xv,{key:1,node:e.info,onChangeMode:t=>d(e.info),onMousedown:t=>p(e.info,"node"),onMouseup:f},null,8,["node","onChangeMode","onMousedown"]))])))),128))])):($i(),Ui("div",ey,[Ki($v,{icon:"pi pi-sitemap",title:hn(V)("No Nodes",!0),message:hn(V)("No nodes found in the map",!0)},null,8,["title","message"])]))],2)])}}},oy={__name:"index",setup(e){const t=np();return oo((e=>{t.watchGraph()})),ao((e=>{})),(e,t)=>($i(),Ui("div",{class:Me("comfyui-easyuse-map")},[Ki(ny)]))}},iy={__name:"App",setup(e){const t=e=>{y.extensionManager.registerSidebarTab({id:M,icon:"pi pi-sitemap",title:V("Nodes Map",!0),tooltip:V("Nodes Map",!0),type:"custom",render:e=>{e.style.height="100%",((...e)=>{ns().render(...e)})(function(e,t,n){const o=arguments.length;return 2===o?ue(t)&&!ie(t)?Vi(t)?Ki(e,null,[t]):Ki(e,t):Ki(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):3===o&&Vi(n)&&(n=[n]),Ki(e,t,n))}(oy,{}),e)}})};return oo((e=>{try{t()}catch(n){}})),(e,t)=>($i(),zi(hm))}};var ry="equals",sy="notEquals";function ay(e){return(ay="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function cy(e){for(var t=1;t{const t=ns().createApp(...e),{mount:n}=t;return t.mount=e=>{const o=function(e){if(le(e)){return document.querySelector(e)}return e}(e);if(!o)return;const i=t._component;ae(i)||i.render||i.template||(i.template=o.innerHTML),o.innerHTML="";const r=n(o,!1,function(e){if(e instanceof SVGElement)return"svg";if("function"==typeof MathMLElement&&e instanceof MathMLElement)return"mathml"}(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t})(iy);yy.use(my),yy.use(function(){const e=We(!0),t=e.run((()=>pn({})));let n=[],o=[];const i=rn({install(e){is(i),i._a=e,e.provide(rs,i),e.config.globalProperties.$pinia=i,o.forEach((e=>n.push(e))),o=[]},use(e){return this._a?n.push(e):o.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}()),yy.mount("#"+vy.id); +let os;const is=e=>os=e,rs=Symbol();function ss(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var as,ls;(ls=as||(as={})).direct="direct",ls.patchObject="patch object",ls.patchFunction="patch function";const cs=()=>{};function us(e,t,n,o=cs){e.push(t);const i=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),o())};var r;return!n&&Ye()&&(r=i,ze&&ze.cleanups.push(r)),i}function ds(e,...t){e.slice().forEach((e=>{e(...t)}))}const ps=e=>e(),fs=Symbol(),hs=Symbol();function ms(e,t){e instanceof Map&&t instanceof Map?t.forEach(((t,n)=>e.set(n,t))):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const o=t[n],i=e[n];ss(i)&&ss(o)&&e.hasOwnProperty(n)&&!dn(o)&&!qt(o)?e[n]=ms(i,o):e[n]=o}return e}const gs=Symbol();const{assign:vs}=Object;function ys(e,t,n,o){const{state:i,actions:r,getters:s}=t,a=n.state.value[e];let l;return l=bs(e,(function(){a||(n.state.value[e]=i?i():{});const t=function(e){const t=ie(e)?new Array(e.length):{};for(const n in e)t[n]=_n(e,n);return t}(n.state.value[e]);return vs(t,r,Object.keys(s||{}).reduce(((t,o)=>(t[o]=rn(_r((()=>{is(n);const t=n._s.get(e);return s[o].call(t,t)}))),t)),{}))}),t,n,o,!0),l}function bs(e,t,n={},o,i,r){let s;const a=vs({actions:{}},n),l={deep:!0};let c,u,d,p=[],f=[];const h=o.state.value[e];let m;function g(t){let n;c=u=!1,"function"==typeof t?(t(o.state.value[e]),n={type:as.patchFunction,storeId:e,events:d}):(ms(o.state.value[e],t),n={type:as.patchObject,payload:t,storeId:e,events:d});const i=m=Symbol();Pn().then((()=>{m===i&&(c=!0)})),u=!0,ds(p,n,o.state.value[e])}r||h||(o.state.value[e]={}),pn({});const v=r?function(){const{state:e}=n,t=e?e():{};this.$patch((e=>{vs(e,t)}))}:cs;const y=(t,n="")=>{if(fs in t)return t[hs]=n,t;const i=function(){is(o);const n=Array.from(arguments),r=[],s=[];let a;ds(f,{args:n,name:i[hs],store:b,after:function(e){r.push(e)},onError:function(e){s.push(e)}});try{a=t.apply(this&&this.$id===e?this:b,n)}catch(l){throw ds(s,l),l}return a instanceof Promise?a.then((e=>(ds(r,e),e))).catch((e=>(ds(s,e),Promise.reject(e)))):(ds(r,a),a)};return i[fs]=!0,i[hs]=n,i},b=Xt({_p:o,$id:e,$onAction:us.bind(null,f),$patch:g,$reset:v,$subscribe(t,n={}){const i=us(p,t,n.detached,(()=>r())),r=s.run((()=>bi((()=>o.state.value[e]),(o=>{("sync"===n.flush?u:c)&&t({storeId:e,type:as.direct,events:d},o)}),vs({},l,n))));return i},$dispose:function(){s.stop(),p=[],f=[],o._s.delete(e)}});o._s.set(e,b);const _=(o._a&&o._a.runWithContext||ps)((()=>o._e.run((()=>(s=We()).run((()=>t({action:y})))))));for(const x in _){const t=_[x];if(dn(t)&&(!dn(S=t)||!S.effect)||qt(t))r||(!h||ss(w=t)&&w.hasOwnProperty(gs)||(dn(t)?t.value=h[x]:ms(t,h[x])),o.state.value[e][x]=t);else if("function"==typeof t){const e=y(t,x);_[x]=e,a.actions[x]=t}}var w,S;return vs(b,_),vs(on(b),_),Object.defineProperty(b,"$state",{get:()=>o.state.value[e],set:e=>{g((t=>{vs(t,e)}))}}),o._p.forEach((e=>{vs(b,s.run((()=>e({store:b,app:o._a,pinia:o,options:a}))))})),h&&r&&n.hydrate&&n.hydrate(b.$state,h),c=!0,u=!0,b}function _s(e,t,n){let o,i;const r="function"==typeof t;function s(e,n){(e=e||(!!(sr||Fn||Uo)?zo(rs,null):null))&&is(e),(e=os)._s.has(o)||(r?bs(o,t,i,e):ys(o,i,e));return e._s.get(o)}return"string"==typeof e?(o=e,i=r?n:t):(i=e,o=e.id),s.$id=o,s}function ws(e){{e=on(e);const t={};for(const n in e){const o=e[n];(dn(o)||qt(o))&&(t[n]=bn(e,n))}return t}}var Ss="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ks=function(){this.__data__=[],this.size=0};var Cs=function(e,t){return e===t||e!=e&&t!=t},As=Cs;var Es=function(e,t){for(var n=e.length;n--;)if(As(e[n][0],t))return n;return-1},Os=Es,Ls=Array.prototype.splice;var Ts=Es;var Ns=Es;var Is=Es;var Ps=ks,Ds=function(e){var t=this.__data__,n=Os(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ls.call(t,n,1),--this.size,!0)},js=function(e){var t=this.__data__,n=Ts(t,e);return n<0?void 0:t[n][1]},Ms=function(e){return Ns(this.__data__,e)>-1},Rs=function(e,t){var n=this.__data__,o=Is(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this};function $s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},ec=sa,tc=ql,nc=Nl,oc={};oc["[object Float32Array]"]=oc["[object Float64Array]"]=oc["[object Int8Array]"]=oc["[object Int16Array]"]=oc["[object Int32Array]"]=oc["[object Uint8Array]"]=oc["[object Uint8ClampedArray]"]=oc["[object Uint16Array]"]=oc["[object Uint32Array]"]=!0,oc["[object Arguments]"]=oc["[object Array]"]=oc["[object ArrayBuffer]"]=oc["[object Boolean]"]=oc["[object DataView]"]=oc["[object Date]"]=oc["[object Error]"]=oc["[object Function]"]=oc["[object Map]"]=oc["[object Number]"]=oc["[object Object]"]=oc["[object RegExp]"]=oc["[object Set]"]=oc["[object String]"]=oc["[object WeakMap]"]=!1;var ic=function(e){return nc(e)&&tc(e.length)&&!!oc[ec(e)]};var rc=function(e){return function(t){return e(t)}},sc={exports:{}};!function(e,t){var n=Hs,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,r=i&&i.exports===o&&n.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||r&&r.binding&&r.binding("util")}catch(t){}}();e.exports=s}(sc,sc.exports);var ac=sc.exports,lc=ic,cc=rc,uc=ac&&ac.isTypedArray,dc=uc?cc(uc):lc,pc=Tl,fc=Yl,hc=Zl,mc=Xl,gc=Jl,vc=dc,yc=Object.prototype.hasOwnProperty;var bc=function(e,t){var n=hc(e),o=!n&&fc(e),i=!n&&!o&&mc(e),r=!n&&!o&&!i&&vc(e),s=n||o||i||r,a=s?pc(e.length,String):[],l=a.length;for(var c in e)!t&&!yc.call(e,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||gc(c,l))||a.push(c);return a},_c=Object.prototype;var wc=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_c)};var Sc=function(e,t){return function(n){return e(t(n))}},xc=Sc(Object.keys,Object),kc=wc,Cc=xc,Ac=Object.prototype.hasOwnProperty;var Ec=da,Oc=ql;var Lc=function(e){return null!=e&&Oc(e.length)&&!Ec(e)},Tc=bc,Nc=function(e){if(!kc(e))return Cc(e);var t=[];for(var n in Object(e))Ac.call(e,n)&&"constructor"!=n&&t.push(n);return t},Ic=Lc;var Pc=function(e){return Ic(e)?Tc(e):Nc(e)},Dc=Ll,jc=Pc;var Mc=function(e,t){return e&&Dc(t,jc(t),e)};var Rc=aa,$c=wc,Gc=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Bc=Object.prototype.hasOwnProperty;var Fc=bc,Uc=function(e){if(!Rc(e))return Gc(e);var t=$c(e),n=[];for(var o in e)("constructor"!=o||!t&&Bc.call(e,o))&&n.push(o);return n},zc=Lc;var Vc=function(e){return zc(e)?Fc(e,!0):Uc(e)},Hc=Ll,Wc=Vc;var Yc=function(e,t){return e&&Hc(t,Wc(t),e)},Zc={exports:{}};!function(e,t){var n=Zs,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,r=i&&i.exports===o?n.Buffer:void 0,s=r?r.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,o=s?s(n):new e.constructor(n);return e.copy(o),o}}(Zc,Zc.exports);var Kc=Zc.exports;var Xc=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n({groups:[],nodes:[]}),getters:{groups_nodes(){var e;let t=[],n=[];if((null==(e=this.nodes)?void 0:e.length)>0){this.nodes.map((e=>{let o=e.pos,i=!1;for(let n=0;nr.pos[0]&&o[0]r.pos[1]&&o[1]e.pos[0]-t.pos[0])).sort(((e,t)=>e.pos[1]-t.pos[1])))},setNodes(e){this.nodes=tp(e)},update(){y.extensionManager.activeSidebarTab===M&&setTimeout((e=>{this.setGroups(y.canvas.graph._groups),this.setNodes(y.canvas.graph._nodes)}),1)},watchGraph(){let e=this;this.update();const t=y.graph.onNodeAdded;y.graph.onNodeAdded=function(n){e.update();const o=n.onRemoved;return n.onRemoved=function(){return e.update(),null==o?void 0:o.apply(this,arguments)},null==t?void 0:t.apply(this,arguments)},y.canvas.onNodeMoved=function(t){e.update()};const n=LGraphCanvas.onNodeAlign;LGraphCanvas.onNodeAlign=function(t){return e.update(),null==n?void 0:n.apply(this,arguments)};const o=LGraphCanvas.onGroupAdd;LGraphCanvas.onGroupAdd=function(){return e.update(),null==o?void 0:o.apply(this,arguments)};const i=LGraphCanvas.onGroupAlign;LGraphCanvas.onGroupAlign=function(t){return e.update(),null==i?void 0:i.apply(this,arguments)};const r=LGraphCanvas.onMenuNodeRemove;LGraphCanvas.onMenuNodeRemove=function(t){return e.update(),null==r?void 0:r.apply(this,arguments)}}}});let op=null;const ip=["custom_obsidian","custom_obsidian_dark","custom_milk_white"],rp={"easy positive":"green","easy negative":"red","easy promptList":"cyan","easy promptLine":"cyan","easy promptConcat":"cyan","easy promptReplace":"cyan","easy textSwitch":"pale_blue"};let sp=LGraphCanvas.node_colors,ap=null,lp=null,cp=null,up=null;for(let by in H)dp=H[by],y.ui.settings.addSetting(dp);var dp;function pp(e,t=!1){let n="after",o="before";t&&([o,n]=[n,o]),e.label=(e.label??e.name).replace(o,n),e.name=e.label}function fp(e,t,n,o,i,r,s){t.strokeStyle=o,t.fillStyle=i;let a=LiteGraph.NODE_TITLE_HEIGHT,l=this.ds.scale<.5,c=e._shape||e.constructor.shape||LiteGraph.ROUND_SHAPE,u=e.constructor.title_mode,d=!0;u==LiteGraph.TRANSPARENT_TITLE||u==LiteGraph.NO_TITLE?d=!1:u==LiteGraph.AUTOHIDE_TITLE&&mouse_over&&(d=!0);let p=new Float32Array(4);p=[0,d?-a:0,n[0]+1,d?n[1]+a:n[1]];let f=t.globalAlpha;if(t.lineWidth=1,t.beginPath(),c==LiteGraph.BOX_SHAPE||l?t.fillRect(p[0],p[1],p[2],p[3]):c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CARD_SHAPE?t.roundRect(p[0],p[1],p[2],p[3],c==LiteGraph.CARD_SHAPE?[this.round_radius,this.round_radius,0,0]:[this.round_radius]):c==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*n[0],.5*n[1],.5*n[0],0,2*Math.PI),t.strokeStyle=LiteGraph.WIDGET_OUTLINE_COLOR,t.stroke(),t.strokeStyle=o,t.fill(),!e.flags.collapsed&&d&&(t.shadowColor="transparent",t.fillStyle="rgba(0,0,0,0.2)",t.fillRect(0,-1,p[2],2)),t.shadowColor="transparent",e.onDrawBackground&&e.onDrawBackground(t,this,this.canvas,this.graph_mouse),d||u==LiteGraph.TRANSPARENT_TITLE){const i="dark"==function(e){let t=e.replace("#","");return n=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16),.299*n+.587*o+.114*i>127.5?"light":"dark";var n,o,i}((null==e?void 0:e.color)||"#ffffff");if(e.onDrawTitleBar)e.onDrawTitleBar(t,a,n,this.ds.scale,o);else if(u!=LiteGraph.TRANSPARENT_TITLE&&(e.constructor.title_color||this.render_title_colored)){let i=e.constructor.title_color||o;if(e.flags.collapsed&&(t.shadowColor=LiteGraph.DEFAULT_SHADOW_COLOR),this.use_gradients){let e=LGraphCanvas.gradients[i];e||(e=LGraphCanvas.gradients[i]=t.createLinearGradient(0,0,400,0),e.addColorStop(0,i),e.addColorStop(1,"#000")),t.fillStyle=e}else t.fillStyle=i;t.beginPath(),c==LiteGraph.BOX_SHAPE||l?t.rect(0,-a,n[0]+1,a):c!=LiteGraph.ROUND_SHAPE&&c!=LiteGraph.CARD_SHAPE||t.roundRect(0,-a,n[0]+1,a,e.flags.collapsed?[this.round_radius]:[this.round_radius,this.round_radius,0,0]),t.fill(),t.shadowColor="transparent"}let s=!1;LiteGraph.node_box_coloured_by_mode&&LiteGraph.NODE_MODES_COLORS[e.mode]&&(s=LiteGraph.NODE_MODES_COLORS[e.mode]),LiteGraph.node_box_coloured_when_on&&(s=e.action_triggered?"#FFF":e.execute_triggered?"#AAA":s);let d=10;if(e.onDrawTitleBox)e.onDrawTitleBox(t,a,n,this.ds.scale);else if(c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CIRCLE_SHAPE||c==LiteGraph.CARD_SHAPE){const n=i?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR,o=i?"#eeeeee":e.boxcolor||s||LiteGraph.NODE_DEFAULT_BOXCOLOR;t.fillStyle=r?n:o,t.beginPath(),t.fillRect(10,0-1.05*d-1,1.1*d,.125*d),t.fillRect(10,0-1.45*d-1,1.1*d,.125*d),t.fillRect(10,0-1.85*d-1,1.1*d,.125*d)}else t.fillStyle=e.boxcolor||s||LiteGraph.NODE_DEFAULT_BOXCOLOR,t.fillRect(.5*(a-d),-.5*(a+d),d,d);if(t.globalAlpha=f,e.onDrawTitleText&&e.onDrawTitleText(t,a,n,this.ds.scale,this.title_text_font,r),!l){t.font=this.title_text_font;let n=String(e.getTitle());n&&(t.fillStyle=r?i?"#ffffff":LiteGraph.NODE_SELECTED_TITLE_COLOR:i?"#ffffff":e.constructor.title_text_color||this.node_title_color,e.flags.collapsed?(t.textAlign="left",t.measureText(n),t.fillText(n.substr(0,20),a,LiteGraph.NODE_TITLE_TEXT_Y-a),t.textAlign="left"):(t.textAlign="left",t.fillText(n,a,LiteGraph.NODE_TITLE_TEXT_Y-a)))}if(!e.flags.collapsed&&e.subgraph&&!e.skip_subgraph_button){let n=LiteGraph.NODE_TITLE_HEIGHT,o=e.size[0]-n,i=LiteGraph.isInsideRectangle(this.graph_mouse[0]-e.pos[0],this.graph_mouse[1]-e.pos[1],o+2,2-n,n-4,n-4);t.fillStyle=i?"#888":"#555",c==LiteGraph.BOX_SHAPE||l?t.fillRect(o+2,2-n,n-4,n-4):(t.beginPath(),t.roundRect(o+2,2-n,n-4,n-4,[4]),t.fill()),t.fillStyle="#333",t.beginPath(),t.moveTo(o+.2*n,.6*-n),t.lineTo(o+.8*n,.6*-n),t.lineTo(o+.5*n,.3*-n),t.fill()}e.onDrawTitle&&e.onDrawTitle(t)}if(r){e.onBounding&&e.onBounding(p),u==LiteGraph.TRANSPARENT_TITLE&&(p[1]-=a,p[3]+=a),t.lineWidth=2,t.globalAlpha=.8,t.beginPath();let i=0,r=0,s=1;c==LiteGraph.BOX_SHAPE?t.rect(i+p[0],i+p[1],r+p[2],r+p[3]):c==LiteGraph.ROUND_SHAPE||c==LiteGraph.CARD_SHAPE&&e.flags.collapsed?t.roundRect(i+p[0],i+p[1],r+p[2],r+p[3],[this.round_radius*s]):c==LiteGraph.CARD_SHAPE?t.roundRect(i+p[0],i+p[1],r+p[2],r+p[3],[this.round_radius*s,s,this.round_radius*s,s]):c==LiteGraph.CIRCLE_SHAPE&&t.arc(.5*n[0],.5*n[1],.5*n[0]+6,0,2*Math.PI),t.strokeStyle=LiteGraph.NODE_BOX_OUTLINE_COLOR,t.stroke(),t.strokeStyle=o,t.globalAlpha=1}e.execute_triggered>0&&e.execute_triggered--,e.action_triggered>0&&e.action_triggered--}function hp(e,t,n,o){if(!e.widgets||!e.widgets.length)return 0;let i=e.size[0],r=e.widgets;t+=2;let s=LiteGraph.NODE_WIDGET_HEIGHT,a=this.ds.scale>.5;n.save(),n.globalAlpha=this.editor_alpha;let l=LiteGraph.WIDGET_OUTLINE_COLOR,c=LiteGraph.WIDGET_BGCOLOR,u=LiteGraph.WIDGET_TEXT_COLOR,d=LiteGraph.WIDGET_SECONDARY_TEXT_COLOR,p=12;for(let f=0;f1&&(i=1),n.fillStyle=h.options.hasOwnProperty("slider_color")?h.options.slider_color:o==h?l:N,n.beginPath(),n.roundRect(p,m,i*(g-24),s,[.25*s]),n.fill(),h.marker){let e=(h.marker-h.options.min)/t;e<0&&(e=0),e>1&&(e=1),n.fillStyle=h.options.hasOwnProperty("marker_color")?h.options.marker_color:"#AA9",n.roundRect(p+e*(g-24),m,2,s,[.25*s])}if(a){n.textAlign="center",n.fillStyle=u;let e=(h.label||h.name)+": "+Number(h.value).toFixed(null!=h.options.precision?h.options.precision:3).toString();n.fillText(e,.5*g,m+.7*s)}break;case"number":case"combo":if(n.textAlign="left",n.strokeStyle=l,n.fillStyle=c,n.beginPath(),a?n.roundRect(p,m,g-24,s,[.25*s]):n.rect(p,m,g-24,s),n.fill(),a){h.disabled||n.stroke(),n.fillStyle=u,h.disabled||(n.beginPath(),n.moveTo(24,m+6.5),n.lineTo(18,m+.5*s),n.lineTo(24,m+s-6.5),n.fill(),n.beginPath(),n.moveTo(g-p-12,m+6.5),n.lineTo(g-p-6,m+.5*s),n.lineTo(g-p-12,m+s-6.5),n.fill()),n.fillStyle=d,n.font="10px Inter",n.fillText(h.label||h.name,29,m+.7*s),n.fillStyle=u,n.textAlign="right";let e=6;if("number"==h.type)n.font="10px Inter",n.fillText(Number(h.value).toFixed(void 0!==h.options.precision?h.options.precision:3),g-24-e,m+.7*s);else{let t=h.value;if(h.options.values){let e=h.options.values;e.constructor===Function&&(e=e()),e&&e.constructor!==Array&&(t=e[h.value])}n.fillText(t,g-24-e,m+.7*s)}}break;case"string":case"text":if(n.textAlign="left",n.strokeStyle=l,n.fillStyle=c,n.beginPath(),a?n.roundRect(p,m,g-24,s,[.25*s]):n.rect(p,m,g-24,s),n.fill(),a){h.disabled||n.stroke(),n.save(),n.beginPath(),n.rect(p,m,g-24,s),n.clip(),n.fillStyle=d;const e=h.label||h.name;n.font="10px Inter",null!=e&&n.fillText(e,24,m+.7*s),n.fillStyle=u,n.textAlign="right",n.fillText(String(h.value).substr(0,30),g-24,m+.7*s),n.restore()}break;default:h.draw&&h.draw(n,e,g,m,s)}t+=(h.computeSize?h.computeSize(g)[1]:s)+4,n.globalAlpha=this.editor_alpha}n.restore(),n.textAlign="left"}function mp(e,t,n,o,i){return new LiteGraph.ContextMenu(LiteGraph.NODE_MODES,{event:n,callback:function(e){if(!i)return;var t=Object.values(LiteGraph.NODE_MODES).indexOf(e),n=function(e){t>=0&&LiteGraph.NODE_MODES[t]?e.changeMode(t):e.changeMode(LiteGraph.ALWAYS),op||(op=np()),op.update()},o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)n(i);else for(var r in o.selected_nodes)n(o.selected_nodes[r])},parentMenu:o,node:i}),!1}function gp(e,t,n,o,i){if(!i)throw"no node for color";var r=[];for(var s in r.push({value:null,content:"No color"}),LGraphCanvas.node_colors){var a=LGraphCanvas.node_colors[s];e={value:s,content:""+s+""};r.push(e)}return new LiteGraph.ContextMenu(r,{event:n,callback:function(e){if(!i)return;var t=e.value?LGraphCanvas.node_colors[e.value]:null,n=function(e){t?e.constructor===LiteGraph.LGraphGroup?e.color=t.groupcolor:(e.color=t.color,e.bgcolor=t.bgcolor):(delete e.color,delete e.bgcolor),op||(op=np()),op.update()},o=LGraphCanvas.active_canvas;if(!o.selected_nodes||Object.keys(o.selected_nodes).length<=1)n(i);else for(var r in o.selected_nodes)n(o.selected_nodes[r]);i.setDirtyCanvas(!0,!0)},parentMenu:o,node:i}),!1}function vp(e,t,n,o,i){var r=e.property||"title",s=i[r],a=document.createElement("div");a.is_modified=!1,a.className="graphdialog",a.innerHTML="",a.close=function(){a.parentNode&&a.parentNode.removeChild(a)},a.querySelector(".name").innerText=r;var l=a.querySelector(".value");l&&(l.value=s,l.addEventListener("blur",(function(e){this.focus()})),l.addEventListener("keydown",(function(e){if(a.is_modified=!0,27==e.keyCode)a.close();else if(13==e.keyCode)h();else if(13!=e.keyCode&&"textarea"!=e.target.localName)return;e.preventDefault(),e.stopPropagation()})));var c=LGraphCanvas.active_canvas.canvas,u=c.getBoundingClientRect(),d=-20,p=-20;u&&(d-=u.left,p-=u.top),event?(a.style.left=event.clientX+d+"px",a.style.top=event.clientY+p+"px"):(a.style.left=.5*c.width+d+"px",a.style.top=.5*c.height+p+"px"),a.querySelector("button").addEventListener("click",h),c.parentNode.appendChild(a),l&&l.focus();var f=null;function h(){l&&function(t){"Number"==e.type?t=Number(t):"Boolean"==e.type&&(t=Boolean(t));i[r]=t,a.parentNode&&a.parentNode.removeChild(a);i.setDirtyCanvas(!0,!0),op||(op=np());op.update()}(l.value)}a.addEventListener("mouseleave",(function(e){LiteGraph.dialog_close_on_mouse_leave&&!a.is_modified&&LiteGraph.dialog_close_on_mouse_leave&&(f=setTimeout(a.close,LiteGraph.dialog_close_on_mouse_leave_delay))})),a.addEventListener("mouseenter",(function(e){LiteGraph.dialog_close_on_mouse_leave&&f&&clearTimeout(f)}))}y.registerExtension({name:"Comfy.EasyUse.UI",init(){var e,t;const n="Comfy.CustomColorPalettes",o="Comfy.Settings.Comfy.CustomColorPalettes";if(lp||(lp=A(n,o)),cp||(cp=A("Comfy.ColorPalette","Comfy.Settings.Comfy.ColorPalette")||"dark"),(!(null==(e=null==lp?void 0:lp.obsidian)?void 0:e.version)||lp.obsidian.version<$.ColorPalette.version)&&(lp.obsidian=$.ColorPalette,lp.obsidian_dark=G.ColorPalette,E(n,lp,o)),(!(null==(t=null==lp?void 0:lp.milk_white)?void 0:t.version)||lp.milk_white.version{(null==e?void 0:e.value)&&(null==e?void 0:e.oldValue)&&(await W(1),Object.assign(y.canvas.default_connection_color_byType,I),Object.assign(LGraphCanvas.link_type_colors,I)),"custom_milk_white"==e.value&&document.body.classList.remove(T)})),setTimeout((e=>bp(A("Comfy.UseNewMenu")||"Disabled")),1)},async nodeCreated(e){var t;if(rp.hasOwnProperty(e.comfyClass)){const t=rp[e.comfyClass],n=sp[t];if(!n)return;n.color&&(e.color=n.color),n.bgcolor&&(e.bgcolor=n.bgcolor)}if(ap||(ap=A("Comfy.WidgetControlMode")),"before"==ap){const n="before"==ap;if((null==(t=e.widgets)?void 0:t.length)>0)for(const t of e.widgets)if(["control_before_generate","control_after_generate"].includes(t.name)&&(await pp(t,n),t.linkedWidgets))for(const e of t.linkedWidgets)await pp(e,n)}}});const yp=null==(h=y.ui.settings.settingsLookup)?void 0:h["Comfy.UseNewMenu"];yp&&(yp.onChange=e=>bp(e));const bp=e=>{var t;const n=(null==(t=document.getElementById("crystools-root"))?void 0:t.children)||null;if((null==n?void 0:n.length)>0){if(!up)for(let e=0;ee.widgets.find((e=>e.name===t)),Sp=(e,t,n=!1,o="")=>{var i;if(!t||((e,t)=>!!e.inputs&&e.inputs.some((e=>e.name===t)))(e,t.name))return;_p[t.name]||(_p[t.name]={origType:t.type,origComputeSize:t.computeSize});const r=e.size;t.type=n?_p[t.name].origType:"easyHidden"+o,t.computeSize=n?_p[t.name].origComputeSize:()=>[0,-4],null==(i=t.linkedWidgets)||i.forEach((o=>Sp(e,o,":"+t.name,n)));const s=n?Math.max(e.computeSize()[1],r[1]):e.size[1];e.setSize([e.size[0],s])},xp=(e,t=0)=>{var n,o;if(e)return(null==(n=e.widgets)?void 0:n[t])?e.widgets[t].value:e.widgets_values?null==(o=e.widgets_values)?void 0:o[t]:void 0},kp=e=>e.setSize([e.size[0],e.computeSize()[1]]),Cp=(e,t)=>graph.getNodeById(e),Ap=e=>{var t;try{return Object.values(null==(t=null==graph?void 0:graph.list_of_graphcanvas[0])?void 0:t.selected_nodes)}catch(n){return[]}};function Ep(e,t,n){return e+(o=n,(.5-.5*Math.cos(Math.PI*o))*(t-e));var o}const Op=(e,t=!0)=>{var n,o;const i=(null==(o=null==(n=e.graph)?void 0:n.list_of_graphcanvas)?void 0:o[0])||null;if(!i)return;const[r,s]=e.pos,[a,l]=e.size;(([e,t],n)=>{const o=n.ds,i=document.body.clientWidth,r=document.body.clientHeight,s=o.scale,a=.5*i/s-e,l=.5*r/s-t,c=Date.now()+250,u=o.offset[0],d=o.offset[1],p=()=>{const e=c-Date.now();if(!(Date.now(){const t=Cp(e);t&&Op(t)},Tp=(e,t=(()=>graph.links??[])())=>t[e],Np=e=>e.toLowerCase().replace(/_./g,(e=>e.replace("_","").toUpperCase())),Ip=e=>"easy getNode"===e.type,Pp=e=>"easy setNode"===e.type,Dp=e=>Ip(e)||Pp(e),jp=(e=(()=>graph._nodes??[])())=>e.filter((e=>Dp(e))),Mp=(e,t,n=0)=>{e.widgets_values||(e.widgets_values=[]),e.widgets_values[n]=t,e.widgets[n].value=t},Rp=e=>graph.add(e),$p=e=>graph.remove(e),Gp=(e,t=0)=>{var n,o;if("Reroute"!==e.type)return[e,t];const i=e,r=null==(o=null==(n=i.inputs)?void 0:n[0])?void 0:o.link;if(!r)return[i,t];const s=Tp(r);if(!s)return[i,t];const a=Cp(s.origin_id);return a?(setTimeout((()=>{$p(i)})),Gp(a,s.origin_slot)):[i,t]},Bp=e=>{var t,n,o;if("Reroute"!==e.type)return e;const i=e,r=null==(n=null==(t=i.outputs)?void 0:t[0])?void 0:n.links;if(!r)return i;const s=r[0];if(!s)return i;const a=Tp(s);if(!a)return i;const l=Cp(a.target_id);return l?(1===(null==(o=i.outputs[0].links)?void 0:o.length)&&setTimeout((()=>{$p(i)})),Bp(l)):i};const Fp=new class{constructor(){v(this,"element",_(`div.${L}toast`)),v(this,"children",HTMLElement),v(this,"container",document.body),this.container.appendChild(this.element)}async show(e){let t=_(`div.${L}toast-container`,[_("div",[_("span",[...e.icon?[_("i",{className:e.icon})]:[],_("span",e.content)])])]);t.setAttribute("toast-id",e.id),this.element.replaceChildren(t),this.container.appendChild(this.element),await W(64),t.style.marginTop=`-${t.offsetHeight}px`,await W(64),t.classList.add("show"),e.duration&&(await W(e.duration),this.hide(e.id))}async hide(e){const t=document.querySelector(`.${L}toast > [toast-id="${e}"]`);(null==t?void 0:t.classList.contains("show"))&&(t.classList.remove("show"),await W(750)),t&&t.remove()}async clearAllMessages(){let e=document.querySelector(`.${L}container`);e&&(e.innerHTML="")}async info(e,t=3e3,n=[]){this.show({id:"toast-info",icon:`mdi mdi-information ${L}theme`,content:e,duration:t})}async success(e,t=3e3){this.show({id:"toast-success",icon:`mdi mdi-check-circle ${L}success`,content:e,duration:t})}async error(e,t=3e3){this.show({id:"toast-error",icon:`mdi mdi-close-circle ${L}error`,content:e,duration:t})}async warn(e,t=3e3){this.show({id:"toast-warn",icon:`mdi mdi-alert-circle ${L}warning`,content:e,duration:t})}async showLoading(e,t=0){this.show({id:"toast-loading",icon:"mdi mdi-rotate-right loading",content:e,duration:t})}async hideLoading(){this.hide("toast-loading")}},Up=["rescale_after_model","rescale","lora_name","upscale_method","image_output","add_noise","info","sampler_name","ckpt_B_name","ckpt_C_name","save_model","refiner_ckpt_name","num_loras","num_controlnet","mode","toggle","resolution","ratio","target_parameter","input_count","replace_count","downscale_mode","range_mode","text_combine_mode","input_mode","lora_count","ckpt_count","conditioning_mode","preset","use_tiled","use_batch","num_embeds","easing_mode","guider","scheduler","inpaint_mode","t5_type","rem_mode"],zp=["LIGHT - SD1.5 only (low strength)","STANDARD (medium strength)","VIT-G (medium strength)","PLUS (high strength)","PLUS FACE (portraits)","FULL FACE - SD1.5 only (portraits stronger)"],Vp=["FACEID","FACEID PLUS - SD1.5 only","FACEID PLUS V2","FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"],Hp=["easy seed","easy latentNoisy","easy wildcards","easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingSdTurbo","easy preSamplingCascade","easy preSamplingDynamicCFG","easy preSamplingLayerDiffusion","easy fullkSampler","easy fullCascadeKSampler"],Wp=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy hyditLoader","easy pixArtLoader"],Yp=["easy imageSize","easy imageSizeBySide","easy imageSizeByLongerSide","easy imageSizeShow","easy imageRatio","easy imagePixelPerfect"];function Zp(e,t){const n=e.comfyClass,o=t.value;switch(t.name){case"range_mode":Sp(e,wp(e,"step"),"step"==o),Sp(e,wp(e,"num_steps"),"num_steps"==o),kp(e);break;case"text_combine_mode":Sp(e,wp(e,"replace_text"),"replace"==o);break;case"lora_name":["lora_model_strength","lora_clip_strength"].map((t=>Sp(e,wp(e,t),"None"!==o)));break;case"resolution":"自定义 x 自定义"===o&&(t.value="width x height (custom)"),["empty_latent_width","empty_latent_height"].map((t=>Sp(e,wp(e,t),"width x height (custom)"===o)));break;case"ratio":["empty_latent_width","empty_latent_height"].map((t=>Sp(e,wp(e,t),"custom"===o)));break;case"num_loras":var i=o+1,r=wp(e,"mode").value;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));for(let t=i;t<21;t++)["lora_"+t+"_name","lora_"+t+"_strength","lora_"+t+"_model_strength","lora_"+t+"_clip_strength"].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"num_controlnet":i=o+1,r=wp(e,"mode").value;for(let t=0;tSp(e,wp(e,t),!0))),["start_percent_"+t,"end_percent_"+t].map((t=>Sp(e,wp(e,t),"simple"!==r)));for(let t=i;t<21;t++)["controlnet_"+t,"controlnet_"+t+"_strength","scale_soft_weight_"+t,"start_percent_"+t,"end_percent_"+t].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"mode":switch(null==e?void 0:e.comfyClass){case"easy loraStack":i=wp(e,"num_loras").value+1,r=o;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));kp(e);break;case"easy controlnetStack":i=wp(e,"num_controlnet").value+1,r=o;for(let t=0;tSp(e,wp(e,t),"simple"!==r)));kp(e);break;case"easy icLightApply":r=o;["lighting","remove_bg"].map((t=>Sp(e,wp(e,t),"Foreground"===r))),Sp(e,wp(e,"source"),"Foreground"!==r),kp(e)}break;case"toggle":t.type="toggle",t.options={on:"Enabled",off:"Disabled"};break;case"t5_type":["clip_name","padding"].map((t=>Sp(e,wp(e,t),"sd3"==o))),["t5_name","device","dtype"].map((t=>Sp(e,wp(e,t),"t5v11"==o))),kp(e);break;case"preset":if(zp.includes(o)){let t=wp(e,"use_tiled");Sp(e,wp(e,"lora_strength")),Sp(e,wp(e,"provider")),Sp(e,wp(e,"weight_faceidv2")),Sp(e,wp(e,"weight_kolors")),Sp(e,wp(e,"use_tiled"),!0),Sp(e,wp(e,"sharpening"),t&&t.value)}else Vp.includes(o)&&(Sp(e,wp(e,"weight_faceidv2"),!!["FACEID PLUS V2","FACEID PLUS KOLORS"].includes(o)),Sp(e,wp(e,"weight_kolors"),!!["FACEID PLUS KOLORS"].includes(t.value)),["FACEID PLUS KOLORS","FACEID PORTRAIT (style transfer)","FACEID PORTRAIT UNNORM - SDXL only (strong)"].includes(o)?Sp(e,wp(e,"lora_strength"),!1):Sp(e,wp(e,"lora_strength"),!0),Sp(e,wp(e,"provider"),!0),Sp(e,wp(e,"use_tiled")),Sp(e,wp(e,"sharpening")));kp(e);break;case"use_tiled":Sp(e,wp(e,"sharpening"),!!o),kp(e);break;case"num_embeds":i=o+1;for(let t=0;tSp(e,wp(e,t),!1)));break;case"brushnet_random":case"brushnet_segmentation":["dtype","scale","start_at","end_at"].map((t=>Sp(e,wp(e,t),!0))),["fitting","function"].map((t=>Sp(e,wp(e,t),!1)));break;case"powerpaint":["dtype","fitting","function","scale","start_at","end_at"].map((t=>Sp(e,wp(e,t),!0)))}kp(e);break;case"image_output":Sp(e,wp(e,"link_id"),!!["Sender","Sender&Save"].includes(o)),Sp(e,wp(e,"decode_vae_name"),!!["Hide","Hide&Save"].includes(o)),["save_prefix","output_path","embed_workflow","number_padding","overwrite_existing"].map((t=>Sp(e,wp(e,t),!!["Save","Hide&Save","Sender&Save"].includes(o))));break;case"add_noise":var s=wp(e,"control_before_generate"),a=wp(e,"control_after_generate")||s;"disable"===o?(Sp(e,wp(e,"seed")),a&&(a.last_value=a.value,a.value="fixed",Sp(e,a))):(Sp(e,wp(e,"seed"),!0),a&&((null==a?void 0:a.last_value)&&(a.value=a.last_value),Sp(e,a,!0))),kp(e);break;case"guider":switch(o){case"Basic":["cfg","cfg_negative"].map((t=>Sp(e,wp(e,t))));break;case"CFG":Sp(e,wp(e,"cfg"),!0),Sp(e,wp(e,"cfg_negative"));break;case"IP2P+DualCFG":case"DualCFG":["cfg","cfg_negative"].map((t=>Sp(e,wp(e,t),!0)))}kp(e);break;case"scheduler":["karrasADV","exponentialADV","polyExponential"].includes(o)?(["sigma_max","sigma_min"].map((t=>Sp(e,wp(e,t),!0))),["denoise","beta_d","beta_min","eps_s","coeff"].map((t=>Sp(e,wp(e,t))),!1),Sp(e,wp(e,"rho"),"exponentialADV"!=o)):"vp"==o?(["sigma_max","sigma_min","denoise","rho","coeff"].map((t=>Sp(e,wp(e,t)))),["beta_d","beta_min","eps_s"].map((t=>Sp(e,wp(e,t),!0)))):(["sigma_max","sigma_min","beta_d","beta_min","eps_s","rho"].map((t=>Sp(e,wp(e,t)))),Sp(e,wp(e,"coeff"),"gits"==o),Sp(e,wp(e,"denoise"),!0)),kp(e);break;case"conditioning_mode":["replace","concat","combine"].includes(o)?["average_strength","old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t)))):"average"==o?(Sp(e,wp(e,"average_strength"),!0),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t),!1)))):"timestep"==o&&(["average_strength"].map((t=>Sp(e,wp(e,t),!1))),["old_cond_start","old_cond_end","new_cond_start","new_cond_end"].map((t=>Sp(e,wp(e,t)))));break;case"rescale":wp(e,"rescale_after_model").value,Sp(e,wp(e,"width"),"to Width/Height"===o),Sp(e,wp(e,"height"),"to Width/Height"===o),Sp(e,wp(e,"percent"),"by percentage"===o),Sp(e,wp(e,"longer_side"),"to longer side - maintain aspect"===o),kp(e);break;case"upscale_method":["factor","crop"].map((t=>Sp(e,wp(e,t),"None"!==o)));break;case"target_parameter":switch(n){case"easy XYInputs: Steps":["first_step","last_step"].map((t=>Sp(e,wp(e,t),"steps"==o))),["first_start_step","last_start_step"].map((t=>Sp(e,wp(e,t),"start_at_step"==o))),["first_end_step","last_end_step"].map((t=>Sp(e,wp(e,t),"end_at_step"==o)));break;case"easy XYInputs: Sampler/Scheduler":let t=wp(e,"input_count").value+1;for(let n=0;nSp(e,wp(e,t),"strength"==o))),["first_start_percent","last_start_percent"].map((t=>Sp(e,wp(e,t),"start_percent"==o))),["first_end_percent","last_end_percent"].map((t=>Sp(e,wp(e,t),"end_percent"==o))),["strength","start_percent","end_percent"].map((t=>Sp(e,wp(e,t),o!=t))),kp(e)}case"replace_count":i=o+1;for(let t=0;tSp(e,wp(e,t),!l)));for(let t=i;t<11;t++)["lora_name_"+t,"model_str_"+t,"clip_str_"+t].map((t=>Sp(e,wp(e,t),!1)));kp(e);break;case"ckpt_count":i=o+1;var c=-1!=wp(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=wp(e,"input_mode").value.indexOf("VAE");for(let t=0;tSp(e,wp(e,t),!1)));kp(e);break;case"input_count":i=o+1;var d=wp(e,"target_parameter").value;for(let t=0;tSp(e,wp(e,n),!t)));["model_strength","clip_strength"].map((n=>Sp(e,wp(e,n),!t)));break;case"easy XYInputs: Checkpoint":i=wp(e,"ckpt_count").value+1,c=-1!=wp(e,"input_mode").value.indexOf("ClipSkip"),u=-1!=wp(e,"input_mode").value.indexOf("VAE");for(let n=0;ne.name===t));if(-1!==e){for(let t=e;t{var e;const t=this.computeSize();t[0]"info"===e.name));if(-1!==e&&this.widgets[e]){this.widgets[e].value=t}}requestAnimationFrame((()=>{var e;const t=this.computeSize();t[0]"prompt"==e.name));this.addWidget("button","get values from COMBO link","",(()=>{var t,o;const i=(null==(o=null==(t=this.outputs[1])?void 0:t.links)?void 0:o.length)>0?this.outputs[1].links[0]:null,r=n.graph._nodes.find((e=>{var t;return null==(t=e.inputs)?void 0:t.find((e=>e.link==i))}));if(i&&r){const t=r.inputs.find((e=>e.link==i)).widget.name,n=r.widgets.find((e=>e.name==t));let o=(null==n?void 0:n.options.values)||null;o&&(o=o.join("\n"),e.value=o)}else Fp.error(V("No COMBO link"),3e3)}),{serialize:!1})}),Wp.includes(t.name)){let t=function(e){var t="";for(let n=0;ne.name===t+"_prompt")),o="comfy-multiline-input wildcard_"+t+"_"+this.id.toString();if(-1==n&&e){const n=document.createElement("textarea");n.className=o,n.placeholder="Wildcard Prompt ("+t+")";const i=this.addDOMWidget(t+"_prompt","customtext",n,{getValue:e=>n.value,setValue(e){n.value=e},serialize:!1});i.inputEl=n,i.inputEl.readOnly=!0,n.addEventListener("input",(()=>{var e;null==(e=i.callback)||e.call(i,i.value)})),i.value=e}else if(this.widgets[n])if(e){this.widgets[n].value=e}else{this.widgets.splice(n,1);const e=document.getElementsByClassName(o);e&&e[0]&&e[0].remove()}}};e.prototype.onExecuted=function(e){null==a||a.apply(this,arguments);const o=t(e.positive),i=t(e.negative);n.call(this,o,"positive"),n.call(this,i,"negative")}}if(["easy sv3dLoader"].includes(t.name)){let t=function(e,t,n){switch(e){case"azimuth":return n.readOnly=!0,n.style.opacity=.6,"0:(0.0,0.0)"+(t>1?`\n${t-1}:(360.0,0.0)`:"");case"elevation":return n.readOnly=!0,n.style.opacity=.6,"0:(-90.0,0.0)"+(t>1?`\n${t-1}:(90.0,0.0)`:"");case"custom":return n.readOnly=!1,n.style.opacity=1,"0:(0.0,0.0)\n9:(180.0,0.0)\n20:(360.0,0.0)"}};e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>"easing_mode"==e.name)),n=this.widgets.find((e=>"batch_size"==e.name)),o=this.widgets.find((e=>"scheduler"==e.name));setTimeout((i=>{o.value||(o.value=t(e.value,n.value,o.inputEl))}),1),e.callback=e=>{o.value=t(e,n.value,o.inputEl)},n.callback=n=>{o.value=t(e.value,n,o.inputEl)}}}if(Hp.includes(o)&&(e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),o=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));if("easy seed"==t.name){const t=this.addWidget("button","🎲 Manual Random Seed",null,(t=>{"fixed"!=o.value&&(o.value="fixed"),e.value=Math.floor(Math.random()*P),n.queuePrompt(0,1)}),{serialize:!1});e.linkedWidgets=[t,o]}},e.prototype.onAdded=async function(){i&&i.apply(this,[]);const e=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),t=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));setTimeout((n=>{"control_before_generate"==t.name&&0===e.value&&(e.value=Math.floor(Math.random()*P))}),1)}),"easy convertAnything"==o&&(e.prototype.onNodeCreated=async function(){r&&r.apply(this,[]);const e=this.widgets.find((e=>"output_type"==e.name)),t=t=>{this.outputs[0].type=e.value.toUpperCase(),this.outputs[0].name=e.value,this.outputs[0].label=e.value};setTimeout((e=>t()),10),e.callback=e=>t()}),"easy imageInsetCrop"==o){let t=function(e){const t=e.widgets[0];for(let n=1;n<=4;n++)"Pixels"===t.value?(e.widgets[n].options.step=80,e.widgets[n].options.max=8192):(e.widgets[n].options.step=10,e.widgets[n].options.max=99)};e.prototype.onAdded=async function(e){const n=this.widgets[0];let o=n.callback;n.callback=(...e)=>{t(this),o&&o.apply(n,[...e])},setTimeout((e=>{t(this)}),1)}}},nodeCreated(e){if(e.comfyClass.startsWith("easy ")){if(e.widgets)for(const n of e.widgets){if(!Up.includes(n.name))continue;let t=n.value;Zp(e,n),Object.defineProperty(n,"value",{get:e=>t,set(o){o!==t&&(t=o,Zp(e,n))}})}const t=e.comfyClass;if("easy preDetailerFix"==t){const t=e.widgets.find((e=>"customtext"===e.type));if(!t)return;t.dynamicPrompts=!1,t.inputEl.placeholder="wildcard spec: if kept empty, this option will be ignored",t.serializeValue=()=>t.value}if("easy wildcards"==t){const t=e.widgets.find((e=>"text"==e.name));let n=1;Object.defineProperty(e.widgets[n],"value",{set:e=>{if((new Error).stack.includes("inner_value_change")&&"Select the LoRA to add to the text"!=e){let n=e;n.endsWith(".safetensors")&&(n=n.slice(0,-12)),t.value+=``}},get:e=>"Select the LoRA to add to the text"}),Object.defineProperty(e.widgets[n+1],"value",{set:e=>{(new Error).stack.includes("inner_value_change")&&"Select the Wildcard to add to the text"!=e&&(""!=t.value&&(t.value+=", "),t.value+=e)},get:e=>"Select the Wildcard to add to the text"}),e.widgets[n].serializeValue=e=>"Select the LoRA to add to the text",e.widgets[n+1].serializeValue=e=>"Select the Wildcard to add to the text"}if(Yp.includes(t)){const t=document.createElement("textarea");t.className="comfy-multiline-input",t.readOnly=!0;const n=e.addDOMWidget("info","customtext",t,{getValue:e=>t.value,setValue:e=>t.value=e,serialize:!1});n.inputEl=t,t.addEventListener("input",(()=>{var e;null==(e=n.callback)||e.call(n,n.value)}))}}}}),y.registerExtension({name:"easy bookmark",registerCustomNodes(){class e{constructor(){v(this,"type","easy bookmark"),v(this,"title","🔖"),v(this,"slot_start_y",-20),v(this,"___collapsed_width",0),v(this,"isVirtualNode",!0),v(this,"serialize_widgets",!0),v(this,"keypressBound",null),this.addWidget("text","shortcut_key","1",(e=>{""!==(e=e.trim()[0]||"1")&&(this.title="🔖 "+e)}),{y:8}),this.addWidget("number","zoom",1,(e=>{}),{y:8+LiteGraph.NODE_WIDGET_HEIGHT+4,max:2,min:.5,precision:2}),this.keypressBound=this.onKeypress.bind(this)}get _collapsed_width(){return this.___collapsed_width}set _collapsed_width(e){const t=y.canvas,n=t.canvas.getContext("2d");if(n){const e=n.font;n.font=t.title_text_font,this.___collapsed_width=40+n.measureText(this.title).width,n.font=e}}onAdded(){setTimeout((e=>{const t=this.widgets[0].value;t&&(this.title="🔖 "+t)}),1),window.addEventListener("keydown",this.keypressBound)}onRemoved(){window.removeEventListener("keydown",this.keypressBound)}onKeypress(e){const t=e.target;["input","textarea"].includes(t.localName)||this.widgets[0]&&e.key.toLocaleLowerCase()===this.widgets[0].value.toLocaleLowerCase()&&this.canvasToBookmark()}canvasToBookmark(){var e,t;const n=y.canvas;(null==(e=null==n?void 0:n.ds)?void 0:e.offset)&&(n.ds.offset[0]=16-this.pos[0],n.ds.offset[1]=40-this.pos[1]),null!=(null==(t=null==n?void 0:n.ds)?void 0:t.scale)&&(n.ds.scale=Number(this.widgets[1].value||1)),n.setDirty(!0,!0)}}LiteGraph.registerNodeType("easy bookmark",Object.assign(e,{title:"Bookmark 🔖"})),e.category="EasyUse/Util"}}),y.registerExtension({name:"Comfy.EasyUse.ChainNode",init(){y.canvas._mousemove_callback=e=>{if(!A("EasyUse.Nodes.ChainGetSet",null,!0))return;((e,t=!1,n={})=>{var o,i,r,s,a;if(0===e.length)return;const l=n.inputX||160,c=n.ouputX||60;if(e.filter((e=>Dp(e))).length>1)return;for(const d of e){let s=0,a=0;const u=n.inputY||10,p=n.outputY||30,f=[];if(d.graph){for(const e of d.inputs??[]){const t=e.link;if(!t)continue;const{origin_id:n,target_slot:o}=Tp(t),i=Cp(n);if(!i)continue;if(!Dp(i))continue;const r=d.getConnectionPos(!0,o);i.pos=[r[0]-l,r[1]+15+s*u],s+=1,f.push(i),i.flags.collapsed=!0}for(const e of d.outputs??[])if(e.links&&d.graph)for(const t of e.links){const{target_id:e}=Tp(t),n=Cp(e);if(!n)continue;if(!Dp(n))continue;const i=null==(o=n.outputs)?void 0:o.links;if((null==i?void 0:i.length)>1)return;const r=d.getConnectionPos(!1,0);n.pos=[r[0]+c,r[1]+15+a*p],a+=1,f.push(n),n.flags.collapsed=!0}if(t&&1===e.length){const e=[d,...f];(null==(r=null==(i=d.graph)?void 0:i.list_of_graphcanvas)?void 0:r[0]).selectNodes(e)}}}const u=e[0];if(!u)return;(null==(a=null==(s=u.graph)?void 0:s.list_of_graphcanvas)?void 0:a[0]).setDirty(!0,!0)})(Ap())};const e=LGraphCanvas.prototype.showLinkMenu;LGraphCanvas.prototype.showLinkMenu=function(t,n){return n.shiftKey?(((e,t=!1)=>{var n,o,i,r,s,a,l,c,u,d;const{type:p}=e;if("*"===p)return;let{origin_id:f,target_id:h,origin_slot:m,target_slot:g}=e,v=Cp(f),y=Cp(h);if(!v||!y)return!1;if("Reroute"===v.type){let e=0;[v,e]=Gp(v),f=null==v?void 0:v.id,m=e,void 0!==m&&-1!==m||(m=0)}if("Reroute"===y.type&&(y=Bp(y),h=null==y?void 0:y.id,g=null==y?void 0:y.inputs.findIndex((e=>e.type===p)),void 0!==g&&-1!==g||(g=0)),void 0===f||void 0===h||!v||!y)return!1;if(t&&(Dp(v)||Dp(y)))return!1;let b=Np((null==(n=y.getInputInfo(g))?void 0:n.name)??p.toLowerCase());b||(b=Np((null==(i=null==(o=null==v?void 0:v.outputs)?void 0:o[m])?void 0:i.name)??(null==(s=null==(r=null==v?void 0:v.outputs)?void 0:r[m])?void 0:s.type.toString())??b+`_from_${f}_to_${h}`));let _,w=!1,S=!1;if(Dp(v))b=xp(v),S=!0;else{const e=null==(l=null==(a=v.outputs)?void 0:a[m])?void 0:l.links;if(e)for(const t of e){const e=Cp((null==(c=Tp(t))?void 0:c.target_id)??-1);e&&Dp(e)&&Pp(e)&&(b=xp(e),S=!0)}if(!S){for(const e of jp()){if(b!==xp(e)||!Pp(e))continue;const t=null==(u=e.inputs[0])?void 0:u.link;(null==(d=Tp(t))?void 0:d.origin_id)===v.id?S=!0:w=!0}w&&(b+=`_from_${f}_to_${h}`)}}if(!S){_=LiteGraph.createNode("easy setNode"),_.is_auto_link=!0;const e=v.getConnectionPos(!1,m);_.pos=[e[0]+20,e[1]],_.inputs[0].name=b,_.inputs[0].type=p,_.inputs[0].widget=y.inputs[g].widget,Mp(_,b),Rp(_),_.flags.collapsed=!0;let t=[];v.widgets?t=Object.values(v.widgets).map((e=>e.value)):v.widgets_values&&(t=JSON.parse(JSON.stringify(v.widgets_values))),v.connect(m,_,0),v.widgets_values=t,"PrimitiveNode"===v.type&&setTimeout((()=>{if(v){v.connect(m,_,0);for(const[e,n]of t.entries())Mp(v,n,e);null!==_&&_.setSize(_.computeSize())}}))}const x=LiteGraph.createNode("easy getNode"),k=y.getConnectionPos(!0,g);x.pos=[k[0]-150,k[1]],x.outputs[0].name=b,x.outputs[0].type=p,x.outputs[0].widget=y.inputs[g].widget,Rp(x),Mp(x,b),null===x||(x.flags.collapsed=!0,x.setSize(x.computeSize()),x.connect(0,y,g))})(t),!1):(e.apply(this,[t,n]),!1)}}});let Kp=[];function Xp(e,t,n,o,i){var r=LGraphCanvas.active_canvas,s=r.getCanvasWindow(),a=r.graph;if(a)return function e(t,o){var l=LiteGraph.getNodeTypesCategories(r.filter||a.filter).filter((function(e){return e.startsWith(t)})),c=[];l.map((function(n){if(n){var o=new RegExp("^("+t+")"),i=n.replace(o,"").split("/")[0],r=""===t?i+"/":t+i+"/",s=i;-1!=s.indexOf("::")&&(s=s.split("::")[1]),-1===c.findIndex((function(e){return e.value===r}))&&c.push({value:r,content:s,has_submenu:!0,callback:function(t,n,o,i){e(t.value,i)}})}})),LiteGraph.getNodeTypesInCategory(t.slice(0,-1),r.filter||a.filter).map((function(e){if(!e.skip_list){var t={value:e.type,content:e.title,has_submenu:!1,callback:function(e,t,n,o){var s=o.getFirstEvent();r.graph.beforeChange();var a=LiteGraph.createNode(e.value);a&&(a.pos=r.convertEventToCanvasOffset(s),r.graph.add(a)),i&&i(a),r.graph.afterChange()}};c.push(t)}}));const u=A("EasyUse.ContextMenu.NodesSort",null,!0);""===t&&u&&(c=function(e){let t=[],n=[];return e.forEach((e=>{(null==e?void 0:e.value)&&D.includes(e.value.split("/")[0])?t.push(e):n.push(e)})),[{title:V("ComfyUI Basic"),is_category_title:!0},...t,{title:V("Others A~Z"),is_category_title:!0},...n.sort(((e,t)=>e.content.localeCompare(t.content)))]}(c)),new LiteGraph.ContextMenu(c,{event:n,parentMenu:o},s)}("",o),!1}function Qp(e,t,n){var o=this;n=n||{};var i=document.createElement("div");i.className="litemenu-entry submenu";var r=!1;function s(e){var t=this.value,i=!0;(o.current_submenu&&o.current_submenu.close(e),n.callback)&&(!0===n.callback.call(this,t,n,e,o,n.node)&&(i=!1));if(t){if(t.callback&&!n.ignore_item_callbacks&&!0!==t.disabled)!0===t.callback.call(this,t,n,e,o,n.extra)&&(i=!1);if(t.submenu){if(!t.submenu.options)throw"ContextMenu submenu needs options";new o.constructor(t.submenu.options,{callback:t.submenu.callback,event:e,parentMenu:o,ignore_item_callbacks:t.submenu.ignore_item_callbacks,title:t.submenu.title,extra:t.submenu.extra,autoopen:n.autoopen}),i=!1}}i&&!o.lock&&o.close()}return null===t?i.classList.add("separator"):t.is_category_title?(i.classList.remove("litemenu-entry"),i.classList.remove("submenu"),i.classList.add("litemenu-title"),i.innerHTML=t.title):(i.innerHTML=t&&t.title?t.title:e,i.value=t,t&&(t.disabled&&(r=!0,i.classList.add("disabled")),(t.submenu||t.has_submenu)&&i.classList.add("has_submenu")),"function"==typeof t?(i.dataset.value=e,i.onclick_callback=t):i.dataset.value=t,t.className&&(i.className+=" "+t.className)),this.root.appendChild(i),r||i.addEventListener("click",s),!r&&n.autoopen&&LiteGraph.pointerListenerAdd(i,"enter",(function(e){var t=this.value;if(!t||!t.has_submenu)return;s.call(this,e)})),i}function Jp(e){return e.substring(0,e.lastIndexOf("."))}function qp(e){return e.substring(e.lastIndexOf(".")+1)}y.registerExtension({name:"Comfy.EasyUse.ContextMenu",async setup(){LGraphCanvas.onMenuAdd=Xp;const e=await b.fetchApi("/easyuse/models/thumbnail");if(200===e.status){let t=await e.json();Kp=t}else Fp.error(V("Too many thumbnails, have closed the display"));const t=LiteGraph.ContextMenu;LiteGraph.ContextMenu=function(e,n){var o,i;if(n.parentMenu);else if(n.extra)null==(o=n.extra.constructor)||o.name;else if(n.scale){if(A("EasyUse.ContextMenu.SubDirectories",null,!0)){const o=function(e,t){const n=e,o=[...n],i={},r=[],s=[],a=["ckpt","pt","bin","pth","safetensors"];if((null==e?void 0:e.length)>0){const t=qp(e[e.length-1]);if(!a.includes(t))return null}for(const l of n){const e=l.indexOf("/")>-1?"/":"\\",t=l.split(e);if(t.length>1){const n=t.shift();i[n]=i[n]||[],i[n].push(t.join(e))}else"CHOOSE"===l||l.startsWith("DISABLE ")?r.push(l):s.push(l)}if(Object.values(i).length>0){const e=t.callback;t.callback=null;const n=(t,n)=>{["None","无","無","なし"].includes(t.content)?e("None",n):e(o.find((e=>e.endsWith(t.content)),n))},l=(e,t="")=>{const o=t?t+"\\"+Jp(e):Jp(e),i=qp(e),r=(new Date).getTime();let s,l="";if(a.includes(i))for(let n=0;n{let n=[],o=[];const r=e.map((e=>{const r={},s=e.indexOf("/")>-1?"/":"\\",a=e.split(s);if(a.length>1){const e=a.shift();r[e]=r[e]||[],r[e].push(a.join(s))}if(Object.values(i).length>0){let t=Object.keys(r)[0];t&&r[t]?n.push({key:t,value:r[t][0]}):o.push(l(e,t))}return l(e,t)}));if(n.length>0){let e={};return n.forEach((t=>{e[t.key]=e[t.key]||[],e[t.key].push(t.value)})),[...Object.entries(e).map((e=>({content:e[0],has_submenu:!0,callback:()=>{},submenu:{options:u(e[1],e[0])}}))),...o]}return r};for(const[t,o]of Object.entries(i))c.push({content:t,has_submenu:!0,callback:()=>{},submenu:{options:u(o,t)}});return c.push(...s.map((e=>l(e,"")))),r.length>0&&c.push(...r.map((e=>l(e,"")))),c}return null}(e,n);if(o)return t.call(this,o,n)}}else n.hasOwnProperty("extra")&&(e.unshift(null),i=window.location.host,["192.168.","10.","127.",/^172\.((1[6-9]|2[0-9]|3[0-1])\.)/].some((e=>"string"==typeof e?i.startsWith(e):e.test(i)))&&e.unshift({content:`${V("Reboot ComfyUI")}`,callback:e=>async function(){if(confirm(V("Are you sure you'd like to reboot the server?")))try{b.fetchApi("/easyuse/reboot")}catch(e){}}()}),e.unshift({content:`${V("Cleanup Of GPU Usage")}`,callback:e=>async function(){try{const{Running:e,Pending:t}=await b.getQueue();if(e.length>0||t.length>0)return void Fp.error(V("Clean Failed")+":"+V("Please stop all running tasks before cleaning GPU"));200==(await b.fetchApi("/easyuse/cleangpu",{method:"POST"})).status?Fp.success(V("Clean SuccessFully")):Fp.error(V("Clean Failed"))}catch(e){}}()}));return t.apply(this,[...arguments])},LiteGraph.ContextMenu.prototype=t.prototype,LiteGraph.ContextMenu.prototype.addItem=Qp}});class ef extends w{constructor(){super(),this.element.classList.add("easyuse-model-metadata")}show(e){super.show(_("div",Object.keys(e).map((t=>_("div",[_("label",{textContent:t}),_("span",{textContent:e[t]})])))))}}class tf extends w{constructor(e){super(),this.name=e,this.element.classList.add("easyuse-model-info")}get customNotes(){return this.metadata["easyuse.notes"]}set customNotes(e){this.metadata["easyuse.notes"]=e}get hash(){return this.metadata["easyuse.sha256"]}async show(e,t){this.type=e;const n=b.fetchApi("/easyuse/metadata/"+encodeURIComponent(`${e}/${t}`));this.info=_("div",{style:{flex:"auto"}}),this.imgCurrent=0,this.imgList=_("div.easyuse-preview-list",{style:{display:"none"}}),this.imgWrapper=_("div.easyuse-preview",[_("div.easyuse-preview-group",[this.imgList])]),this.main=_("main",{style:{display:"flex"}},[this.imgWrapper,this.info]),this.content=_("div.easyuse-model-content",[_("div.easyuse-model-header",[_("h2",{textContent:this.name})]),this.main]);const o=_("div",{textContent:"ℹ️ Loading...",parent:this.content});super.show(this.content),this.metadata=await(await n).json(),this.viewMetadata.style.cursor=this.viewMetadata.style.opacity="",this.viewMetadata.removeAttribute("disabled"),o.remove(),this.addInfo()}createButtons(){const e=super.createButtons();return this.viewMetadata=_("button",{type:"button",textContent:"View raw metadata",disabled:"disabled",style:{opacity:.5,cursor:"not-allowed"},onclick:e=>{this.metadata&&(new ef).show(this.metadata)}}),e.unshift(this.viewMetadata),e}parseNote(){if(!this.customNotes)return[];let e=[];const t=new RegExp("(\\bhttps?:\\/\\/[^\\s]+)","g");let n,o=0;do{let i;n=t.exec(this.customNotes);let r=0;n?(i=n.index,r=n.index+n[0].length):i=this.customNotes.length;let s=this.customNotes.substring(o,i);s&&(s=s.replaceAll("\n","
"),e.push(_("span",{innerHTML:s}))),n&&e.push(_("a",{href:n[0],textContent:n[0],target:"_blank"})),o=r}while(n);return e}addInfoEntry(e,t){return _("p",{parent:this.info},["string"==typeof e?_("label",{textContent:e+": "}):e,"string"==typeof t?_("span",{textContent:t}):t])}async getCivitaiDetails(){const e=await fetch("https://civitai.com/api/v1/model-versions/by-hash/"+this.hash);if(200===e.status)return await e.json();throw 404===e.status?new Error("Model not found"):new Error(`Error loading info (${e.status}) ${e.statusText}`)}addCivitaiInfo(){const e=this.getCivitaiDetails(),t=_("span",{textContent:"ℹ️ Loading..."});return this.addInfoEntry(_("label",[_("img",{style:{width:"18px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),_("span",{textContent:"Civitai: "})]),t),e.then((e=>{var t,n;this.imgWrapper.style.display="block";let o=this.element.querySelector(".easyuse-model-header");o&&o.replaceChildren(_("h2",{textContent:this.name}),_("div.easyuse-model-header-remark",[_("h5",{textContent:V("Updated At:")+O(new Date(e.updatedAt),"yyyy/MM/dd")}),_("h5",{textContent:V("Created At:")+O(new Date(e.updatedAt),"yyyy/MM/dd")})]));let i=null,r=this.parseNote.call(this),s=V("✏️ Edit"),a=_("div.easyuse-model-detail-textarea",[_("p",(null==r?void 0:r.length)>0?r:{textContent:V("No notes")})]);if(r&&0!=r.length?a.classList.remove("empty"):a.classList.add("empty"),this.info.replaceChildren(_("div.easyuse-model-detail",[_("div.easyuse-model-detail-head.flex-b",[_("span",V("Notes")),_("a",{textContent:s,href:"#",style:{fontSize:"12px",float:"right",color:"var(--warning-color)",textDecoration:"none"},onclick:async e=>{if(e.preventDefault(),i){if(i.value!=this.customNotes){toast.showLoading(V("Saving Notes...")),this.customNotes=i.value;const e=await b.fetchApi("/easyuse/metadata/notes/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:this.customNotes});if(toast.hideLoading(),200!==e.status)return toast.error(V("Saving Failed")),void alert(`Error saving notes (${e.status}) ${e.statusText}`);toast.success(V("Saving Succeed")),r=this.parseNote.call(this),a.replaceChildren(_("p",(null==r?void 0:r.length)>0?r:{textContent:V("No notes")})),i.value?a.classList.remove("empty"):a.classList.add("empty")}else a.replaceChildren(_("p",{textContent:V("No notes")})),a.classList.add("empty");e.target.textContent=s,i.remove(),i=null}else e.target.textContent="💾 Save",i=_("textarea",{placeholder:V("Type your notes here"),style:{width:"100%",minWidth:"200px",minHeight:"50px",height:"100px"},textContent:this.customNotes}),a.replaceChildren(i),i.focus()}})]),a]),_("div.easyuse-model-detail",[_("div.easyuse-model-detail-head",{textContent:V("Details")}),_("div.easyuse-model-detail-body",[_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Type")}),_("div.easyuse-model-detail-item-value",{textContent:e.model.type})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("BaseModel")}),_("div.easyuse-model-detail-item-value",{textContent:e.baseModel})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Download")}),_("div.easyuse-model-detail-item-value",{textContent:(null==(t=e.stats)?void 0:t.downloadCount)||0})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Trained Words")}),_("div.easyuse-model-detail-item-value",{textContent:(null==e?void 0:e.trainedWords.join(","))||"-"})]),_("div.easyuse-model-detail-item",[_("div.easyuse-model-detail-item-label",{textContent:V("Source")}),_("div.easyuse-model-detail-item-value",[_("label",[_("img",{style:{width:"14px",position:"relative",top:"3px",margin:"0 5px 0 0"},src:"https://civitai.com/favicon.ico"}),_("a",{href:"https://civitai.com/models/"+e.modelId,textContent:"View "+e.model.name,target:"_blank"})])])])])])),null==(n=e.images)?void 0:n.length){this.imgCurrent=0,this.isSaving=!1,e.images.map((e=>e.url&&this.imgList.appendChild(_("div.easyuse-preview-slide",[_("div.easyuse-preview-slide-content",[_("img",{src:e.url}),_("div.save",{textContent:"Save as preview",onclick:async()=>{if(this.isSaving)return;this.isSaving=!0,toast.showLoading(V("Saving Preview..."));const t=await(await fetch(e.url)).blob(),n="temp_preview."+new URL(e.url).pathname.split(".")[1],o=new FormData;o.append("image",new File([t],n)),o.append("overwrite","true"),o.append("type","temp");if(200!==(await b.fetchApi("/upload/image",{method:"POST",body:o})).status)return this.isSaving=!1,toast.error(V("Saving Failed")),toast.hideLoading(),void alert(`Error saving preview (${req.status}) ${req.statusText}`);await b.fetchApi("/easyuse/save/"+encodeURIComponent(`${this.type}/${this.name}`),{method:"POST",body:JSON.stringify({filename:n,type:"temp"}),headers:{"content-type":"application/json"}}).then((e=>{toast.success(V("Saving Succeed")),toast.hideLoading()})),this.isSaving=!1,app.refreshComboInNodes()}})])]))));let t=this;this.imgDistance=(-660*this.imgCurrent).toString(),this.imgList.style.display="",this.imgList.style.transform="translate3d("+this.imgDistance+"px, 0px, 0px)",this.slides=this.imgList.querySelectorAll(".easyuse-preview-slide"),this.slideLeftButton=_("button.left",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{e.images.length<=2||(t.imgList.classList.remove("no-transition"),0==t.imgCurrent?(t.imgCurrent=e.images.length/2-1,this.slides[this.slides.length-1].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d("+(-660*(this.imgCurrent+1)).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d(660px, 0px, 0px)",setTimeout((e=>{this.slides[this.slides.length-1].style.transform="translate3d(0px, 0px, 0px)",this.slides[this.slides.length-2].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)):(t.imgCurrent=t.imgCurrent-1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"))}}),this.slideRightButton=_("button.right",{parent:this.imgWrapper,style:{display:e.images.length<=2?"none":"block"},innerHTML:'',onclick:()=>{if(!(e.images.length<=2))if(t.imgList.classList.remove("no-transition"),t.imgCurrent>=e.images.length/2-1){t.imgCurrent=0;const n=e.images.length/2;this.slides[0].style.transform="translate3d("+(660*n).toString()+"px, 0px, 0px)",this.slides[1].style.transform="translate3d("+(660*n).toString()+"px, 0px, 0px)",t.imgList.style.transform="translate3d("+(-660*n).toString()+"px, 0px, 0px)",setTimeout((e=>{this.slides[0].style.transform="translate3d(0px, 0px, 0px)",this.slides[1].style.transform="translate3d(0px, 0px, 0px)",t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)",t.imgList.classList.add("no-transition")}),500)}else t.imgCurrent=t.imgCurrent+1,t.imgDistance=(-660*this.imgCurrent).toString(),t.imgList.style.transform="translate3d("+t.imgDistance+"px, 0px, 0px)"}})}return e.description&&_("div",{parent:this.content,innerHTML:e.description,style:{marginTop:"10px"}}),e})).catch((e=>{this.imgWrapper.style.display="none",t.textContent="⚠️ "+e.message})).finally((e=>{}))}}class nf extends tf{async addInfo(){await this.addCivitaiInfo()}}class of extends tf{getTagFrequency(){if(!this.metadata.ss_tag_frequency)return[];const e=JSON.parse(this.metadata.ss_tag_frequency),t={};for(const n in e){const o=e[n];for(const e in o)e in t?t[e]+=o[e]:t[e]=o[e]}return Object.entries(t).sort(((e,t)=>t[1]-e[1]))}getResolutions(){let e=[];if(this.metadata.ss_bucket_info){const t=JSON.parse(this.metadata.ss_bucket_info);if(null==t?void 0:t.buckets)for(const{resolution:n,count:o}of Object.values(t.buckets))e.push([o,`${n.join("x")} * ${o}`])}e=e.sort(((e,t)=>t[0]-e[0])).map((e=>e[1]));let t=this.metadata.ss_resolution;if(t){const n=t.split(","),o=n[0].replace("(",""),i=n[1].replace(")","");e.push(`${o.trim()}x${i.trim()} (Base res)`)}else(t=this.metadata["modelspec.resolution"])&&e.push(t+" (Base res");return e.length||e.push("⚠️ Unknown"),e}getTagList(e){return e.map((e=>_("li.easyuse-model-tag",{dataset:{tag:e[0]},$:e=>{e.onclick=()=>{e.classList.toggle("easyuse-model-tag--selected")}}},[_("p",{textContent:e[0]}),_("span",{textContent:e[1]})])))}addTags(){let e,t=this.getTagFrequency();if(null==t?void 0:t.length){const n=t.length;let o;n>500&&(t=t.slice(0,500),e=_("p",[_("span",{textContent:"⚠️ Only showing first 500 tags "}),_("a",{href:"#",textContent:`Show all ${n}`,onclick:()=>{o.replaceChildren(...this.getTagList(this.getTagFrequency())),e.remove()}})])),o=_("ol.easyuse-model-tags-list",this.getTagList(t)),this.tags=_("div",[o])}else this.tags=_("p",{textContent:"⚠️ No tag frequency metadata found"});this.content.append(this.tags),e&&this.content.append(e)}async addInfo(){const e=this.addCivitaiInfo();this.addTags();const t=await e;t&&_("div",{parent:this.content,innerHTML:t.description,style:{maxHeight:"250px",overflow:"auto"}})}createButtons(){const e=super.createButtons();function t(e,t){const n=_("textarea",{parent:document.body,style:{position:"fixed"},textContent:t.map((e=>e.dataset.tag)).join(", ")});n.select();try{document.execCommand("copy"),e.target.dataset.text||(e.target.dataset.text=e.target.textContent),e.target.textContent="Copied "+t.length+" tags",setTimeout((()=>{e.target.textContent=e.target.dataset.text}),1e3)}catch(o){prompt("Copy to clipboard: Ctrl+C, Enter",text)}finally{document.body.removeChild(n)}}return e.unshift(_("button",{type:"button",textContent:"Copy Selected",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag--selected")])}}),_("button",{type:"button",textContent:"Copy All",onclick:e=>{t(e,[...this.tags.querySelectorAll(".easyuse-model-tag")])}})),e}}const rf=["easy fullLoader","easy a1111Loader","easy comfyLoader","easy kolorsLoader","easy hunyuanDiTLoader","easy pixArtLoader"],sf=["easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingLayerDiffusion","easy fullkSampler"],af=["KSamplerSelect","SamplerEulerAncestral","SamplerEulerAncestralCFG++","SamplerLMS","SamplerDPMPP_3M_SDE","SamplerDPMPP_2M_SDE","SamplerDPMPP_SDE","SamplerDPMAdaptative","SamplerLCMUpscale","SamplerTCD","SamplerTCD EulerA"],lf=["BasicScheduler","KarrasScheduler","ExponentialScheduler","PolyexponentialScheduler","VPScheduler","BetaSamplingScheduler","SDTurboScheduler","SplitSigmas","SplitSigmasDenoise","FlipSigmas","AlignYourStepsScheduler","GITSScheduler"],cf=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerLayerDiffusion"],uf=["easy controlnetLoader","easy controlnetLoaderADV","easy controlnetLoader++","easy instantIDApply","easy instantIDApplyADV"],df=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition","easy ipadapterApplyFromParams","easy pulIDApply","easy pulIDApplyADV"],pf=["easy positive","easy wildcards"],ff=["easy loadImageBase64","LoadImage","LoadImageMask"],hf=["easy applyBrushNet","easy applyPowerPaint","easy applyInpaint"],mf={positive_prompt:{text:"positive",positive:"text"},loaders:{ckpt_name:"ckpt_name",vae_name:"vae_name",clip_skip:"clip_skip",lora_name:"lora_name",resolution:"resolution",empty_latent_width:"empty_latent_width",empty_latent_height:"empty_latent_height",positive:"positive",negative:"negative",batch_size:"batch_size",a1111_prompt_style:"a1111_prompt_style"},preSampling:{steps:"steps",cfg:"cfg",cfg_scale_min:"cfg",sampler_name:"sampler_name",scheduler:"scheduler",denoise:"denoise",seed_num:"seed_num",seed:"seed"},kSampler:{image_output:"image_output",save_prefix:"save_prefix",link_id:"link_id"},controlnet:{control_net_name:"control_net_name",strength:["strength","cn_strength"],scale_soft_weights:["scale_soft_weights","cn_soft_weights"],cn_strength:["strength","cn_strength"],cn_soft_weights:["scale_soft_weights","cn_soft_weights"]},ipadapter:{preset:"preset",lora_strength:"lora_strength",provider:"provider",weight:"weight",weight_faceidv2:"weight_faceidv2",start_at:"start_at",end_at:"end_at",cache_mode:"cache_mode",use_tiled:"use_tiled",insightface:"insightface",pulid_file:"pulid_file"},load_image:{image:"image",base64_data:"base64_data",channel:"channel"},inpaint:{dtype:"dtype",fitting:"fitting",function:"function",scale:"scale",start_at:"start_at",end_at:"end_at"},sampler:{},sigmas:{}},gf={loaders:{optional_lora_stack:"optional_lora_stack",positive:"positive",negative:"negative"},preSampling:{pipe:"pipe",image_to_latent:"image_to_latent",latent:"latent"},kSampler:{pipe:"pipe",model:"model"},controlnet:{pipe:"pipe",image:"image",image_kps:"image_kps",control_net:"control_net",positive:"positive",negative:"negative",mask:"mask"},positive_prompt:{},ipadapter:{model:"model",image:"image",image_style:"image",attn_mask:"attn_mask",optional_ipadapter:"optional_ipadapter"},inpaint:{pipe:"pipe",image:"image",mask:"mask"},sampler:{},sigmas:{}},vf={loaders:{pipe:"pipe",model:"model",vae:"vae",clip:null,positive:null,negative:null,latent:null},preSampling:{pipe:"pipe"},kSampler:{pipe:"pipe",image:"image"},controlnet:{pipe:"pipe",positive:"positive",negative:"negative"},positive_prompt:{text:"positive",positive:"text"},load_image:{IMAGE:"IMAGE",MASK:"MASK"},ipadapter:{model:"model",tiles:"tiles",masks:"masks",ipadapter:"ipadapter"},inpaint:{pipe:"pipe"},sampler:{SAMPLER:"SAMPLER"},sigmas:{SIGMAS:"SIGMAS"}};function yf(e,t,n){return function(){!function(e,t,n){const o=LiteGraph.createNode(t);if(o){if(y.graph.add(o),o.pos=e.pos.slice(),o.size=e.size.slice(),e.widgets.forEach((e=>{if(mf[n][e.name]){const i=mf[n][e.name];if(i){const n=(t=i,o.widgets.find((e=>"object"==typeof t?t.includes(e.name):e.name===t)));n&&(n.value=e.value,"seed_num"==e.name&&(n.linkedWidgets[0].value=e.linkedWidgets[0].value),"converted-widget"==e.type&&Cf(o,n,e))}}var t})),e.inputs&&e.inputs.forEach(((t,i)=>{if(t&&t.link&&gf[n][t.name]){const i=gf[n][t.name];if(null===i)return;const r=o.findInputSlot(i);if(-1!==r){const n=e.graph.links[t.link];if(n){const t=e.graph.getNodeById(n.origin_id);t&&t.connect(n.origin_slot,o,r)}}}})),e.outputs&&e.outputs.forEach(((t,i)=>{if(t&&t.links&&vf[n]&&vf[n][t.name]){const i=vf[n][t.name];if(null===i)return;const r=o.findOutputSlot(i);-1!==r&&t.links.forEach((t=>{const n=e.graph.links[t];if(n){const t=e.graph.getNodeById(n.target_id);t&&o.connect(r,t,n.target_slot)}}))}})),y.graph.remove(e),"easy fullkSampler"==o.type){const e=o.outputs[0].links;if(e&&e[0]){const t=y.graph._nodes.find((t=>t.inputs&&t.inputs[0]&&t.inputs[0].link==e[0]));t&&y.graph.remove(t)}}else if(sf.includes(o.type)){const e=o.outputs[0].links;if(!e||!e[0]){const e=LiteGraph.createNode("easy kSampler");y.graph.add(e),e.pos=o.pos.slice(),e.pos[0]=e.pos[0]+o.size[0]+20;const t=o.findInputSlot("pipe");-1!==t&&o&&o.connect(0,e,t)}}o.setSize([o.size[0],o.computeSize()[1]])}}(e,t,n)}}const bf=(e,t)=>{const n=e.prototype.getExtraMenuOptions;e.prototype.getExtraMenuOptions=function(){const e=n.apply(this,arguments);return t.apply(this,arguments),e}},_f=(e,t,n,o,i=!0)=>{bf(o,(function(o,r){r.unshift({content:e,has_submenu:i,callback:(e,o,i,r,s)=>wf(e,o,i,r,s,t,n)}),"loaders"==t&&(r.unshift({content:V("💎 View Lora Info..."),callback:(e,t,n,o,i)=>{let r=i.widgets.find((e=>"lora_name"==e.name)).value;r&&"None"!=r&&new of(r).show("loras",r)}}),r.unshift({content:V("💎 View Checkpoint Info..."),callback:(e,t,n,o,i)=>{let r=i.widgets[0].value;r&&"None"!=r&&new nf(r).show("checkpoints",r)}}))}))},wf=(e,t,n,o,i,r,s)=>{const a=[];return s.map((e=>{i.type!==e&&a.push({content:`${e}`,callback:yf(i,e,r)})})),new LiteGraph.ContextMenu(a,{event:n,callback:null,parentMenu:o,node:i}),!1},Sf="converted-widget",xf=Symbol();function kf(e,t,n=""){if(t.origType=t.type,t.origComputeSize=t.computeSize,t.origSerializeValue=t.serializeValue,t.computeSize=()=>[0,-4],t.type=Sf+n,t.serializeValue=()=>{if(!e.inputs)return;let n=e.inputs.find((e=>{var n;return(null==(n=e.widget)?void 0:n.name)===t.name}));return n&&n.link?t.origSerializeValue?t.origSerializeValue():t.value:void 0},t.linkedWidgets)for(const o of t.linkedWidgets)kf(e,o,":"+t.name)}function Cf(e,t,n){kf(e,t);const{type:o}=function(e){let t=e[0];t instanceof Array&&(t="COMBO");return{type:t}}(n),i=e.size;t.options&&t.options.forceInput||e.addInput(t.name,o,{widget:{name:t.name,[xf]:()=>n}});for(const r of e.widgets)r.last_y+=LiteGraph.NODE_SLOT_HEIGHT;e.setSize([Math.max(i[0],e.size[0]),Math.max(i[1],e.size[1])])}const Af=function(e){var t,n,o,i;const r=e.constructor.type,s=e.properties.origVals||{},a=s.title||e.title,l=s.color||e.color,c=s.bgcolor||e.bgcolor,u=e,d={size:[...e.size],color:l,bgcolor:c,pos:[...e.pos]};let p=[],f=[];if(e.inputs)for(const y of e.inputs)if(y.link){const t=y.name,n=e.findInputSlot(t),o=e.getInputNode(n),i=e.getInputLink(n);p.push([i.origin_slot,o,t])}if(e.outputs)for(const y of e.outputs)if(y.links){const e=y.name;for(const t of y.links){const n=graph.links[t],o=graph._nodes_by_id[n.target_id];f.push([e,o,n.target_slot])}}y.graph.remove(e);const h=y.graph.add(LiteGraph.createNode(r,a,d));function m(){if(u.widgets)for(let e of u.widgets)if("converted-widget"===e.type){const t=h.widgets.find((t=>t.name===e.name));for(let n of u.inputs)n.name===e.name&&Cf(h,t,n.widget)}for(let e of p){const[t,n,o]=e;n.connect(t,h.id,o)}for(let e of f){const[t,n,o]=e;h.connect(t,n,o)}}let g=u.widgets_values;if(!g&&(null==(t=h.widgets)?void 0:t.length)>0)return h.widgets.forEach(((e,t)=>{const n=u.widgets[t];e.name===n.name&&e.type===n.type&&(e.value=n.value)})),void m();const v=(null==g?void 0:g.length)<=(null==(n=h.widgets)?void 0:n.length);let b=v?0:g.length-1;function _(e,t){var n,o,i,r,s,a;if(!0===e||!1===e){if((null==(n=t.options)?void 0:n.on)&&(null==(o=t.options)?void 0:o.off))return{value:e,pass:!0}}else if("number"==typeof e){if((null==(i=t.options)?void 0:i.min)<=e&&e<=(null==(r=t.options)?void 0:r.max))return{value:e,pass:!0}}else{if(null==(a=null==(s=t.options)?void 0:s.values)?void 0:a.includes(e))return{value:e,pass:!0};if(t.inputEl&&"string"==typeof e)return{value:e,pass:!0}}return{value:t.value,pass:!1}}const w=e=>{var t;const n=u.widgets[e];let o=h.widgets[e];if(o.name===n.name&&o.type===n.type){for(;v?b=0;){let{value:e,pass:t}=_(g[b],o);if(t&&null!==e){o.value=e;break}b+=v?1:-1}b++,v||(b=g.length-((null==(t=h.widgets)?void 0:t.length)-1-e))}};if(v&&(null==(o=h.widgets)?void 0:o.length)>0)for(let y=0;y0)for(let y=h.widgets.length-1;y>=0;y--)w(y);m()};y.registerExtension({name:"Comfy.EasyUse.ExtraMenu",async beforeRegisterNodeDef(e,t,n){bf(e,(function(e,n){n.unshift({content:V("🔃 Reload Node"),callback:(e,t,n,o,i)=>{let r=LGraphCanvas.active_canvas;if(!r.selected_nodes||Object.keys(r.selected_nodes).length<=1)Af(i);else for(let s in r.selected_nodes)Af(r.selected_nodes[s])}}),"easy ckptNames"==t.name&&n.unshift({content:V("💎 View Checkpoint Info..."),callback:(e,t,n,o,i)=>{i.widgets[0].value}})})),pf.includes(t.name)&&_f("↪️ Swap EasyPrompt","positive_prompt",pf,e),rf.includes(t.name)&&_f("↪️ Swap EasyLoader","loaders",rf,e),sf.includes(t.name)&&_f("↪️ Swap EasyPreSampling","preSampling",sf,e),cf.includes(t.name)&&_f("↪️ Swap EasyKSampler","preSampling",cf,e),af.includes(t.name)&&_f("↪️ Swap Custom Sampler","sampler",af,e),lf.includes(t.name)&&_f("↪️ Swap Custom Sigmas","sigmas",lf,e),uf.includes(t.name)&&_f("↪️ Swap EasyControlnet","controlnet",uf,e),df.includes(t.name)&&_f("↪️ Swap EasyAdapater","ipadapter",df,e),ff.includes(t.name)&&_f("↪️ Swap LoadImage","load_image",ff,e),hf.includes(t.name)&&_f("↪️ Swap InpaintNode","inpaint",hf,e)}});const Ef="➡️";y.registerExtension({name:"easy setNode",registerCustomNodes(){class e{constructor(){v(this,"defaultVisibility",!0),v(this,"serialize_widgets",!0),this.properties||(this.properties={previousName:""}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("text","Constant","",((e,n,o,i,r)=>{t.validateName(t.graph),""!==this.widgets[0].value&&(this.title=Ef+this.widgets[0].value),this.update(),this.properties.previousName=this.widgets[0].value}),{}),this.addInput("*","*"),this.onConnectionsChange=function(e,n,o,i,r){if(1!=e||o||(this.inputs[n].type="*",this.inputs[n].name="*",this.title="Set"),i&&t.graph&&1==e&&o){const e=t.graph._nodes.find((e=>e.id==i.origin_id)).outputs[i.origin_slot],n=e.type,o=t.is_auto_link?this.widgets[0].value:e.name;"Set"===this.title&&(this.title=Ef+o,this.widgets[0].value=o),"*"===this.widgets[0].value&&(this.widgets[0].value=o),this.validateName(t.graph),this.inputs[0].type=n,this.inputs[0].name=o,setTimeout((e=>{this.title=Ef+this.widgets[0].value}),1)}this.update()},this.validateName=function(e){let n=t.widgets[0].value;if(""!=n){let o=0,i=[];do{i=e._nodes.filter((e=>e!=this&&("easy setNode"==e.type&&e.widgets[0].value===n))),i.length>0&&(n=t.widgets[0].value+o),o++}while(i.length>0);t.widgets[0].value=n,this.update()}},this.clone=function(){const t=e.prototype.clone.apply(this);return t.inputs[0].name="*",t.inputs[0].type="*",t.properties.previousName="",t.size=t.computeSize(),t},this.onAdded=function(e){this.validateName(e)},this.update=function(){if(t.graph){this.findGetters(t.graph).forEach((e=>{e.setType(this.inputs[0].type)})),this.widgets[0].value&&this.findGetters(t.graph,!0).forEach((e=>{e.setName(this.widgets[0].value)}));t.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues()}))}},this.findGetters=function(e,t){const n=t?this.properties.previousName:this.widgets[0].value;return e._nodes.filter((e=>"easy getNode"==e.type&&e.widgets[0].value===n&&""!=n))},this.isVirtualNode=!0}onRemoved(){this.graph._nodes.filter((e=>"easy getNode"==e.type)).forEach((e=>{e.setComboValues&&e.setComboValues([this])}))}}LiteGraph.registerNodeType("easy setNode",Object.assign(e,{title:"Set"})),e.category="EasyUse/Util"}}),y.registerExtension({name:"easy getNode",registerCustomNodes(){class e{constructor(){v(this,"defaultVisibility",!0),v(this,"serialize_widgets",!0),this.properties||(this.properties={}),this.properties.showOutputText=e.defaultVisibility;const t=this;t.color=LGraphCanvas.node_colors.blue.color,this.addWidget("combo","Constant","",(e=>{this.onRename()}),{values:()=>t.graph._nodes.filter((e=>"easy setNode"==e.type)).map((e=>e.widgets[0].value)).sort()}),this.addOutput("*","*"),this.onConnectionsChange=function(e,t,n,o,i){this.validateLinks(),2!=e||n?(this.onRename(),setTimeout((e=>{this.title="⬅️"+this.widgets[0].value}),1)):(this.outputs[t].type="*",this.outputs[t].name="*",this.title="Get")},this.setName=function(e){t.widgets[0].value=e,t.onRename(),t.serialize()},this.onRename=function(e=0){const n=this.findSetter(t.graph);if(n){const t=n.inputs[0].type,o=n.inputs[0].name;this.setType(t,o),this.outputs[e].type=t,this.outputs[e].name=o,this.title="⬅️"+n.widgets[0].value}else this.setType("*","*"),this.outputs[e].type="*",this.outputs[e].name="*"},this.clone=function(){const t=e.prototype.clone.apply(this);return t.size=t.computeSize(),t},this.validateLinks=function(){"*"!=this.outputs[0].type&&this.outputs[0].links&&this.outputs[0].links.forEach((e=>{const n=t.graph.links[e];n&&n.type!=this.outputs[0].type&&"*"!=n.type&&t.graph.removeLink(e)}))},this.setType=function(e,t){this.outputs[0].name=t,this.outputs[0].type=e,this.validateLinks()},this.findSetter=function(e){const t=this.widgets[0].value;return e._nodes.find((e=>"easy setNode"==e.type&&e.widgets[0].value===t&&""!=t))},this.isVirtualNode=!0}getInputLink(e){const t=this.findSetter(this.graph);if(t){const n=t.inputs[e];return this.graph.links[n.link]}throw new Error("No setter found for "+this.widgets[0].value+"("+this.type+")")}onAdded(e){}}LiteGraph.registerNodeType("easy getNode",Object.assign(e,{title:"Get"})),e.category="EasyUse/Util"}}),b.addEventListener("easyuse-global-seed",(function(e){let t=app.graph._nodes_by_id;for(let n in t){let o=t[n];if("easy globalSeed"==o.type){if(o.widgets){const t=o.widgets.find((e=>"value"==e.name));o.widgets.find((e=>"last_seed"==e.name)).value=t.value,t.value=e.detail.value}}else if(o.widgets){const t=o.widgets.find((e=>"seed_num"==e.name||"seed"==e.name||"noise_seed"==e.name));t&&null!=e.detail.seed_map[o.id]&&(t.value=e.detail.seed_map[o.id])}}}));const Of=b.queuePrompt;b.queuePrompt=async function(e,{output:t,workflow:n}){n.seed_widgets={};for(let o in app.graph._nodes_by_id){let e=app.graph._nodes_by_id[o].widgets;if(e)for(let t in e)"seed_num"!=e[t].name&&"seed"!=e[t].name&&"noise_seed"!=e[t].name||"converted-widget"==e[t].type||(n.seed_widgets[o]=parseInt(t))}return await Of.call(b,e,{output:t,workflow:n})};const Lf=["easy imageSave","easy fullkSampler","easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo","easy detailerFix"];y.registerExtension({name:"Comfy.EasyUse.SaveImageExtraOutput",async beforeRegisterNodeDef(e,t,n){if(Lf.includes(t.name)){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0,o=this.widgets.find((e=>"filename_prefix"===e.name||"save_prefix"===e.name));return o.serializeValue=()=>x(n,o.value),e}}else{const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=function(){const e=t?t.apply(this,arguments):void 0;return this.properties&&"Node name for S&R"in this.properties||this.addProperty("Node name for S&R",this.constructor.type,"string"),e}}}});const Tf=["easy wildcards","easy positive","easy negative","easy stylesSelector","easy promptConcat","easy promptReplace"],Nf=["easy preSampling","easy preSamplingAdvanced","easy preSamplingNoiseIn","easy preSamplingCustom","easy preSamplingDynamicCFG","easy preSamplingSdTurbo","easy preSamplingLayerDiffusion"],If=["easy kSampler","easy kSamplerTiled","easy kSamplerInpainting","easy kSamplerDownscaleUnet","easy kSamplerSDTurbo"],Pf=["easy controlnetLoader","easy controlnetLoaderADV"],Df=["easy instantIDApply","easy instantIDApplyADV"],jf=["easy ipadapterApply","easy ipadapterApplyADV","easy ipadapterApplyFaceIDKolors","easy ipadapterStyleComposition"],Mf=["easy pipeIn","easy pipeOut","easy pipeEdit"],Rf=["easy XYPlot","easy XYPlotAdvanced"],$f=["easy setNode"],Gf=["Reroute","RescaleCFG","LoraLoaderModelOnly","LoraLoader","FreeU","FreeU_v2",...jf,...$f],Bf={"easy seed":{from:{INT:["Reroute",...Nf,"easy fullkSampler"]}},"easy positive":{from:{STRING:["Reroute",...Tf]}},"easy negative":{from:{STRING:["Reroute",...Tf]}},"easy wildcards":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy stylesSelector":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy promptConcat":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy promptReplace":{from:{STRING:["Reroute","easy showAnything",...Tf]}},"easy fullLoader":{from:{PIPE_LINE:["Reroute",...Nf,"easy fullkSampler",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy a1111Loader":{from:{PIPE_LINE:["Reroute",...Nf,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy comfyLoader":{from:{PIPE_LINE:["Reroute",...Nf,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy hunyuanDiTLoader":{from:{PIPE_LINE:["Reroute",...Nf,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy kolorsLoader":{from:{PIPE_LINE:["Reroute",...Nf,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy pixArtLoader":{from:{PIPE_LINE:["Reroute",...Nf,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy svdLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy zero123Loader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy sv3dLoader":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced","easy preSamplingDynamicCFG",...Mf,...$f],MODEL:Gf},to:{STRING:["Reroute",...Tf]}},"easy preSampling":{from:{PIPE_LINE:["Reroute",...If,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingAdvanced":{from:{PIPE_LINE:["Reroute",...If,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingDynamicCFG":{from:{PIPE_LINE:["Reroute",...If,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingCustom":{from:{PIPE_LINE:["Reroute",...If,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingLayerDiffusion":{from:{PIPE_LINE:["Reroute","easy kSamplerLayerDiffusion",...If,...Mf,...Pf,...Rf,...$f]}},"easy preSamplingNoiseIn":{from:{PIPE_LINE:["Reroute",...If,...Mf,...Pf,...Rf,...$f]}},"easy fullkSampler":{from:{PIPE_LINE:["Reroute",...Mf.reverse(),"easy preDetailerFix","easy preMaskDetailerFix",...Nf,...$f]}},"easy kSampler":{from:{PIPE_LINE:["Reroute",...Mf.reverse(),"easy preDetailerFix","easy preMaskDetailerFix","easy hiresFix",...Nf,...$f]}},"easy controlnetLoader":{from:{PIPE_LINE:["Reroute",...Nf,...Pf,...Df,...Mf,...$f]}},"easy controlnetLoaderADV":{from:{PIPE_LINE:["Reroute",...Nf,...Pf,...Df,...Mf,...$f]}},"easy instantIDApply":{from:{PIPE_LINE:["Reroute",...Nf,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{COMBO:["Reroute","easy promptLine"]}},"easy instantIDApplyADV":{from:{PIPE_LINE:["Reroute",...Nf,...Pf,...Df,...Mf,...$f],MODEL:Gf},to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApply":{to:{COMBO:["Reroute","easy promptLine"]}},"easy ipadapterApplyADV":{to:{STRING:["Reroute","easy sliderControl",...Tf],COMBO:["Reroute","easy promptLine"]}},"easy ipadapterStyleComposition":{to:{COMBO:["Reroute","easy promptLine"]}},"easy preDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Mf,...$f]},to:{PIPE_LINE:["Reroute","easy ultralyticsDetectorPipe","easy samLoaderPipe","easy kSampler","easy fullkSampler"]}},"easy preMaskDetailerFix":{from:{PIPE_LINE:["Reroute","easy detailerFix",...Mf,...$f]}},"easy samLoaderPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Mf,...$f]}},"easy ultralyticsDetectorPipe":{from:{PIPE_LINE:["Reroute","easy preDetailerFix",...Mf,...$f]}},"easy cascadeLoader":{from:{PIPE_LINE:["Reroute","easy fullCascadeKSampler","easy preSamplingCascade",...Pf,...Mf,...$f],MODEL:Gf.filter((e=>!jf.includes(e)))}},"easy fullCascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Mf,...$f]}},"easy preSamplingCascade":{from:{PIPE_LINE:["Reroute","easy cascadeKSampler",...Mf,...$f]}},"easy cascadeKSampler":{from:{PIPE_LINE:["Reroute","easy preSampling","easy preSamplingAdvanced",...Mf,...$f]}}};y.registerExtension({name:"Comfy.EasyUse.Suggestions",async setup(e){LGraphCanvas.prototype.createDefaultNodeForSlot=function(e){e=e||{};var t,n=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,position:[],nodeType:null,posAdd:[0,0],posSizeFix:[0,0]},e),o=n.nodeFrom&&null!==n.slotFrom,i=!o&&n.nodeTo&&null!==n.slotTo;if(!o&&!i)return!1;if(!n.nodeType)return!1;var r=o?n.nodeFrom:n.nodeTo,s=o?n.slotFrom:n.slotTo,a=r.type,l=!1;switch(typeof s){case"string":l=o?r.findOutputSlot(s,!1):r.findInputSlot(s,!1),s=o?r.outputs[s]:r.inputs[s];break;case"object":l=o?r.findOutputSlot(s.name):r.findInputSlot(s.name);break;case"number":l=s,s=o?r.outputs[s]:r.inputs[s];break;default:return!1}var c=s.type==LiteGraph.EVENT?"_event_":s.type,u=o?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in;if(u&&u[c]){s.link;let e=!1;const i=o?"from":"to";if(Bf[a]&&Bf[a][i]&&(null==(t=Bf[a][i][c])?void 0:t.length)>0){for(var d in Bf[a][i][c])if(n.nodeType==Bf[a][i][c][d]||"AUTO"==n.nodeType){e=Bf[a][i][c][d];break}}else if("object"==typeof u[c]||"array"==typeof u[c]){for(var d in u[c])if(n.nodeType==u[c][d]||"AUTO"==n.nodeType){e=u[c][d];break}}else n.nodeType!=u[c]&&"AUTO"!=n.nodeType||(e=u[c]);if(e){var p=!1;"object"==typeof e&&e.node&&(p=e,e=e.node);var f=LiteGraph.createNode(e);if(f){if(p){if(p.properties)for(var h in p.properties)f.addProperty(h,p.properties[h]);if(p.inputs)for(var h in f.inputs=[],p.inputs)f.addOutput(p.inputs[h][0],p.inputs[h][1]);if(p.outputs)for(var h in f.outputs=[],p.outputs)f.addOutput(p.outputs[h][0],p.outputs[h][1]);p.title&&(f.title=p.title),p.json&&f.configure(p.json)}return this.graph.add(f),f.pos=[n.position[0]+n.posAdd[0]+(n.posSizeFix[0]?n.posSizeFix[0]*f.size[0]:0),n.position[1]+n.posAdd[1]+(n.posSizeFix[1]?n.posSizeFix[1]*f.size[1]:0)],o?n.nodeFrom.connectByType(l,f,c):n.nodeTo.connectByTypeOutput(l,f,c),!0}}}return!1},LGraphCanvas.prototype.showConnectionMenu=function(e){e=e||{};var t,n=Object.assign({nodeFrom:null,slotFrom:null,nodeTo:null,slotTo:null,e:null},e),o=this,i=n.nodeFrom&&n.slotFrom,r=!i&&n.nodeTo&&n.slotTo;if(!i&&!r)return!1;var s=i?n.nodeFrom:n.nodeTo,a=i?n.slotFrom:n.slotTo,l=!1;switch(typeof a){case"string":l=i?s.findOutputSlot(a,!1):s.findInputSlot(a,!1),a=i?s.outputs[a]:s.inputs[a];break;case"object":l=i?s.findOutputSlot(a.name):s.findInputSlot(a.name);break;case"number":l=a,a=i?s.outputs[a]:s.inputs[a];break;default:return!1}var c=["Add Node",null];o.allow_searchbox&&(c.push("Search"),c.push(null));var u=a.type==LiteGraph.EVENT?"_event_":a.type,d=i?LiteGraph.slot_types_default_out:LiteGraph.slot_types_default_in,p=s.type;if(d&&d[u]){const e=i?"from":"to";if(Bf[p]&&Bf[p][e]&&(null==(t=Bf[p][e][u])?void 0:t.length)>0)for(var f in Bf[p][e][u])c.push(Bf[p][e][u][f]);else if("object"==typeof d[u]||"array"==typeof d[u])for(var f in d[u])c.push(d[u][f]);else c.push(d[u])}var h=new LiteGraph.ContextMenu(c,{event:n.e,title:(a&&""!=a.name?a.name+(u?" | ":""):"")+(a&&u?u:""),callback:function(e,t,r){switch(e){case"Add Node":LGraphCanvas.onMenuAdd(null,null,r,h,(function(e){i?n.nodeFrom.connectByType(l,e,u):n.nodeTo.connectByTypeOutput(l,e,u)}));break;case"Search":i?o.showSearchBox(r,{node_from:n.nodeFrom,slot_from:a,type_filter_in:u}):o.showSearchBox(r,{node_to:n.nodeTo,slot_from:a,type_filter_out:u});break;default:o.createDefaultNodeForSlot(Object.assign(n,{position:[n.e.canvasX,n.e.canvasY],nodeType:e}))}}});return!1}}}),y.registerExtension({name:"Comfy.EasyUse.TimeTaken",setup(){const e=new Map;let t=0;b.addEventListener("executing",(n=>{if(!A("EasyUse.Nodes.Runtime",null,!0))return;const o=(null==n?void 0:n.node)||(null==n?void 0:n.detail)||null,i=Cp(o);i&&(i.executionDuration="");const r=e.get(t);if(e.delete(t),t&&r){const e=Date.now()-r,n=Cp(t);n&&(n.executionDuration=`${(e/1e3).toFixed(2)}${V("s")}`)}t=o,e.set(o,Date.now())}))},beforeRegisterNodeDef(e,t){const n=e.prototype.onDrawForeground;e.prototype.onDrawForeground=function(...e){const[t]=e;return function(e,t){if(!t)return;e.save(),e.fillStyle=LiteGraph.NODE_DEFAULT_BGCOLOR,function(e,t,n,o,i,r){e.beginPath(),e.moveTo(t+r,n),e.lineTo(t+o-r,n),e.arcTo(t+o,n,t+o,n+r,r),e.lineTo(t+o,n+i-r),e.arcTo(t+o,n+i,t+o-r,n+i,r),e.lineTo(t+r,n+i),e.arcTo(t,n+i,t,n+i-r,r),e.lineTo(t,n+r),e.arcTo(t,n,t+r,n,r),e.closePath()}(e,0,-LiteGraph.NODE_TITLE_HEIGHT-20,e.measureText(t).width+10,LiteGraph.NODE_TITLE_HEIGHT-10,4),e.fill(),function(e,t,n,o,i="#000",r=12,s="Inter"){e.font=`${r}px ${s}`,e.fillStyle=i,e.fillText(t,n,o)}(e,t,8,-LiteGraph.NODE_TITLE_HEIGHT-6,LiteGraph.NODE_TITLE_COLOR),e.restore()}(t,this.executionDuration||""),null==n?void 0:n.apply(this,e)}}});const Ff="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function Uf(e,t,n,o){e.addEventListener?e.addEventListener(t,n,o):e.attachEvent&&e.attachEvent("on".concat(t),n)}function zf(e,t,n,o){e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent&&e.detachEvent("on".concat(t),n)}function Vf(e,t){const n=t.slice(0,t.length-1);for(let o=0;o=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}const Wf={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Ff?173:189,"=":Ff?61:187,";":Ff?59:186,"'":222,"[":219,"]":221,"\\":220},Yf={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Zf={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Kf={16:!1,18:!1,17:!1,91:!1},Xf={};for(let by=1;by<20;by++)Wf["f".concat(by)]=111+by;let Qf=[],Jf=null,qf="all";const eh=new Map,th=e=>Wf[e.toLowerCase()]||Yf[e.toLowerCase()]||e.toUpperCase().charCodeAt(0);function nh(e){qf=e||"all"}function oh(){return qf||"all"}function ih(e){if(void 0===e)Object.keys(Xf).forEach((e=>{Array.isArray(Xf[e])&&Xf[e].forEach((e=>rh(e))),delete Xf[e]})),ch(null);else if(Array.isArray(e))e.forEach((e=>{e.key&&rh(e)}));else if("object"==typeof e)e.key&&rh(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o{let{key:t,scope:n,method:o,splitKey:i="+"}=e;Hf(t).forEach((e=>{const t=e.split(i),r=t.length,s=t[r-1],a="*"===s?"*":th(s);if(!Xf[a])return;n||(n=oh());const l=r>1?Vf(Yf,t):[],c=[];Xf[a]=Xf[a].filter((e=>{const t=(!o||e.method===o)&&e.scope===n&&function(e,t){const n=e.length>=t.length?e:t,o=e.length>=t.length?t:e;let i=!0;for(let r=0;rch(e)))}))};function sh(e,t,n,o){if(t.element!==o)return;let i;if(t.scope===n||"all"===t.scope){i=t.mods.length>0;for(const e in Kf)Object.prototype.hasOwnProperty.call(Kf,e)&&(!Kf[e]&&t.mods.indexOf(+e)>-1||Kf[e]&&-1===t.mods.indexOf(+e))&&(i=!1);(0!==t.mods.length||Kf[16]||Kf[18]||Kf[17]||Kf[91])&&!i&&"*"!==t.shortcut||(t.keys=[],t.keys=t.keys.concat(Qf),!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function ah(e,t){const n=Xf["*"];let o=e.keyCode||e.which||e.charCode;if(!lh.filter.call(this,e))return;if(93!==o&&224!==o||(o=91),-1===Qf.indexOf(o)&&229!==o&&Qf.push(o),["ctrlKey","altKey","shiftKey","metaKey"].forEach((t=>{const n=Zf[t];e[t]&&-1===Qf.indexOf(n)?Qf.push(n):!e[t]&&Qf.indexOf(n)>-1?Qf.splice(Qf.indexOf(n),1):"metaKey"===t&&e[t]&&3===Qf.length&&(e.ctrlKey||e.shiftKey||e.altKey||(Qf=Qf.slice(Qf.indexOf(n))))})),o in Kf){Kf[o]=!0;for(const e in Yf)Yf[e]===o&&(lh[e]=!0);if(!n)return}for(const a in Kf)Object.prototype.hasOwnProperty.call(Kf,a)&&(Kf[a]=e[Zf[a]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===Qf.indexOf(17)&&Qf.push(17),-1===Qf.indexOf(18)&&Qf.push(18),Kf[17]=!0,Kf[18]=!0);const i=oh();if(n)for(let a=0;a1&&(i=Vf(Yf,e)),(e="*"===(e=e[e.length-1])?"*":th(e))in Xf||(Xf[e]=[]),Xf[e].push({keyup:l,keydown:c,scope:r,mods:i,shortcut:o[a],method:n,key:o[a],splitKey:u,element:s});if(void 0!==s&&window){if(!eh.has(s)){const e=function(){return ah(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event,s)},t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event;ah(e,s),function(e){let t=e.keyCode||e.which||e.charCode;const n=Qf.indexOf(t);if(n>=0&&Qf.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&Qf.splice(0,Qf.length),93!==t&&224!==t||(t=91),t in Kf){Kf[t]=!1;for(const e in Yf)Yf[e]===t&&(lh[e]=!1)}}(e)};eh.set(s,{keydownListener:e,keyupListenr:t,capture:d}),Uf(s,"keydown",e,d),Uf(s,"keyup",t,d)}if(!Jf){const e=()=>{Qf=[]};Jf={listener:e,capture:d},Uf(window,"focus",e,d)}}}function ch(e){const t=Object.values(Xf).flat();if(t.findIndex((t=>{let{element:n}=t;return n===e}))<0){const{keydownListener:t,keyupListenr:n,capture:o}=eh.get(e)||{};t&&n&&(zf(e,"keyup",n,o),zf(e,"keydown",t,o),eh.delete(e))}if(t.length<=0||eh.size<=0){if(Object.keys(eh).forEach((e=>{const{keydownListener:t,keyupListenr:n,capture:o}=eh.get(e)||{};t&&n&&(zf(e,"keyup",n,o),zf(e,"keydown",t,o),eh.delete(e))})),eh.clear(),Object.keys(Xf).forEach((e=>delete Xf[e])),Jf){const{listener:e,capture:t}=Jf;zf(window,"focus",e,t),Jf=null}}}const uh={getPressedKeyString:function(){return Qf.map((e=>{return t=e,Object.keys(Wf).find((e=>Wf[e]===t))||(e=>Object.keys(Yf).find((t=>Yf[t]===e)))(e)||String.fromCharCode(e);var t}))},setScope:nh,getScope:oh,deleteScope:function(e,t){let n,o;e||(e=oh());for(const i in Xf)if(Object.prototype.hasOwnProperty.call(Xf,i))for(n=Xf[i],o=0;o{let{element:t}=e;return ch(t)}))}else o++;oh()===e&&nh(t||"all")},getPressedKeyCodes:function(){return Qf.slice(0)},getAllKeyCodes:function(){const e=[];return Object.keys(Xf).forEach((t=>{Xf[t].forEach((t=>{let{key:n,scope:o,mods:i,shortcut:r}=t;e.push({scope:o,shortcut:r,mods:i,keys:n.split("+").map((e=>th(e)))})}))})),e},isPressed:function(e){return"string"==typeof e&&(e=th(e)),-1!==Qf.indexOf(e)},filter:function(e){const t=e.target||e.srcElement,{tagName:n}=t;let o=!0;const i="INPUT"===n&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(i||"TEXTAREA"===n||"SELECT"===n)&&!t.readOnly)&&(o=!1),o},trigger:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(Xf).forEach((n=>{Xf[n].filter((n=>n.scope===t&&n.shortcut===e)).forEach((e=>{e&&e.method&&e.method()}))}))},unbind:ih,keyMap:Wf,modifier:Yf,modifierMap:Zf};for(const by in uh)Object.prototype.hasOwnProperty.call(uh,by)&&(lh[by]=uh[by]);if("undefined"!=typeof window){const e=window.hotkeys;lh.noConflict=t=>(t&&window.hotkeys===lh&&(window.hotkeys=e),lh),window.hotkeys=lh}let dh=null;y.registerExtension({name:"Comfy.EasyUse.HotKeys",setup(){if(void 0!==lh){lh("up,down,left,right",(function(e,t){var n,o,i,r,s,a,l,c,u,d,p,f,h,m,g;e.preventDefault();if(!A("EasyUse.Hotkeys.JumpNearestNodes",null,!0))return;const v=Ap();if(0===v.length)return;const y=v[0];switch(t.key){case"up":case"left":let e=null;if(Ip(y)){const e=null==(n=y.widgets_values)?void 0:n[0],t=null==(o=y.graph)?void 0:o._nodes,i=null==t?void 0:t.find((t=>{var n;if(Pp(t)){if((null==(n=t.widgets_values)?void 0:n[0])===e)return t}return null}));i&&Op(i)}else if((null==(i=y.inputs)?void 0:i.length)>0){for(let t=0;t{var n;if(Ip(t)){if((null==(n=t.widgets_values)?void 0:n[0])===e)return t}return null}));n&&Op(n)}else if((null==(d=y.outputs)?void 0:d.length)>0){for(let e=0;e0&&y.outputs[e].links[0]){t=y.outputs[e].links[0];break}if(t){const e=null==(f=y.graph)?void 0:f.links;if(e[t]){const n=null==(h=e[t])?void 0:h.target_id,o=null==(g=null==(m=y.graph)?void 0:m._nodes_by_id)?void 0:g[n];o&&Op(o)}}}}})),lh("shift+up,shift+down,shift+left,shift+right",(function(e,t){e.preventDefault();if(!A("EasyUse.Hotkeys.AlignSelectedNodes",null,!0))return;const n=Ap();if(n.length<=1)return;const o=n;switch(t.key){case"shift+up":LGraphCanvas.alignNodes(o,"top",o[0]);break;case"shift+down":LGraphCanvas.alignNodes(o,"bottom",o[0]);break;case"shift+left":LGraphCanvas.alignNodes(o,"left",o[0]);break;case"shift+right":LGraphCanvas.alignNodes(o,"right",o[0])}dh||(dh=np()),dh&&dh.update()})),lh("shift+g",(function(e,t){e.preventDefault();A("EasyUse.Hotkeys.AddGroup",null,!0)&&(fh(),dh||(dh=np()),dh&&dh.update())}));const e=[];Array.from(Array(10).keys()).forEach((t=>e.push(`alt+${t}`))),lh(e.join(","),(async function(e,t){e.preventDefault();if(!A("EasyUse.Hotkeys.NodesTemplate",null,!0))return;const n=t.key;let o=parseInt(n.split("+")[1]);const i=await b.getUserData("comfy.templates.json");let r=null;if(200==i.status)try{r=await i.json()}catch(a){Fp.error(V("Get Node Templates File Failed"))}else localStorage["Comfy.NodeTemplates"]?r=JSON.parse(localStorage["Comfy.NodeTemplates"]):Fp.warn(V("No Node Templates Found"));if(!r)return void Fp.warn(V("No Node Templates Found"));o=0===o?9:o-1;const s=r[o];if(s)try{const e=(null==s?void 0:s.name)||"Group",t=(null==s?void 0:s.data)?JSON.parse(s.data):[];ph((async()=>{await k.registerFromWorkflow(t.groupNodes,{}),localStorage.litegrapheditor_clipboard=s.data,y.canvas.pasteFromClipboard(),t.groupNodes||fh(e)}))}catch(a){Fp.error(a)}else Fp.warn(V("Node template with {key} not set").replace("{key}",n))}));const t=async function(e){if(("b"===e.key||"m"==e.key)&&(e.metaKey||e.ctrlKey)){if(0===Ap().length)return;dh||(dh=np()),dh&&dh.update()}};window.addEventListener("keydown",t,!0)}}});const ph=async e=>{const t=localStorage.litegrapheditor_clipboard;await e(),localStorage.litegrapheditor_clipboard=t},fh=e=>{const t=Ap();if(0===t.length)return;const n=t;let o=new LiteGraph.LGraphGroup;o.title=e||"Group",((e,t=[],n=20)=>{var o,i,r,s,a,l,c,u,d,p;for(var f of(i=r=s=a=-1,l=c=u=d=-1,[e._nodes,t]))for(var h in f)l=(p=f[h]).pos[0],c=p.pos[1],u=p.pos[0]+p.size[0],d=p.pos[1]+p.size[1],"Reroute"!=p.type&&(c-=LiteGraph.NODE_TITLE_HEIGHT),(null==(o=p.flags)?void 0:o.collapsed)&&(d=c+LiteGraph.NODE_TITLE_HEIGHT,(null==p?void 0:p._collapsed_width)&&(u=l+Math.round(p._collapsed_width))),(-1==i||ls)&&(s=u),(-1==a||d>a)&&(a=d);r-=Math.round(1.4*e.font_size),e.pos=[i-n,r-n],e.size=[s-i+2*n,a-r+2*n]})(o,n),y.canvas.graph.add(o)};function hh(e,t,n,o){const i=[];return e.workflow.links.forEach((e=>{n&&e[1]===t&&!i.includes(e[3])&&i.push(e[3]),o&&e[3]===t&&!i.includes(e[1])&&i.push(e[1])})),i}async function mh(e,t=!1){const n=structuredClone(await y.graphToPrompt()),o=[];if(n.workflow.nodes.forEach((e=>{o.push(e.id)})),n.workflow.links=n.workflow.links.filter((e=>o.includes(e[1])&&o.includes(e[3]))),t)for(;!y.graph._nodes_by_id[e].isChooser;)e=hh(n,e,!0,!1)[0];const i=function(e,t){const n=[],o=[t];for(;o.length>0;){const t=o.pop();n.push(t),o.push(...hh(e,t,!0,!1).filter((e=>!(n.includes(e)||o.includes(e)))))}o.push(...n.filter((e=>e!=t)));const i=[t];for(;o.length>0;){const t=o.pop();i.push(t),o.push(...hh(e,t,!1,!0).filter((e=>!(i.includes(e)||o.includes(e)))))}const r=[];return r.push(...n),r.push(...i.filter((e=>!r.includes(e)))),r}(n,e);n.workflow.nodes=n.workflow.nodes.filter((t=>(t.id===e&&t.inputs.forEach((e=>{e.link=null})),i.includes(t.id)))),n.workflow.links=n.workflow.links.filter((e=>i.includes(e[1])&&i.includes(e[3])));const r={};for(const[l,c]of Object.entries(n.output))i.includes(parseInt(l))&&(r[l]=c);const s={};for(const[l,c]of Object.entries(r[e.toString()].inputs))Array.isArray(c)||(s[l]=c);r[e.toString()].inputs=s,n.output=r;const a=y.graphToPrompt;y.graphToPrompt=()=>(y.graphToPrompt=a,n),y.queuePrompt(0)}const gh=new class{constructor(){this.current_node_id=void 0,this.class_of_current_node=null,this.current_node_is_chooser=!1}update(){var e,t;return y.runningNodeId!=this.current_node_id&&(this.current_node_id=y.runningNodeId,this.current_node_id?(this.class_of_current_node=null==(t=null==(e=y.graph)?void 0:e._nodes_by_id[y.runningNodeId.toString()])?void 0:t.comfyClass,this.current_node_is_chooser="easy imageChooser"===this.class_of_current_node):(this.class_of_current_node=void 0,this.current_node_is_chooser=!1),!0)}},vh=class e{constructor(){}static idle(){return!y.runningNodeId}static paused(){return!0}static paused_here(t){return e.here(t)}static running(){return!e.idle()}static here(e){return y.runningNodeId==e}static state(){return"Paused"}};v(vh,"cancelling",!1);let yh=vh;function bh(e,t){const n=new FormData;n.append("message",t),n.append("id",e),b.fetchApi("/easyuse/image_chooser_message",{method:"POST",body:n})}function _h(){bh(-1,"__cancel__"),yh.cancelling=!0,b.interrupt(),yh.cancelling=!1}var wh=0;function Sh(){wh+=1}const xh=["easy kSampler","easy kSamplerTiled","easy fullkSampler"];function kh(e){const t=y.graph._nodes_by_id[e.detail.id];if(t){t.selected=new Set,t.anti_selected=new Set;const n=function(e,t){var n;return e.imgs=[],t.forEach((t=>{const n=new Image;e.imgs.push(n),n.onload=()=>{y.graph.setDirtyCanvas(!0)},n.src=`/view?filename=${encodeURIComponent(t.filename)}&type=temp&subfolder=${y.getPreviewFormatParam()}`})),null==(n=e.setSizeForImage)||n.call(e),e.imgs}(t,e.detail.urls);return{node:t,image:n,isKSampler:xh.includes(t.type)}}}function Ch(e,t,n){var o;if(e.imageRects)o=e.imageRects[t];else{const t=e.imagey;o=[1,t+1,e.size[0]-2,e.size[1]-t-2]}n.strokeRect(o[0]+1,o[1]+1,o[2]-2,o[3]-2)}class Ah extends w{constructor(){super(),this.node=null,this.select_index=[],this.dialog_div=null}show(e,t){this.select_index=[],this.node=t;const n=e.map(((e,n)=>{const o=_("img",{src:e.src,onclick:e=>{this.select_index.includes(n)?(this.select_index=this.select_index.filter((e=>e!==n)),o.classList.remove("selected")):(this.select_index.push(n),o.classList.add("selected")),t.selected.has(n)?t.selected.delete(n):t.selected.add(n)}});return o}));super.show(_("div.comfyui-easyuse-chooser-dialog",[_("h5.comfyui-easyuse-chooser-dialog-title",V("Choose images to continue")),_("div.comfyui-easyuse-chooser-dialog-images",n)]))}createButtons(){const e=super.createButtons();return e[0].onclick=e=>{yh.running()&&_h(),super.close()},e.unshift(_("button",{type:"button",textContent:V("Choose Selected Images"),onclick:e=>{bh(this.node.id,[...this.node.selected,-1,...this.node.anti_selected]),yh.idle()&&(Sh(),mh(this.node.id).then((()=>{bh(this.node.id,[...this.node.selected,-1,...this.node.anti_selected])}))),super.close()}})),e}}function Eh(){const e=y.graph._nodes_by_id[this.node_id];if(e){const t=[...e.selected];(null==t?void 0:t.length)>0&&e.setProperty("values",t),bh(e.id,[...e.selected,-1,...e.anti_selected]),yh.idle()&&(Sh(),mh(e.id).then((()=>{bh(e.id,[...e.selected,-1,...e.anti_selected])})))}}function Oh(){yh.running()&&_h()}function Lh(e){Object.defineProperty(e,"clicked",{get:function(){return this._clicked},set:function(e){this._clicked=e&&""!=this.name}})}function Th(e){e.options||(e.options={}),e.options.serialize=!1}y.registerExtension({name:"Comfy.EasyUse.imageChooser",init(){window.addEventListener("beforeunload",_h,!0)},setup(e){const t=LGraphCanvas.prototype.draw;LGraphCanvas.prototype.draw=function(){gh.update()&&e.graph._nodes.forEach((e=>{e.update&&e.update()})),t.apply(this,arguments)},b.addEventListener("easyuse-image-choose",(function(e){const{node:t,image:n,isKSampler:o}=kh(e);if(o){(new Ah).show(n,t)}}));const n=b.interrupt;b.interrupt=function(){yh.cancelling||_h(),n.apply(this,arguments)},b.addEventListener("execution_start",(function(){(wh>0?(wh-=1,0):(bh(-1,"__start__"),1))&&e.graph._nodes.forEach((e=>{(e.selected||e.anti_selected)&&(e.selected.clear(),e.anti_selected.clear(),e.update())}))}))},async nodeCreated(e,t){if("easy imageChooser"==e.comfyClass){e.setProperty("values",[]),void 0===(null==e?void 0:e.imageIndex)&&Object.defineProperty(e,"imageIndex",{get:function(){return null},set:function(t){e.overIndex=t}}),void 0===(null==e?void 0:e.imagey)&&Object.defineProperty(e,"imagey",{get:function(){return null},set:function(t){return e.widgets[e.widgets.length-1].last_y+LiteGraph.NODE_WIDGET_HEIGHT}});const t=e.onMouseDown;e.onMouseDown=function(n,o,i){if(n.isPrimary){const t=function(e,t){var n,o;if((null==(n=e.imgs)?void 0:n.length)>1)for(var i=0;i0&&n0&&oe.imagey)return 0;return-1}(e,o);t>=0&&this.imageClicked(t)}return t&&t.apply(this,arguments)},e.send_button_widget=e.addWidget("button","","",Eh),e.cancel_button_widget=e.addWidget("button","","",Oh),Lh(e.cancel_button_widget),Lh(e.send_button_widget),Th(e.cancel_button_widget),Th(e.send_button_widget)}},beforeRegisterNodeDef(e,t,n){if("easy imageChooser"==(null==t?void 0:t.name)){const t=e.prototype.onDrawBackground;e.prototype.onDrawBackground=function(e){t.apply(this,arguments),function(e,t){var n,o;if(e.imgs){if(e.imageRects)for(let n=0;n{Ch(e,n,t)})),t.strokeStyle="#F88",null==(o=null==e?void 0:e.anti_selected)||o.forEach((n=>{Ch(e,n,t)}))}}(this,e)},e.prototype.imageClicked=function(t){"easy imageChooser"===(null==e?void 0:e.comfyClass)&&(this.selected.has(t)?this.selected.delete(t):this.selected.add(t),this.update())};const n=e.prototype.update;e.prototype.update=function(){var e;if(n&&n.apply(this,arguments),this.send_button_widget){this.send_button_widget.node_id=this.id;const t=(this.selected?this.selected.size:0)+(this.anti_selected?this.anti_selected.size:0),n=(null==(e=this.imgs)?void 0:e.length)||0;yh.paused_here(this.id)&&t>0?this.send_button_widget.name=t>1?"Progress selected ("+t+"/"+n+")":"Progress selected image":this.send_button_widget.name=t>0?t>1?"Progress selected ("+t+"/"+n+")":"Progress selected image as restart":""}if(this.cancel_button_widget){const e=yh.running();this.cancel_button_widget.name=e?"Cancel current run":""}this.setDirtyCanvas(!0,!0)}}}}),Number.prototype.div=function(e){return function(e,t){let n,o,i=0,r=0,s="string"==typeof e?e:e.toString(),a="string"==typeof t?t:t.toString();try{i=s.toString().split(".")[1].length}catch(l){}try{r=a.toString().split(".")[1].length}catch(l){}return n=Number(s.toString().replace(".","")),o=Number(a.toString().replace(".","")),n/o*Math.pow(10,r-i)}(this,e)};let Nh=[],Ih=0;const Ph={sd3:6.5,"sd3-turbo":4};class Dh extends w{constructor(){super(),this.lists=[],this.dialog_div=null,this.user_div=null}addItem(e,t){return _("div.easyuse-account-dialog-item",[_("input",{type:"text",placeholder:"Enter name",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Nh[t].name=e.target.value},value:Nh[e].name}),_("input.key",{type:"text",oninput:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Nh[t].key=e.target.value},placeholder:"Enter APIKEY",value:Nh[e].key}),_("button.choose",{textContent:V("Choose"),onclick:async e=>{var n,o,i;const r=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);let s=Nh[r].name,a=Nh[r].key;if(!s)return void Fp.error(V("Please enter the account name"));if(!a)return void Fp.error(V("Please enter the APIKEY"));let l=!0;for(let t=0;t{(new Dh).show(t)}},[_("div.user",[_("div.avatar",r?[_("img",{src:r})]:"😀"),_("div.info",[_("h5.name",s),_("h6.remark","Credits: "+a)])]),_("div.edit",{textContent:V("Edit")})])),Fp.success(V("Save Succeed"))}else Fp.success(V("Save Succeed"));this.close()}else Fp.error(V("Save Failed"))}}),_("button.delete",{textContent:V("Delete"),onclick:e=>{const t=Array.prototype.indexOf.call(this.dialog_div.querySelectorAll(".easyuse-account-dialog-item"),e.target.parentNode);Nh.length<=1?Fp.error(V("At least one account is required")):(Nh.splice(t,1),this.dialog_div.removeChild(e.target.parentNode))}})])}show(e){Nh.forEach(((t,n)=>{this.lists.push(this.addItem(n,e))})),this.dialog_div=_("div.easyuse-account-dialog",this.lists),super.show(_("div.easyuse-account-dialog-main",[_("div",[_("a",{href:"https://platform.stability.ai/account/keys",target:"_blank",textContent:V("Getting Your APIKEY")})]),this.dialog_div]))}createButtons(){const e=super.createButtons();return e.unshift(_("button",{type:"button",textContent:V("Save Account Info"),onclick:e=>{let t=!0;for(let n=0;n{200==e.status?Fp.success(V("Save Succeed")):Fp.error(V("Save Failed"))}))}else Fp.error(V("APIKEY is not Empty"))}})),e.unshift(_("button",{type:"button",textContent:V("Add Account"),onclick:e=>{const t="Account "+Nh.length.toString();Nh.push({name:t,key:""});const n=this.addItem(Nh.length-1);this.lists.push(n),this.dialog_div.appendChild(n)}})),e}}y.registerExtension({name:"Comfy.EasyUse.API.SD3",async beforeRegisterNodeDef(e,t,n){if("easy stableDiffusion3API"==t.name){const t=e.prototype.onNodeCreated;e.prototype.onNodeCreated=async function(){var e,n,o;t&&(null==t||t.apply(this,arguments));const i=this.widgets.find((e=>["seed_num","seed"].includes(e.name))),r=this.widgets.find((e=>["control_before_generate","control_after_generate"].includes(e.name)));let s=this.widgets.find((e=>"model"==e.name));s.callback=e=>{a.value="-"+Ph[e]};const a=this.addWidget("text","cost_credit","0",(e=>{}),{serialize:!1});a.disabled=!0,setTimeout((e=>{"control_before_generate"==r.name&&0===i.value&&(i.value=Math.floor(4294967294*Math.random())),a.value="-"+Ph[s.value]}),100);let l=_("div.easyuse-account-user",[V("Loading UserInfo...")]);this.addDOMWidget("account","btn",_("div.easyuse-account",l)),b.addEventListener("stable-diffusion-api-generate-succeed",(async({detail:e})=>{var t;let n=l.querySelectorAll(".remark");if(n&&n[0]){const t=(null==e?void 0:e.model)?Ph[e.model]:0;if(t){let e=function(e,t){let n,o,i,r,s,a;s="string"==typeof e?e:e.toString(),a="string"==typeof t?t:t.toString();try{n=s.split(".")[1].length}catch(l){n=0}try{o=a.split(".")[1].length}catch(l){o=0}return i=Math.pow(10,Math.max(n,o)),r=n>=o?n:o,((e*i-t*i)/i).toFixed(r)}(parseFloat(n[0].innerText.replace(/Credits: /g,"")),t);e>0&&(n[0].innerText="Credits: "+e.toString())}}await W(1e4);const o=await b.fetchApi("/easyuse/stability/balance");if(200==o.status){const e=await o.json();if(null==e?void 0:e.balance){const o=(null==(t=e.balance)?void 0:t.credits)||0;n&&n[0]&&(n[0].innerText="Credits: "+o)}}}));const c=await b.fetchApi("/easyuse/stability/api_keys");if(200==c.status){let t=await c.json();if(Nh=t.keys,Ih=t.current,Nh.length>0&&void 0!==Ih){const t=Nh[Ih].key,i=Nh[Ih].name;if(t){const t=await b.fetchApi("/easyuse/stability/user_info");if(200==t.status){const i=await t.json();if((null==i?void 0:i.account)&&(null==i?void 0:i.balance)){const t=(null==(e=i.account)?void 0:e.profile_picture)||null,r=(null==(n=i.account)?void 0:n.email)||null,s=(null==(o=i.balance)?void 0:o.credits)||0;l.replaceChildren(_("div.easyuse-account-user-info",{onclick:e=>{(new Dh).show(l)}},[_("div.user",[_("div.avatar",t?[_("img",{src:t})]:"😀"),_("div.info",[_("h5.name",r),_("h6.remark","Credits: "+s)])]),_("div.edit",{textContent:V("Edit")})]))}}}else l.replaceChildren(_("div.easyuse-account-user-info",{onclick:e=>{(new Dh).show(l)}},[_("div.user",[_("div.avatar","😀"),_("div.info",[_("h5.name",i),_("h6.remark",V("Click to set the APIKEY first"))])]),_("div.edit",{textContent:V("Edit")})]))}}}}}});let jh=null;function Mh(){jh&&(jh.removeEventListeners(),jh.dropdown.remove(),jh=null)}function Rh(e,t,n,o=!1){Mh(),new $h(e,t,n,o)}class $h{constructor(e,t,n,o=!1){this.dropdown=document.createElement("ul"),this.dropdown.setAttribute("role","listbox"),this.dropdown.classList.add("easy-dropdown"),this.selectedIndex=-1,this.inputEl=e,this.suggestions=t,this.onSelect=n,this.isDict=o,this.focusedDropdown=this.dropdown,this.buildDropdown(),this.onKeyDownBound=this.onKeyDown.bind(this),this.onWheelBound=this.onWheel.bind(this),this.onClickBound=this.onClick.bind(this),this.addEventListeners()}buildDropdown(){this.isDict?this.buildNestedDropdown(this.suggestions,this.dropdown):this.suggestions.forEach(((e,t)=>{this.addListItem(e,t,this.dropdown)}));const e=this.inputEl.getBoundingClientRect();this.dropdown.style.top=e.top+e.height-10+"px",this.dropdown.style.left=e.left+"px",document.body.appendChild(this.dropdown),jh=this}buildNestedDropdown(e,t){let n=0;Object.keys(e).forEach((o=>{const i=e[o];if("object"==typeof i&&null!==i){const e=document.createElement("ul");e.setAttribute("role","listbox"),e.classList.add("easy-nested-dropdown");const r=document.createElement("li");r.classList.add("folder"),r.textContent=o,r.appendChild(e),r.addEventListener("mouseover",this.onMouseOver.bind(this,n,t)),t.appendChild(r),this.buildNestedDropdown(i,e),n+=1}else{const e=document.createElement("li");e.classList.add("item"),e.setAttribute("role","option"),e.textContent=o,e.addEventListener("mouseover",this.onMouseOver.bind(this,n,t)),e.addEventListener("mousedown",this.onMouseDown.bind(this,o)),t.appendChild(e),n+=1}}))}addListItem(e,t,n){const o=document.createElement("li");o.setAttribute("role","option"),o.textContent=e,o.addEventListener("mouseover",this.onMouseOver.bind(this,t)),o.addEventListener("mousedown",this.onMouseDown.bind(this,e)),n.appendChild(o)}addEventListeners(){document.addEventListener("keydown",this.onKeyDownBound),this.dropdown.addEventListener("wheel",this.onWheelBound),document.addEventListener("click",this.onClickBound)}removeEventListeners(){document.removeEventListener("keydown",this.onKeyDownBound),this.dropdown.removeEventListener("wheel",this.onWheelBound),document.removeEventListener("click",this.onClickBound)}onMouseOver(e,t){t&&(this.focusedDropdown=t),this.selectedIndex=e,this.updateSelection()}onMouseOut(){this.selectedIndex=-1,this.updateSelection()}onMouseDown(e,t){t.preventDefault(),this.onSelect(e),this.dropdown.remove(),this.removeEventListeners()}onKeyDown(e){const t=Array.from(this.focusedDropdown.children),n=t[this.selectedIndex];if(jh)if(38===e.keyCode)e.preventDefault(),this.selectedIndex=Math.max(0,this.selectedIndex-1),this.updateSelection();else if(40===e.keyCode)e.preventDefault(),this.selectedIndex=Math.min(t.length-1,this.selectedIndex+1),this.updateSelection();else if(39===e.keyCode){if(e.preventDefault(),n&&n.classList.contains("folder")){const e=n.querySelector(".easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=0,this.updateSelection())}}else if(37===e.keyCode&&this.focusedDropdown!==this.dropdown){const e=this.focusedDropdown.closest(".easy-dropdown, .easy-nested-dropdown").parentNode.closest(".easy-dropdown, .easy-nested-dropdown");e&&(this.focusedDropdown=e,this.selectedIndex=Array.from(e.children).indexOf(this.focusedDropdown.parentNode),this.updateSelection())}else if((13===e.keyCode||9===e.keyCode)&&this.selectedIndex>=0){e.preventDefault(),n.classList.contains("item")&&(this.onSelect(t[this.selectedIndex].textContent),this.dropdown.remove(),this.removeEventListeners());const o=n.querySelector(".easy-nested-dropdown");o&&(this.focusedDropdown=o,this.selectedIndex=0,this.updateSelection())}else 27===e.keyCode&&(this.dropdown.remove(),this.removeEventListeners())}onWheel(e){const t=parseInt(this.dropdown.style.top);localStorage.getItem("Comfy.Settings.Comfy.InvertMenuScrolling")?this.dropdown.style.top=t+(e.deltaY<0?10:-10)+"px":this.dropdown.style.top=t+(e.deltaY<0?-10:10)+"px"}onClick(e){this.dropdown.contains(e.target)||e.target===this.inputEl||(this.dropdown.remove(),this.removeEventListeners())}updateSelection(){Array.from(this.focusedDropdown.children).forEach(((e,t)=>{t===this.selectedIndex?e.classList.add("selected"):e.classList.remove("selected")}))}}function Gh(e){const t=e.min||0,n=e.max||0,o=e.step||1;if(0===o)return[];const i=[];let r=t;for(;r<=n;){if(Number.isInteger(o))i.push(Math.round(r)+"; ");else{let e=r.toFixed(3);-0==e&&(e="0.000"),/\.\d{3}$/.test(e)||(e+="0"),i.push(e+"; ")}r+=o}return n>=0&&t>=0?i:i.reverse()}let Bh={},Fh={};function Uh(e,t){String(e.id);const n=t.name,o=t.value.replace(/^(loader|preSampling):\s/,"");Fh[n]?Fh[n]!=Bh[o]&&(Fh[n]=Bh[o]):Fh={...Fh,[n]:Bh[o]}}y.registerExtension({name:"Comfy.EasyUse.XYPlot",async beforeRegisterNodeDef(e,t,n){if("easy XYPlot"===t.name){Bh=t.input.hidden.plot_dict[0];for(const e in Bh){const t=Bh[e];if(Array.isArray(t)){let n=[];for(const e of t)n.push(e+"; ");Bh[e]=n}else Bh[e]="object"==typeof t?"seed"==e?t+"; ":Gh(t):t+"; "}Bh.None=[],Bh["---------------------"]=[]}},nodeCreated(e){"easy XYPlot"===e.comfyClass&&(function(e){if(e.widgets)for(const t of e.widgets)if("x_axis"===t.name||"y_axis"===t.name){let n=t.value;Object.defineProperty(t,"value",{get:()=>n,set(o){o!==n&&(n=o,Uh(e,t))}})}}(e),function(e){if(e.widgets){const t=e.widgets.filter((e=>"customtext"===e.type&&!1!==e.dynamicPrompts||e.dynamicPrompts));for(const e of t){let t=function(e,t,o,i){return e&&(t[o]=e),t.map((e=>n(e,i))).filter((e=>""!==e)).join("")},n=function(e,t){if(e=o(e),i(e,t))return e+"; ";let n=r(e,t);return 1===n.length||2===n.length?n[0]:i(s(e),t)?s(e)+"; ":""},o=function(e){return e.replace(/(\n|;| )/g,"")},i=function(e,t){return t.includes(e+"; ")},r=function(e,t){return t.filter((t=>t.toLowerCase().includes(e.toLowerCase())))},s=function(e){return Number(e)?Number(e).toFixed(3):["0","0.","0.0","0.00","00"].includes(e)?"0.000":e};const a=function(){const n=e.name[0]+"_axis";let o=(null==Fh?void 0:Fh[n])||[];if(0===o.length)return;const i=e.inputEl.value,r=e.inputEl.selectionStart;let s=i.split("; ");const a=i.substring(0,r).split("; ").length-1,l=s[a].replace(/\n/g,"").toLowerCase(),c=o.filter((e=>e.toLowerCase().includes(l))).map((e=>e.replace(/; /g,"")));if(c.length>0)Rh(e.inputEl,c,(n=>{const i=t(n,s,a,o);e.inputEl.value=i}));else{Mh();const n=t(null,s,a,o);e.inputEl.value=n}};e.inputEl.removeEventListener("input",a),e.inputEl.addEventListener("input",a),e.inputEl.removeEventListener("mouseup",a),e.inputEl.addEventListener("mouseup",a)}}}(e))}});const zh=_s("graphStore",{state:e=>({selectors:[],selectors_styles:{},seg_selectors:[],slider_controls:[]}),actions:{setSelectors(e){this.selectors=tp(e)},setStyles(e,t){this.selectors_styles[e]||(this.selectors_styles[e]=t)},setSegSelectors(e){this.seg_selectors=tp(e)},setSliderControls(e){this.slider_controls=tp(e)}}}),Vh=["data-id"],Hh=[Zi("i",{class:"mdi mdi-trash-can"},null,-1)],Wh=Zi("i",{class:"mdi mdi-magnify"},null,-1),Yh=["placeholder"],Zh=["onMouseenter","onMouseleave"],Kh=["onClick"],Xh=["name","checked"],Qh=["src"],Jh={key:0},qh=Zi("span",{class:"comfyui-easyuse-success"},"positive:",-1),em={key:1},tm=Zi("span",{class:"comfyui-easyuse-error"},"negative:",-1),nm="comfyui-easyuse-selector",om={__name:"stylesSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selectedStyles:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["chooseStyle"],setup(e,{emit:t}){const n=e,o=zh(),{selectors_styles:i}=ws(o),r=pn([]);bi((e=>n.type),(async e=>{r.value=[],e&&await(async e=>{if(i.value[n.type])return!0;const t=await b.fetchApi(`/easyuse/prompt/styles?name=${e}`);if(200===t.status){let e=(await t.json()).map(((e,t)=>(e.index=t,e)));return await o.setStyles(n.type,e),!0}return Fp.error(V("Get styles list Failed")),!1})(e)&&a()}),{immediate:!0});const s=t,a=e=>{const t=n.selectedStyles,o=tp(i.value[n.type]);r.value=o.sort(((e,t)=>e.index-t.index)).sort(((e,n)=>t.includes(n.name)-t.includes(e.name)))},l=pn(""),c=e=>e.toLowerCase(),u=Xt({}),d=e=>{u.src="",u.name="",u.positive="",u.negative=""},p=async e=>{const t=await b.fetchApi(`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`);if(200===t.status){const o=await t.text();if(o.startsWith("http"))return o;return`/easyuse/prompt/styles/image?name=${e}&styles_name=${n.type}`}},f=e=>{e.target.src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QNLaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuMSAoMjAyMzA5MDUubS4yMzE2IDk3OWM4NmQpICAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjA3NEU1QzNCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjA3NEU1QzRCNUJBMTFFRUExMUVDNkZDRjI0NzlBN0QiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGMDc0RTVDMUI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGMDc0RTVDMkI1QkExMUVFQTExRUM2RkNGMjQ3OUE3RCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHB8fHx8fHx8fHx8BBwcHDQwNGBAQGBoVERUaHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fH//AABEIAIAAgAMBEQACEQEDEQH/xACLAAEAAgMBAQEAAAAAAAAAAAAABAUCAwYBBwgBAQADAQEBAAAAAAAAAAAAAAABAgMEBQYQAAEEAgECAwUHAwUAAAAAAAEAAgMEEQUhEgYxEwdBYSIyFFFxgVJyIxWRoTOxwdFiJBEBAAICAQQBBAIDAAAAAAAAAAECEQMxIUESBBOB0SIyUXGCIwX/2gAMAwEAAhEDEQA/AP1SgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDXJYgj+d4afsVopM8KWvEcy8it1pXdMcjXO/Lnn+im2u0cwV2VniW1UXEBAQEBAQEBAQEBAQRNlc+mgyDh7zhv+5WunX5Sw37fCHM2dh48r06ank7N6rn2Ja7qa4hw5BBwQV010uK+/DsO29v/J68SOI86Jxjl95HIP4gryPc0fHfHaXu+j7Py68zzHSVquV2iAgICAgICAgICDyTr6HdHz4PTnwypjnqic46OauNbY6mGX99p+L8w9xaeV6OufHt0eXtr59M9VFb194E9LmuH3kf6rv17avO2ets7YVcuuuk/uOa3PgBlxP4BdMbq9nLPqbJ5xDbSM9azFXpyujuSO+Bo5kcf0NPyj25We2YtEzaPxdfr6519Kz+UvqEIlELBKQZQ0eYRwC7HOPxXzVsZ6cPpK5x15ZKEiAgICAgICAgICCNc1tG40CzA2XHg4j4h9zhyFpr22p+s4Z7NNL/ALRlTX+1dVFBJOJrcTI2lxZHYcBx+sldWv3bzOMVn6fZy39OkRnNo+v3aoOx9JOxks8tqwHDPS+1IW8+IzGWZVrf9DZHSMR/j9yvo656zMz9V1rdLqdYwsoVIqwd87mNAc79Tvmd+JXJt332ftMy6temlP1jCasmggICAgICAgICAgwlmiib1SPDB7zhWrWZ4VtaI5QXb2l5ojYHvLjjIGB/dbR61sZlhPtVziFb3PYdd0luCvAZbXludVZ1huZQPgyTx4/atvWj4rxaZ6d/6Ye1/t1zSI6zx/bzti5YqaOpBeg8u41n/oa14cA4ccH7lPs1jZebVn8eyPUtOrXFbR+XdYx9xa90pjeXROaSCXDj+oysZ9S+Mx1bR7uvOJ6LGOWKVgfG8PafAtOQueazHLqraJjMMlCRAQEBAQEBAQRLNp4HTFx/2/4WtKR3Y32T2Udl8j3knk/aeSu6kREPPvaZlpY3DmyY8DyrzPZWv8tkvmFv7bg12RyR1DGeeMj2KnjE9JaeUx1hi1sgaet/U7JIOMcE8Dj7FMREcK2zPKMasr5XO6fmOVt5xEOadVplYU45IAOhxa72kLm2TFuXXqrNeF1WtlwDZeHfmHguO+vHDupszylLJsICAgICAg8cMjCQiYR5IVpFmc1Q5qLXHPgfbhbV2MLaYlqNQAYA4V/kV+PDA1fcp81fjYurtYMu4CmLZRNYhtZWBAI8CqzdaKN8df3LObtIokxwe5ZzZrFUloIGFnLWHqhIgICAgICAgxMbSpyjDAwAq3kr4MTWCnzR4MX02PGHDISNmETqieWba7QABwB4KJumKNgjaFXK0VZYChYQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEHzvuv1G7k1W9s6/Xamtaq15oaonmnsCR008HntaI4K8/s4HOeEGXZXqTud7uqtG7r6kNa5HdMU9aaw9zZde+FkrHsnr1+M2MZBPIKDRe9cO2K2mjs/V0m7X61lWzq32W+ZFEbfkSSO4B+GL9zw4QWm99TqFVmjsaSu7fUtxeNM2aTmSMBbHI9zWHqHVJlnDTxjPKCJL6sea502t1D7Ouhr0rNqxNM2CSNuwnkgjAi6ZOotdEc/Egibf1j/j+7JNL9DWdWg84TWn2ywtdFKyMZb5Tg0nLyG55x48IJ3bXqe/ea/a26dFtyTXtldDUqyOdNL5VqaDHS5gwXRxMe3xz1Y9iDKP1Sa7uefUnR7TyYqUVoEU5jY6pJZIz1RY4ZiMYd7TkexBA749Wr2gtCKlrIpGs17NjK29LLWmPmMsyiFkbIZsPEdKQu6y0eAQWdD1E2L93W1tzRyCDY3paev2NaxVlhIjidMfMb5vmse1kbi9pZ7MeKDt0BAQEBAQfEPU+lFY2++q2K1uSSezTnrReVsTTmiZVYHOd9LVuQyubIwANkbxz4FA7FsQ0NrrLNXX7N0eo1+3darGDYPjb5j6prxVRajjDetsRAjj4yM4CDre2uxO7q2hqtm7nua6w9rp5tfXgoSxwyTOMr42PlrPe4Nc8jJJQRDb3Oz1fYFrcV7As0mu3u7nbWkBZ9LSfG5nlxs/yySWRiNozwcBBx9EXadGTXz62+LG41+jZS6adhzS6vfnlkEjgzEZax7T8ePFBu3nbPdUXqJZsw6S5cqbCW1YdIY2lxhhfEGMjfHtoG9HxucwPEZy4/A7kMC87aq2Kmv7mdvxuqGmklFjUU4G2Yp21rdyW00t+kJkFl88pY9vDgwNDvEoK9np73FBcHdkrt2+rZd5FjQx7O0b8WvbzDKZhN1SSse573QdeAHkN+Ichj3p2rBvZq9vUnY2tcNQPqpZYZpJ44GxXqzHdVlzZZpib73mLHViI85c1BZ6OpsIe/6/XSuntevdsz6+8+pI0/yM1dtWVr2Z644P8rmyuj6S53jxkh9aQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBB/9k="};return(t,o)=>($i(),Ui("div",{class:Me(nm+` ${nm}-styles`),"data-id":e.id,onMouseleave:d},[r.value.length>0&&e.show?($i(),Ui(Ii,{key:0},[Zi("div",{class:Me(nm+"__header")},[Zi("div",{class:Me(nm+"__header_button"),onClick:o[0]||(o[0]=e=>(s("chooseStyle",[]),void(l.value="")))},Hh,2),Zi("div",{class:Me(nm+"__header_search")},[Wh,Hn(Zi("textarea",{class:"search","onUpdate:modelValue":o[1]||(o[1]=e=>l.value=e),dir:"ltr",rows:1,placeholder:hn(V)("Type here to search styles ...")},null,8,Yh),[[Zr,l.value]])],2)],2),Zi("div",{class:Me(nm+"__content"),onMouseleave:a},[($i(!0),Ui(Ii,null,bo(r.value,((t,o)=>($i(),Ui("div",{class:Me(nm+"-item"),key:o,onMouseenter:e=>(async e=>{if(!e.imageSrc){if(e.imageLoading)return;e.imageLoading=!0;const t=await p(e.imgName).finally((()=>e.imageLoading=!1));e.imageSrc=t}u.name="zh-CN"==z&&e.name_cn?e.name_cn:e.name,u.positive=e.prompt,u.negative=e.negative_prompt,u.src=e.imageSrc})(t),onMouseleave:Qr((e=>d()),["stop"])},[Zi("span",{class:Me([nm+"-item__tag",{hide:!(e.selectedStyles.includes(t.name)||-1!=c(t.name).indexOf(c(l.value))||t.name_cn&&-1!=c(t.name_cn).indexOf(c(l.value)))}]),onClick:e=>(e=>{let t=n.selectedStyles;t.includes(e.name)?t=t.filter((t=>t!==e.name)):t.push(e.name),s("chooseStyle",t)})(t)},[Zi("input",{type:"checkbox",name:t.name,checked:e.selectedStyles.includes(t.name)},null,8,Xh),Zi("span",null,Be("zh-CN"==hn(z)&&t.name_cn?t.name_cn:t.name),1)],10,Kh)],42,Zh)))),128))],34),(null==u?void 0:u.src)?($i(),Ui("div",{key:0,class:Me(nm+"-preview")},[Zi("img",{src:u.src,ref:"image",alt:"preview",onError:f},null,40,Qh),Zi("div",{class:Me(nm+"-preview__text")},[Zi("b",null,Be(u.name),1),Zi("div",{class:Me(nm+"-preview__prompt")},[u.positive?($i(),Ui("h6",Jh,[qh,Zi("span",null,Be(u.positive),1)])):Ji("",!0),u.negative?($i(),Ui("h6",em,[tm,Zi("span",null,Be(u.negative),1)])):Ji("",!0)],2)],2)],2)):Ji("",!0)],64)):Ji("",!0)],42,Vh))}},im=["data-id"],rm=["onClick"],sm=["name","checked"],am="comfyui-easyuse-selector",lm={__name:"segSelector",props:{id:{type:String|Number,default:""},type:{type:String,default:""},selected:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:t}){const n=e,o=pn([]);bi((e=>n.type),(async e=>{switch(e){case"selfie_multiclass_256x256":o.value=["Background","Hair","Body","Face","Clothes","Others"];break;case"human_parsing_lip":o.value=["Background","Hat","Hair","Glove","Sunglasses","Upper-clothes","Dress","Coat","Socks","Pants","Jumpsuits","Scarf","Skirt","Face","Left-arm","Right-arm","Left-leg","Right-leg","Left-shoe","Right-shoe"]}}),{immediate:!0});const i=t;return(t,r)=>{var s;return $i(),Ui("div",{class:Me(am+` ${am}-seg`),"data-id":e.id},[(null==(s=o.value)?void 0:s.length)>0&&e.show?($i(!0),Ui(Ii,{key:0},bo(o.value,((t,o)=>($i(),Ui("div",{class:Me(am+"-item"),key:o},[Zi("span",{class:Me(am+"-item__tag"),onClick:e=>(e=>{let t=tp(n.selected);t.includes(e)?t=t.filter((t=>t!==e)):t.push(e),i("select",t)})(t)},[Zi("input",{type:"checkbox",name:t,checked:e.selected.includes(t)},null,8,sm),Zi("span",null,Be(hn(V)(t)),1)],10,rm)],2)))),128)):Ji("",!0)],10,im)}}},cm=["data-id"],um=["onMousedown","onDblclick"],dm="comfyui-easyuse-slider",pm="ipadapter layer weights",fm={__name:"sliderControl",props:{id:{type:String|Number,default:""},mode:{type:String,default:""},type:{type:String,default:""},values:{type:Array,default:[]},show:{type:Boolean,default:!1}},emits:["changeValues","showSlider"],setup(e,{emit:t}){const n=e,o=t,i=(e,t,n)=>(e-t)/(n-t)*100,r=(e,t,o=void 0)=>{if(n.mode===pm){let n={3:2.5,6:1}[t]||0;return{default:12==e?n:0,min:-1,max:3,step:.05,value:void 0!==o?o:12==e?n:0,top:void 0!==o?100-i(o,-1,3)+"%":null,height:void 0!==o?i(o,-1,3)+"%":null}}};bi((e=>n.mode),(async(e,t)=>{var i;if(e!==t&&e===pm)if(!t&&(null==(i=n.values)?void 0:i.length)>0){const e=n.values.map((e=>{const t=e.split(":");return r(n.values.length,t[0],parseFloat(t[1]))}));await o("changeValues",e)}else{let e="sd1"==n.type?16:12,t=Array.from({length:e},((t,n)=>r(e,n)));await o("changeValues",t)}o("showSlider")}),{immediate:!0}),bi((e=>n.type),((e,t)=>{if(e!=t&&n.mode==pm){let e="sd1"==n.type?16:12,t=Array.from({length:e},((t,n)=>r(e,n)));o("changeValues",t)}}));const s=pn(null),a=pn(null);return oo((()=>{document.onmouseup=e=>document.onmousemove=null})),(t,r)=>{var l;return $i(),Ui("div",{class:Me(dm),"data-id":e.id},[(null==(l=e.values)?void 0:l.length)>0&&e.show?($i(!0),Ui(Ii,{key:0},bo(e.values,((t,r)=>($i(),Ui("div",{class:Me([dm+"-item",{positive:3==r&&"sdxl"==e.type&&e.mode==pm},{negative:6==r&&"sdxl"==e.type&&e.mode==pm}]),key:r},[Zi("div",{class:Me(dm+"-item-input")},Be(t.value),3),Zi("div",{class:Me(dm+"-item-scroll"),ref_for:!0,ref_key:"scroll",ref:s},[Zi("div",{class:Me(dm+"-item-bar"),ref_for:!0,ref_key:"bar",ref:a,style:Ne({top:t.top||100-i(t.default,t.min,t.max)+"%"}),onMousedown:e=>((e,t,i)=>{let r=e||window.event,l=s.value[i],c=a.value[i],u=tp(n.values),d=r.clientY-c.offsetTop;document.onmousemove=e=>{let n=(e||window.event).clientY-d;n<0?n=0:n>l.offsetHeight-c.offsetHeight&&(n=l.offsetHeight-c.offsetHeight);let r=(t.max-t.min)/t.step,s=(l.offsetHeight-c.offsetHeight)/r;n=Math.round(n/s)*s;const a=Math.floor(n/(l.offsetHeight-c.offsetHeight)*100)+"%",p=Math.floor((l.offsetHeight-c.offsetHeight-n)/(l.offsetHeight-c.offsetHeight)*100)+"%",f=parseFloat(parseFloat(t.max-(t.max-t.min)*(n/(l.offsetHeight-c.offsetHeight))).toFixed(2));u[i]={...u[i],top:a,height:p,value:f},o("changeValues",u),window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}})(e,t,r),onDblclick:e=>((e,t,i)=>{let r=tp(n.values);r[i]={...r[i],top:null,height:null,value:t.default},o("changeValues",r)})(0,t,r)},null,46,um),Zi("div",{class:Me(dm+"-item-area"),style:Ne({height:t.height||i(t.default,t.min,t.max)+"%"})},null,6)],2),Zi("div",{class:Me(dm+"-item-label")},[Zi("span",null,Be(t.label),1)],2)],2)))),128)):Ji("",!0)],8,cm)}}},hm={__name:"index",setup(e){const t=zh(),{selectors:n,seg_selectors:o,slider_controls:i}=ws(t),r=pn({}),s=async e=>{var o,i,s,a,l,c;await W(1);const u=wp(e,"styles"),d=(null==(o=e.properties.values)?void 0:o.length)>0?e.properties.values:[];let p=tp(n.value);p.push({id:e.id,type:u.value,value:d,show:!1});const f=p.length-1;await t.setSelectors(p);let h=null==(a=null==(s=null==(i=r.value[e.id])?void 0:i._)?void 0:s.vnode)?void 0:a.el;if(!h)return;let m=e.addDOMWidget("select_styles","btn",h);e.properties.values||e.setProperty("values",[]),p[f].show=!0,await t.setSelectors(p);let g=u.value;Object.defineProperty(u,"value",{set:n=>{g=n,p[f].type=n,e.properties.values=[],p[f].value=[],t.setSelectors(p)},get:e=>g}),Object.defineProperty(m,"value",{set:e=>{setTimeout((n=>{p[f].value=e.split(","),t.setSelectors(p)}),150)},get:t=>{var o,i;return e.properties.values=(null==(i=null==(o=n.value)?void 0:o[f])?void 0:i.value)||[],e.properties.values.join(",")}}),((null==(l=e.size)?void 0:l[0])<150||(null==(c=e.size)?void 0:c[1])<150)&&e.setSize([425,500]);const v=e.onRemoved;e.onRemoved=function(){if(v&&(null==v||v.apply(this,arguments)),void 0!==n.value.findIndex((t=>t.id==e.id))){let e=tp(n.value);e.splice(f,1),t.setSelectors(e)}return v}},a=pn({}),l=async e=>{var n,i,r,s;await W(1);const l=wp(e,"method"),c=(null==(n=e.properties.values)?void 0:n.length)>0?e.properties.values:[];let u=tp(o.value);u.push({id:e.id,type:l.value,value:c,show:!1});const d=u.length-1;await t.setSegSelectors(u);let p=null==(s=null==(r=null==(i=a.value[e.id])?void 0:i._)?void 0:r.vnode)?void 0:s.el;if(!p)return;let f=e.addDOMWidget("mask_components","btn",p);e.properties.values||e.setProperty("values",[]),u[d].show=!0,await t.setSegSelectors(u);let h=l.value;Object.defineProperty(l,"value",{set:n=>{h=n,u[d].type=n,e.properties.values=[],u[d].value=[],Sp(e,wp(e,"confidence"),"selfie_multiclass_256x256"===h),e.setSize([300,"selfie_multiclass_256x256"===h?260:500]),t.setSegSelectors(u)},get:e=>h}),Object.defineProperty(f,"value",{set:e=>{setTimeout((n=>{u[d].value=e.split(","),t.setSegSelectors(u)}),150)},get:t=>{var n;return e.properties.values=(null==(n=o.value)?void 0:n[d].value)||[],e.properties.values.join(",")}}),Sp(e,wp(e,"confidence"),"selfie_multiclass_256x256"===h),e.setSize([300,"selfie_multiclass_256x256"===h?260:500]);const m=e.onRemoved;e.onRemoved=function(){if(m&&(null==m||m.apply(this,arguments)),void 0!==o.value.findIndex((t=>t.id==e.id))){let e=tp(o.value);e.splice(d,1),t.setSegSelectors(e)}return m}},c=pn({}),u=async e=>{var n,o,r,s;await W(1);const a=wp(e,"mode"),l=wp(e,"model_type"),u=(null==(n=e.properties.values)?void 0:n.length)>0?e.properties.values:[];let d=tp(i.value);d.push({id:e.id,type:l.value,mode:a.value,value:u,show:!1});const p=d.length-1;await t.setSliderControls(d);let f=null==(s=null==(r=null==(o=c.value[e.id])?void 0:o._)?void 0:r.vnode)?void 0:s.el;if(!f)return;let h=e.addDOMWidget("values","btn",f);e.properties.values||e.setProperty("values",[]),Object.defineProperty(h,"value",{set:function(){},get:t=>{var n;const o=(null==(n=i.value)?void 0:n[p].value)||[];return e.properties.values=o.map(((e,t)=>`${t}:${e.value}`)),e.properties.values.join(",")}}),e.setSize("sdxl"==l.value?[375,320]:[455,320]),l.callback=n=>{d=tp(i.value),d[p].type!=n&&(e.setSize("sdxl"==n?[375,320]:[455,320]),d[p].value=[],d[p].type=n,t.setSliderControls(d))};const m=e.onRemoved;e.onRemoved=function(){if(m&&(null==m||m.apply(this,arguments)),void 0!==i.value.findIndex((t=>t.id==e.id))){let e=tp(i.value);e.splice(p,1),t.setSliderControls(e)}return m}};return oo((e=>{y.registerExtension({name:"Comfy.EasyUse.Components",async beforeRegisterNodeDef(e,t){const n=e.prototype.onNodeCreated;"easy stylesSelector"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await s(this),n}),"easy humanSegmentation"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await l(this),n}),"easy sliderControl"==t.name&&(e.prototype.onNodeCreated=async function(){return n&&(null==n||n.apply(this,arguments)),await u(this),n}),"easy poseEditor"==t.name&&(e.prototype.onNodeCreated=async function(){n&&(null==n||n.apply(this,arguments));const e=document.createElement("div");return e.className="comfyui-easyuse-poseEditor",e.innerHTML='
This node is about to be removed, you can use ComfyUI_Custom_Nodes_AlekPet to replace it.
',this.addDOMWidget("editor","btn",e),n})}})})),(e,s)=>($i(),Ui(Ii,null,[($i(!0),Ui(Ii,null,bo(hn(n),((e,o)=>($i(),zi(om,{ref_for:!0,ref:t=>{t&&(r.value[e.id]=t)},type:e.type,key:o,id:e.id,show:e.show,selectedStyles:e.value,onChooseStyle:e=>((e,o)=>{let i=tp(n.value);i[o].value=e,t.setSelectors(i)})(e,o)},null,8,["type","id","show","selectedStyles","onChooseStyle"])))),128)),($i(!0),Ui(Ii,null,bo(hn(o),((e,n)=>($i(),zi(lm,{ref_for:!0,ref:t=>{t&&(a.value[e.id]=t)},type:e.type,key:n,id:e.id,show:e.show,selected:e.value,onSelect:e=>((e,n)=>{let i=tp(o.value);i[n].value=e,t.setSegSelectors(i)})(e,n)},null,8,["type","id","show","selected","onSelect"])))),128)),($i(!0),Ui(Ii,null,bo(hn(i),((e,n)=>($i(),zi(fm,{ref_for:!0,ref:t=>{t&&(c.value[e.id]=t)},type:e.type,key:n,id:e.id,show:e.show,mode:e.mode,values:e.value,onChangeValues:e=>((e,n)=>{let o=tp(i.value);o[n].value=e,t.setSliderControls(o)})(e,n),onShowSlider:e=>(e=>{let n=tp(i.value);n[e].show=!0,t.setSliderControls(n)})(n)},null,8,["type","id","show","mode","values","onChangeValues","onShowSlider"])))),128))],64))}};var mm=Object.defineProperty,gm=Object.getOwnPropertySymbols,vm=Object.prototype.hasOwnProperty,ym=Object.prototype.propertyIsEnumerable,bm=(e,t,n)=>t in e?mm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function _m(e){return null==e||""===e||Array.isArray(e)&&0===e.length||!(e instanceof Date)&&"object"==typeof e&&0===Object.keys(e).length}function wm(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Sm(e){return!_m(e)}function xm(e,t=!0){return e instanceof Object&&e.constructor===Object&&(t||0!==Object.keys(e).length)}function km(e,...t){return wm(e)?e(...t):e}function Cm(e,t=!0){return"string"==typeof e&&(t||""!==e)}function Am(e){return Cm(e)?e.replace(/(-|_)/g,"").toLowerCase():e}function Em(e,t="",n={}){const o=Am(t).split("."),i=o.shift();return i?xm(e)?Em(km(e[Object.keys(e).find((e=>Am(e)===i))||""],n),o.join("."),n):void 0:km(e,n)}function Om(e,t=!0){return Array.isArray(e)&&(t||0!==e.length)}function Lm(e){return Sm(e)&&!isNaN(e)}function Tm(e,t){if(t){const n=t.test(e);return t.lastIndex=0,n}return!1}function Nm(...e){const t=(e={},n={})=>{const o=((e,t)=>{for(var n in t||(t={}))vm.call(t,n)&&bm(e,n,t[n]);if(gm)for(var n of gm(t))ym.call(t,n)&&bm(e,n,t[n]);return e})({},e);return Object.keys(n).forEach((i=>{xm(n[i])&&i in e&&xm(e[i])?o[i]=t(e[i],n[i]):o[i]=n[i]})),o};return e.reduce(((e,n,o)=>0===o?n:t(e,n)),{})}function Im(e){return e?e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":"):e}function Pm(e){return Cm(e)?e.replace(/(_)/g,"-").replace(/[A-Z]/g,((e,t)=>0===t?e:"-"+e.toLowerCase())).toLowerCase():e}function Dm(e){return Cm(e)?e.replace(/[A-Z]/g,((e,t)=>0===t?e:"."+e.toLowerCase())).toLowerCase():e}function jm(){const e=new Map;return{on(t,n){let o=e.get(t);return o?o.push(n):o=[n],e.set(t,o),this},off(t,n){let o=e.get(t);return o&&o.splice(o.indexOf(n)>>>0,1),this},emit(t,n){let o=e.get(t);o&&o.slice().map((e=>{e(n)}))},clear(){e.clear()}}}var Mm=Object.defineProperty,Rm=Object.defineProperties,$m=Object.getOwnPropertyDescriptors,Gm=Object.getOwnPropertySymbols,Bm=Object.prototype.hasOwnProperty,Fm=Object.prototype.propertyIsEnumerable,Um=(e,t,n)=>t in e?Mm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zm=(e,t)=>{for(var n in t||(t={}))Bm.call(t,n)&&Um(e,n,t[n]);if(Gm)for(var n of Gm(t))Fm.call(t,n)&&Um(e,n,t[n]);return e},Vm=(e,t)=>Rm(e,$m(t)),Hm=(e,t)=>{var n={};for(var o in e)Bm.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&Gm)for(var o of Gm(e))t.indexOf(o)<0&&Fm.call(e,o)&&(n[o]=e[o]);return n},Wm=jm();function Ym(e,t){Om(e)?e.push(...t||[]):xm(e)&&Object.assign(e,t)}function Zm(e,t=""){if(!["opacity","z-index","line-height","font-weight","flex","flex-grow","flex-shrink","order"].some((e=>t.endsWith(e)))){return`${e}`.trim().split(" ").map((e=>Lm(e)?`${e}px`:e)).join(" ")}return e}function Km(e="",t=""){return function(e){return e.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}(`${Cm(e,!1)&&Cm(t,!1)?`${e}-`:e}${t}`)}function Xm(e="",t=""){return`--${Km(e,t)}`}function Qm(e,t="",n="",o=[],i){if(Cm(e)){const r=/{([^}]*)}/g,s=e.trim();if(Tm(s,r)){const e=s.replaceAll(r,(e=>{const t=e.replace(/{|}/g,"").split(".").filter((e=>!o.some((t=>Tm(e,t)))));return`var(${Xm(n,Pm(t.join("-")))}${Sm(i)?`, ${i}`:""})`})),t=/(\d+\s+[\+\-\*\/]\s+\d+)/g,a=/var\([^)]+\)/g;return Tm(e.replace(a,"0"),t)?`calc(${e})`:e}return Zm(s,t)}if(Lm(e))return Zm(e,t)}function Jm(e,t){return e?`${e}{${t}}`:""}var qm=(...e)=>eg(og.getTheme(),...e),eg=(e={},t,n,o="variable")=>{if(t){const{variable:i,options:r}=og.defaults||{},{prefix:s,transform:a}=(null==e?void 0:e.options)||r||{},l=Tm(t,/{([^}]*)}/g)?t:`{${t}}`;return"value"===o||"strict"===a?og.getTokenValue(t):Qm(l,void 0,s,[i.excludedKeyRegex],n)}return""};function tg(e,t={}){const n=og.defaults.variable,{prefix:o=n.prefix,selector:i=n.selector,excludedKeyRegex:r=n.excludedKeyRegex}=t,s=(e,t="")=>Object.entries(e).reduce(((e,[n,i])=>{const a=Tm(n,r)?Km(t):Km(t,Pm(n)),l=function(e){return xm(e)&&e.hasOwnProperty("value")&&e.hasOwnProperty("type")?e.value:e}(i);if(xm(l)){const{variables:t,tokens:n}=s(l,a);Ym(e.tokens,n),Ym(e.variables,t)}else e.tokens.push((o?a.replace(`${o}-`,""):a).replaceAll("-",".")),function(e,t,n){Cm(t,!1)&&e.push(`${t}:${n};`)}(e.variables,Xm(a),Qm(l,a,o,[r]));return e}),{variables:[],tokens:[]}),{variables:a,tokens:l}=s(e,o);return{value:a,tokens:l,declarations:a.join(""),css:Jm(i,a.join(""))}}var ng={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(e){return{type:"class",selector:e,matched:this.pattern.test(e.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(e){return{type:"attr",selector:`:root${e}`,matched:this.pattern.test(e.trim())}}},media:{pattern:/^@media (.*)$/,resolve(e){return{type:"media",selector:`${e}{:root{[CSS]}}`,matched:this.pattern.test(e.trim())}}},system:{pattern:/^system$/,resolve(e){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(e.trim())}}},custom:{resolve:e=>({type:"custom",selector:e,matched:!0})}},resolve(e){const t=Object.keys(this.rules).filter((e=>"custom"!==e)).map((e=>this.rules[e]));return[e].flat().map((e=>{var n;return null!=(n=t.map((t=>t.resolve(e))).find((e=>e.matched)))?n:this.rules.custom.resolve(e)}))}},_toVariables:(e,t)=>tg(e,{prefix:null==t?void 0:t.prefix}),getCommon({name:e="",theme:t={},params:n,set:o,defaults:i}){var r,s,a,l;const{preset:c,options:u}=t;let d,p,f,h;if(Sm(c)){const{primitive:t,semantic:n}=c,m=n||{},{colorScheme:g}=m,v=Hm(m,["colorScheme"]),y=g||{},{dark:b}=y,_=Hm(y,["dark"]),w=Sm(t)?this._toVariables({primitive:t},u):{},S=Sm(v)?this._toVariables({semantic:v},u):{},x=Sm(_)?this._toVariables({light:_},u):{},k=Sm(b)?this._toVariables({dark:b},u):{},[C,A]=[null!=(r=w.declarations)?r:"",w.tokens],[E,O]=[null!=(s=S.declarations)?s:"",S.tokens||[]],[L,T]=[null!=(a=x.declarations)?a:"",x.tokens||[]],[N,I]=[null!=(l=k.declarations)?l:"",k.tokens||[]];d=this.transformCSS(e,C,"light","variable",u,o,i),p=A;f=`${this.transformCSS(e,`${E}${L}color-scheme:light`,"light","variable",u,o,i)}${this.transformCSS(e,`${N}color-scheme:dark`,"dark","variable",u,o,i)}`,h=[...new Set([...O,...T,...I])]}return{primitive:{css:d,tokens:p},semantic:{css:f,tokens:h}}},getPreset({name:e="",preset:t={},options:n,params:o,set:i,defaults:r,selector:s}){var a,l,c;const u=e.replace("-directive",""),d=t,{colorScheme:p}=d,f=Hm(d,["colorScheme"]),h=p||{},{dark:m}=h,g=Hm(h,["dark"]),v=Sm(f)?this._toVariables({[u]:f},n):{},y=Sm(g)?this._toVariables({[u]:g},n):{},b=Sm(m)?this._toVariables({[u]:m},n):{},[_,w]=[null!=(a=v.declarations)?a:"",v.tokens||[]],[S,x]=[null!=(l=y.declarations)?l:"",y.tokens||[]],[k,C]=[null!=(c=b.declarations)?c:"",b.tokens||[]],A=[...new Set([...w,...x,...C])];return{css:`${this.transformCSS(u,`${_}${S}`,"light","variable",n,i,r,s)}${this.transformCSS(u,k,"dark","variable",n,i,r,s)}`,tokens:A}},getPresetC({name:e="",theme:t={},params:n,set:o,defaults:i}){var r;const{preset:s,options:a}=t,l=null==(r=null==s?void 0:s.components)?void 0:r[e];return this.getPreset({name:e,preset:l,options:a,params:n,set:o,defaults:i})},getPresetD({name:e="",theme:t={},params:n,set:o,defaults:i}){var r;const s=e.replace("-directive",""),{preset:a,options:l}=t,c=null==(r=null==a?void 0:a.directives)?void 0:r[s];return this.getPreset({name:s,preset:c,options:l,params:n,set:o,defaults:i})},getColorSchemeOption(e,t){var n;return this.regex.resolve(null!=(n=e.darkModeSelector)?n:t.options.darkModeSelector)},getLayerOrder(e,t={},n,o){const{cssLayer:i}=t;if(i){return`@layer ${km(i.order||"primeui",n)}`}return""},getCommonStyleSheet({name:e="",theme:t={},params:n,props:o={},set:i,defaults:r}){const s=this.getCommon({name:e,theme:t,params:n,set:i,defaults:r}),a=Object.entries(o).reduce(((e,[t,n])=>e.push(`${t}="${n}"`)&&e),[]).join(" ");return Object.entries(s||{}).reduce(((e,[t,n])=>{if(null==n?void 0:n.css){const o=Im(null==n?void 0:n.css),i=`${t}-variables`;e.push(``)}return e}),[]).join("")},getStyleSheet({name:e="",theme:t={},params:n,props:o={},set:i,defaults:r}){var s;const a={name:e,theme:t,params:n,set:i,defaults:r},l=null==(s=e.includes("-directive")?this.getPresetD(a):this.getPresetC(a))?void 0:s.css,c=Object.entries(o).reduce(((e,[t,n])=>e.push(`${t}="${n}"`)&&e),[]).join(" ");return l?``:""},createTokens(e={},t,n="",o="",i={}){return Object.entries(e).forEach((([e,r])=>{const s=Tm(e,t.variable.excludedKeyRegex)?n:n?`${n}.${Dm(e)}`:Dm(e),a=o?`${o}.${e}`:e;xm(r)?this.createTokens(r,t,s,a,i):(i[s]||(i[s]={paths:[],computed(e,t={}){if(e){const n=this.paths.find((t=>t.scheme===e))||this.paths.find((e=>"none"===e.scheme));return null==n?void 0:n.computed(e,t.binding)}return this.paths.map((e=>e.computed(e.scheme,t[e.scheme])))}}),i[s].paths.push({path:a,value:r,scheme:a.includes("colorScheme.light")?"light":a.includes("colorScheme.dark")?"dark":"none",computed(e,t={}){const n=/{([^}]*)}/g;let o=r;if(t.name=this.path,t.binding||(t.binding={}),Tm(r,n)){const s=r.trim().replaceAll(n,(n=>{var o,r;const s=n.replace(/{|}/g,"");return null==(r=null==(o=i[s])?void 0:o.computed(e,t))?void 0:r.value})),a=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,l=/var\([^)]+\)/g;o=Tm(s.replace(l,"0"),a)?`calc(${s})`:s}return _m(t.binding)&&delete t.binding,{colorScheme:e,path:this.path,paths:t,value:o.includes("undefined")?void 0:o}}}))})),i},getTokenValue(e,t,n){var o;const i=t.split(".").filter((e=>!Tm(e.toLowerCase(),n.variable.excludedKeyRegex))).join(".");const r=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,s=[null==(o=e[i])?void 0:o.computed(r)].flat().filter((e=>e));return 1===s.length?s[0].value:s.reduce(((e={},t)=>{const n=t,{colorScheme:o}=n,i=Hm(n,["colorScheme"]);return e[o]=i,e}),void 0)},transformCSS(e,t,n,o,i={},r,s,a){if(Sm(t)){const{cssLayer:l}=i;if("style"!==o){const e=this.getColorSchemeOption(i,s),o=a?Jm(a,t):t;t="dark"===n?e.reduce(((e,{selector:t})=>(Sm(t)&&(e+=t.includes("[CSS]")?t.replace("[CSS]",o):Jm(t,o)),e)),""):Jm(null!=a?a:":root",t)}if(l){const n={name:"primeui",order:"primeui"};xm(l)&&(n.name=km(l.name,{name:e,type:o})),Sm(n.name)&&(t=Jm(`@layer ${n.name}`,t),null==r||r.layerNames(n.name))}return t}return""}},og={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(e={}){const{theme:t}=e;t&&(this._theme=Vm(zm({},t),{options:zm(zm({},this.defaults.options),t.options)}),this._tokens=ng.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var e;return(null==(e=this.theme)?void 0:e.preset)||{}},get options(){var e;return(null==(e=this.theme)?void 0:e.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(e){this.update({theme:e}),Wm.emit("theme:change",e)},getPreset(){return this.preset},setPreset(e){this._theme=Vm(zm({},this.theme),{preset:e}),this._tokens=ng.createTokens(e,this.defaults),this.clearLoadedStyleNames(),Wm.emit("preset:change",e),Wm.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(e){this._theme=Vm(zm({},this.theme),{options:e}),this.clearLoadedStyleNames(),Wm.emit("options:change",e),Wm.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(e){this._layerNames.add(e)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(e){return this._loadedStyleNames.has(e)},setLoadedStyleName(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(e){return ng.getTokenValue(this.tokens,e,this.defaults)},getCommon(e="",t){return ng.getCommon({name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPresetC(n)},getDirective(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPresetD(n)},getCustomPreset(e="",t,n,o){const i={name:e,preset:t,options:this.options,selector:n,params:o,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return ng.getPreset(i)},getLayerOrderCSS(e=""){return ng.getLayerOrder(e,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(e="",t,n="style",o){return ng.transformCSS(e,t,o,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(e="",t,n={}){return ng.getCommonStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(e,t,n={}){return ng.getStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(e){this._loadingStyles.add(e)},onStyleUpdated(e){this._loadingStyles.add(e)},onStyleLoaded(e,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),Wm.emit(`theme:${t}:load`,e),!this._loadingStyles.size&&Wm.emit("theme:load"))}};function ig(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className))}function rg(e,t){if(e&&t){const n=t=>{ig(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)};[t].flat().filter(Boolean).forEach((e=>e.split(" ").forEach(n)))}}function sg(e,t){if(e&&t){const n=t=>{e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")};[t].flat().filter(Boolean).forEach((e=>e.split(" ").forEach(n)))}}function ag(e,t){if(e instanceof HTMLElement){return e.offsetWidth}return 0}function lg(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function cg(e,t={}){if(lg(e)){const n=(t,o)=>{var i,r;const s=(null==(i=null==e?void 0:e.$attrs)?void 0:i[t])?[null==(r=null==e?void 0:e.$attrs)?void 0:r[t]]:[];return[o].flat().reduce(((e,o)=>{if(null!=o){const i=typeof o;if("string"===i||"number"===i)e.push(o);else if("object"===i){const i=Array.isArray(o)?n(t,o):Object.entries(o).map((([e,n])=>"style"!==t||!n&&0!==n?n?e:void 0:`${e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${n}`));e=i.length?e.concat(i.filter((e=>!!e))):e}}return e}),s)};Object.entries(t).forEach((([t,o])=>{if(null!=o){const i=t.match(/^on(.+)/);i?e.addEventListener(i[1].toLowerCase(),o):"p-bind"===t?cg(e,o):(o="class"===t?[...new Set(n("class",o))].join(" ").trim():"style"===t?n("style",o).join(";").trim():o,(e.$attrs=e.$attrs||{})&&(e.$attrs[t]=o),e.setAttribute(t,o))}}))}}function ug(e,t={},...n){if(e){const o=document.createElement(e);return cg(o,t),o.append(...n),o}}function dg(e,t){return lg(e)?e.matches(t)?e:e.querySelector(t):null}function pg(e,t){if(lg(e)){const n=e.getAttribute(t);return isNaN(n)?"true"===n||"false"===n?"true"===n:n:+n}}function fg(e){if(e){let t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),t}return 0}function hg(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function mg(e,t){if(e){return e.offsetHeight}return 0}function gg(e,t=[]){const n=hg(e);return null===n?t:gg(n,t.concat([n]))}function vg(e){let t=[];if(e){let n=gg(e);const o=/(auto|scroll)/,i=e=>{try{let t=window.getComputedStyle(e,null);return o.test(t.getPropertyValue("overflow"))||o.test(t.getPropertyValue("overflowX"))||o.test(t.getPropertyValue("overflowY"))}catch(t){return!1}};for(let e of n){let n=1===e.nodeType&&e.dataset.scrollselectors;if(n){let o=n.split(",");for(let n of o){let o=dg(e,n);o&&i(o)&&t.push(o)}}9!==e.nodeType&&i(e)&&t.push(e)}}return t}function yg(e){return!(null==e||!e.nodeName||!hg(e))}function bg(e){if(e){let t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth),t}return 0}var _g={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(e){return this._loadedStyleNames.has(e)},setLoadedStyleName:function(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName:function(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};function wg(e){return(wg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function xg(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=pn(!1),o=pn(e),i=pn(null),r="undefined"!=typeof window&&window.document&&window.document.createElement?window.document:void 0,s=t.document,a=void 0===s?r:s,l=t.immediate,c=void 0===l||l,u=t.manual,d=void 0!==u&&u,p=t.name,f=void 0===p?"style_".concat(++Cg):p,h=t.id,m=void 0===h?void 0:h,g=t.media,v=void 0===g?void 0:g,y=t.nonce,b=void 0===y?void 0:y,_=t.first,w=void 0!==_&&_,S=t.onMounted,x=void 0===S?void 0:S,k=t.onUpdated,C=void 0===k?void 0:k,A=t.onLoad,E=void 0===A?void 0:A,O=t.props,L=void 0===O?{}:O,T=function(){},N=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(a){var s=xg(xg({},L),r),l=s.name||f,c=s.id||m,u=s.nonce||b;i.value=a.querySelector('style[data-primevue-style-id="'.concat(l,'"]'))||a.getElementById(c)||a.createElement("style"),i.value.isConnected||(o.value=t||e,cg(i.value,{type:"text/css",id:c,media:v,nonce:u}),w?a.head.prepend(i.value):a.head.appendChild(i.value),function(e,t="",n){lg(e)&&null!=n&&e.setAttribute(t,n)}(i.value,"data-primevue-style-id",l),cg(i.value,s),i.value.onload=function(e){return null==E?void 0:E(e,{name:l})},null==x||x(l)),n.value||(T=bi(o,(function(e){i.value.textContent=e,null==C||C(l)}),{immediate:!0}),n.value=!0)}};return c&&!d&&function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ar()?oo(e):t?e():Pn(e)}(N),{id:m,name:f,el:i,css:o,unload:function(){a&&n.value&&(T(),yg(i.value)&&a.head.removeChild(i.value),n.value=!1)},load:N,isLoaded:Qt(n)}}function Eg(e){return(Eg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Og(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,s,a=[],l=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t);else for(;!(l=(o=r.call(n)).done)&&(a.push(o.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Lg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return e})(km(e,{dt:qm}));return n?Ag(Im(n),Ng({name:this.name},t)):{}},loadCSS:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.load(this.css,e)},loadTheme:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.load(this.theme,t,(function(n){return og.transformCSS(t.name||e.name,n)}))},getCommonTheme:function(e){return og.getCommon(this.name,e)},getComponentTheme:function(e){return og.getComponent(this.name,e)},getDirectiveTheme:function(e){return og.getDirective(this.name,e)},getPresetTheme:function(e,t,n){return og.getCustomPreset(this.name,e,t,n)},getLayerOrderThemeCSS:function(){return og.getLayerOrderCSS(this.name)},getStyleSheet:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.css){var n=km(this.css,{dt:qm}),o=Im("".concat(n).concat(e)),i=Object.entries(t).reduce((function(e,t){var n=Og(t,2),o=n[0],i=n[1];return e.push("".concat(o,'="').concat(i,'"'))&&e}),[]).join(" ");return'")}return""},getCommonThemeStyleSheet:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return og.getCommonStyleSheet(this.name,e,t)},getThemeStyleSheet:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[og.getStyleSheet(this.name,e,t)];if(this.theme){var o="base"===this.name?"global-style":"".concat(this.name,"-style"),i=km(this.theme,{dt:qm}),r=Im(og.transformCSS(o,i)),s=Object.entries(t).reduce((function(e,t){var n=Og(t,2),o=n[0],i=n[1];return e.push("".concat(o,'="').concat(i,'"'))&&e}),[]).join(" ");n.push('"))}return n.join("")},extend:function(e){return Ng(Ng({},this),{},{css:void 0,theme:void 0},e)}},Dg={};var jg=function(){let e=[];const t=(t,n,o=0)=>[...e].reverse().find((e=>!0))||{key:t,value:o},n=e=>e&&parseInt(e.style.zIndex,10)||0;return{get:n,set:(n,o,i)=>{o&&(o.style.zIndex=String(((n,o,i=999)=>{const r=t(n,o,i),s=r.value+(r.key===n?0:i)+1;return e.push({key:n,value:s}),s})(n,!0,i)))},clear:t=>{var o;t&&(o=n(t),e=e.filter((e=>e.value!==o)),t.style.zIndex="")},getCurrent:e=>(e=>t(e).value)(e)}}();function Mg(e){return(Mg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rg(e,t,n){return t&&function(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:function(){};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.listener=n}),[{key:"bindScrollListener",value:function(){this.scrollableParents=vg(this.element);for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:"pv_id_")}var Fg=Pg.extend({name:"common"});function Ug(e){return(Ug="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zg(e){return Zg(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wg(e)||Hg()}function Vg(e,t){return Zg(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,s,a=[],l=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=r.call(n)).done)&&(a.push(o.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Wg(e,t)||Hg()}function Hg(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Wg(e,t){if(e){if("string"==typeof e)return Yg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yg(e,t):void 0}}function Yg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:function(){};_g.clearLoadedStyleNames(),Wm.on("theme:change",e)},_getHostInstance:function(e){return e?this.$options.hostName?e.$.type.name===this.$options.hostName?e:this._getHostInstance(e.$parentInstance):e.$parentInstance:void 0},_getPropValue:function(e){var t;return this[e]||(null===(t=this._getHostInstance(this))||void 0===t?void 0:t[e])},_getOptionValue:function(e){return Em(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})},_getPTValue:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=/./g.test(n)&&!!o[n.split(".")[0]],s=this._getPropValue("ptOptions")||(null===(e=this.$primevueConfig)||void 0===e?void 0:e.ptOptions)||{},a=s.mergeSections,l=void 0===a||a,c=s.mergeProps,u=void 0!==c&&c,d=i?r?this._useGlobalPT(this._getPTClassValue,n,o):this._useDefaultPT(this._getPTClassValue,n,o):void 0,p=r?void 0:this._getPTSelf(t,this._getPTClassValue,n,Xg(Xg({},o),{},{global:d||{}})),f=this._getPTDatasets(n);return l||!l&&p?u?this._mergeProps(u,d,p,f):Xg(Xg(Xg({},d),p),f):Xg(Xg({},p),f)},_getPTSelf:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=new Array(t>1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:"",o="data-pc-",i="root"===n&&Sm(null===(e=this.pt)||void 0===e?void 0:e["data-pc-section"]);return"transition"!==n&&Xg(Xg({},"root"===n&&Xg(Qg({},"".concat(o,"name"),Am(i?null===(t=this.pt)||void 0===t?void 0:t["data-pc-section"]:this.$.type.name)),i&&Qg({},"".concat(o,"extend"),Am(this.$.type.name)))),{},Qg({},"".concat(o,"section"),Am(n)))},_getPTClassValue:function(){var e=this._getOptionValue.apply(this,arguments);return Cm(e)||Om(e)?{class:e}:e},_getPT:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2?arguments[2]:void 0,i=function(e){var i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=o?o(e):e,a=Am(n),l=Am(t.$name);return null!==(i=r?a!==l?null==s?void 0:s[a]:void 0:null==s?void 0:s[a])&&void 0!==i?i:s};return null!=e&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:i(e.originalValue),value:i(e.value)}:i(e,!0)},_usePT:function(e,t,n,o){var i=function(e){return t(e,n,o)};if(null!=e&&e.hasOwnProperty("_usept")){var r,s=e._usept||(null===(r=this.$primevueConfig)||void 0===r?void 0:r.ptOptions)||{},a=s.mergeSections,l=void 0===a||a,c=s.mergeProps,u=void 0!==c&&c,d=i(e.originalValue),p=i(e.value);if(void 0===d&&void 0===p)return;return Cm(p)?p:Cm(d)?d:l||!l&&p?u?this._mergeProps(u,d,p):Xg(Xg({},d),p):p}return i(e)},_useGlobalPT:function(e,t,n){return this._usePT(this.globalPT,e,t,n)},_useDefaultPT:function(e,t,n){return this._usePT(this.defaultPT,e,t,n)},ptm:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._getPTValue(this.pt,e,Xg(Xg({},this.$params),t))},ptmi:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nr(this.$_attrsWithoutPT,this.ptm(e,t))},ptmo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._getPTValue(e,t,Xg({instance:this},n),!1)},cx:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,e,Xg(Xg({},this.$params),t))},sx:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var n=this._getOptionValue(this.$style.inlineStyles,e,Xg(Xg({},this.$params),t));return[this._getOptionValue(Fg.inlineStyles,e,Xg(Xg({},this.$params),t)),n]}}},computed:{globalPT:function(){var e,t=this;return this._getPT(null===(e=this.$primevueConfig)||void 0===e?void 0:e.pt,void 0,(function(e){return km(e,{instance:t})}))},defaultPT:function(){var e,t=this;return this._getPT(null===(e=this.$primevueConfig)||void 0===e?void 0:e.pt,void 0,(function(e){return t._getOptionValue(e,t.$name,Xg({},t.$params))||km(e,Xg({},t.$params))}))},isUnstyled:function(){var e;return void 0!==this.unstyled?this.unstyled:null===(e=this.$primevueConfig)||void 0===e?void 0:e.unstyled},$theme:function(){var e;return null===(e=this.$primevueConfig)||void 0===e?void 0:e.theme},$style:function(){return Xg(Xg({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var e;return{nonce:null===(e=this.$primevueConfig)||void 0===e||null===(e=e.csp)||void 0===e?void 0:e.nonce}},$primevueConfig:function(){var e;return null===(e=this.$primevue)||void 0===e?void 0:e.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var e=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:e,props:null==e?void 0:e.$props,state:null==e?void 0:e.$data,attrs:null==e?void 0:e.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter((function(e){var t=Vg(e,1)[0];return null==t?void 0:t.startsWith("pt:")})).reduce((function(e,t){var n=Vg(t,2),o=n[0],i=n[1],r=zg(o.split(":")).slice(1);return null==r||r.reduce((function(e,t,n,o){return!e[t]&&(e[t]=n===o.length-1?i:{}),e[t]}),e),e}),{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter((function(e){var t=Vg(e,1)[0];return!(null!=t&&t.startsWith("pt:"))})).reduce((function(e,t){var n=Vg(t,2),o=n[0],i=n[1];return e[o]=i,e}),{})},$attrSelector:function(){return Bg("pc")}}},qg=Pg.extend({name:"baseicon",css:"\n.p-icon {\n display: inline-block;\n vertical-align: baseline;\n}\n\n.p-icon-spin {\n -webkit-animation: p-icon-spin 2s infinite linear;\n animation: p-icon-spin 2s infinite linear;\n}\n\n@-webkit-keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n@keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n"});function ev(e){return(ev="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function nv(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,o=Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=function(){var e=gv._getOptionValue.apply(gv,arguments);return Cm(e)||Om(e)?{class:e}:e},l=(null===(e=n.binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.ptOptions)||(null===(t=n.$primevueConfig)||void 0===t?void 0:t.ptOptions)||{},c=l.mergeSections,u=void 0===c||c,d=l.mergeProps,p=void 0!==d&&d,f=s?gv._useDefaultPT(n,n.defaultPT(),a,i,r):void 0,h=gv._usePT(n,gv._getPT(o,n.$name),a,i,hv(hv({},r),{},{global:f||{}})),m=gv._getPTDatasets(n,i);return u||!u&&h?p?gv._mergeProps(n,p,f,h,m):hv(hv(hv({},f),h),m):hv(hv({},h),m)},_getPTDatasets:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="data-pc-";return hv(hv({},"root"===t&&mv({},"".concat(n,"name"),Am(e.$name))),{},mv({},"".concat(n,"section"),Am(t)))},_getPT:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,o=function(e){var o,i=n?n(e):e,r=Am(t);return null!==(o=null==i?void 0:i[r])&&void 0!==o?o:i};return null!=e&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:o(e.originalValue),value:o(e.value)}:o(e)},_usePT:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=function(e){return n(e,o,i)};if(null!=t&&t.hasOwnProperty("_usept")){var s,a=t._usept||(null===(s=e.$primevueConfig)||void 0===s?void 0:s.ptOptions)||{},l=a.mergeSections,c=void 0===l||l,u=a.mergeProps,d=void 0!==u&&u,p=r(t.originalValue),f=r(t.value);if(void 0===p&&void 0===f)return;return Cm(f)?f:Cm(p)?p:c||!c&&f?d?gv._mergeProps(e,d,p,f):hv(hv({},p),f):f}return r(t)},_useDefaultPT:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return gv._usePT(e,t,n,o,i)},_loadStyles:function(e,t,n){var o,i=gv._getConfig(t,n),r={nonce:null==i||null===(o=i.csp)||void 0===o?void 0:o.nonce};gv._loadCoreStyles(e.$instance,r),gv._loadThemeStyles(e.$instance,r),gv._loadScopedThemeStyles(e.$instance,r),gv._themeChangeListener((function(){return gv._loadThemeStyles(e.$instance,r)}))},_loadCoreStyles:function(){var e,t,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;!_g.isStyleNameLoaded(null===(e=o.$style)||void 0===e?void 0:e.name)&&null!==(t=o.$style)&&void 0!==t&&t.name&&(Pg.loadCSS(i),o.isUnstyled()&&(null===(n=o.$style)||void 0===n||n.loadCSS(i)),_g.setLoadedStyleName(o.$style.name))},_loadThemeStyles:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(null==n||!n.isUnstyled()){if(!og.isStyleNameLoaded("common")){var i,r,s=(null===(i=n.$style)||void 0===i||null===(r=i.getCommonTheme)||void 0===r?void 0:r.call(i))||{},a=s.primitive,l=s.semantic;Pg.load(null==a?void 0:a.css,hv({name:"primitive-variables"},o)),Pg.load(null==l?void 0:l.css,hv({name:"semantic-variables"},o)),Pg.loadTheme(hv({name:"global-style"},o)),og.setLoadedStyleName("common")}if(!og.isStyleNameLoaded(null===(e=n.$style)||void 0===e?void 0:e.name)&&null!==(t=n.$style)&&void 0!==t&&t.name){var c,u,d,p,f=((null===(c=n.$style)||void 0===c||null===(u=c.getDirectiveTheme)||void 0===u?void 0:u.call(c))||{}).css;null===(d=n.$style)||void 0===d||d.load(f,hv({name:"".concat(n.$style.name,"-variables")},o)),null===(p=n.$style)||void 0===p||p.loadTheme(hv({name:"".concat(n.$style.name,"-style")},o)),og.setLoadedStyleName(n.$style.name)}if(!og.isStyleNameLoaded("layer-order")){var h,m,g=null===(h=n.$style)||void 0===h||null===(m=h.getLayerOrderThemeCSS)||void 0===m?void 0:m.call(h);Pg.load(g,hv({name:"layer-order",first:!0},o)),og.setLoadedStyleName("layer-order")}}},_loadScopedThemeStyles:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e.preset();if(n&&e.$attrSelector){var o,i,r,s=((null===(o=e.$style)||void 0===o||null===(i=o.getPresetTheme)||void 0===i?void 0:i.call(o,n,"[".concat(e.$attrSelector,"]")))||{}).css,a=null===(r=e.$style)||void 0===r?void 0:r.load(s,hv({name:"".concat(e.$attrSelector,"-").concat(e.$style.name)},t));e.scopedStyleEl=a.el}},_themeChangeListener:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};_g.clearLoadedStyleNames(),Wm.on("theme:change",e)},_hook:function(e,t,n,o,i,r){var s,a,l,c="on".concat(Cm(l=t,!1)?l[0].toUpperCase()+l.slice(1):l),u=gv._getConfig(o,i),d=null==n?void 0:n.$instance,p=gv._usePT(d,gv._getPT(null==o||null===(s=o.value)||void 0===s?void 0:s.pt,e),gv._getOptionValue,"hooks.".concat(c)),f=gv._useDefaultPT(d,null==u||null===(a=u.pt)||void 0===a||null===(a=a.directives)||void 0===a?void 0:a[e],gv._getOptionValue,"hooks.".concat(c)),h={el:n,binding:o,vnode:i,prevVnode:r};null==p||p(d,h),null==f||f(d,h)},_mergeProps:function(){for(var e=arguments.length>1?arguments[1]:void 0,t=arguments.length,n=new Array(t>2?t-2:0),o=2;o1&&void 0!==arguments[1]?arguments[1]:{},n=function(n,o,i,r,s){var a,l,c;o._$instances=o._$instances||{};var u=gv._getConfig(i,r),d=o._$instances[e]||{},p=_m(d)?hv(hv({},t),null==t?void 0:t.methods):{};o._$instances[e]=hv(hv({},d),{},{$name:e,$host:o,$binding:i,$modifiers:null==i?void 0:i.modifiers,$value:null==i?void 0:i.value,$el:d.$el||o||void 0,$style:hv({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},null==t?void 0:t.style),$primevueConfig:u,$attrSelector:o.$attrSelector,defaultPT:function(){return gv._getPT(null==u?void 0:u.pt,void 0,(function(t){var n;return null==t||null===(n=t.directives)||void 0===n?void 0:n[e]}))},isUnstyled:function(){var e,t;return void 0!==(null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.unstyled)?null===(t=o.$instance)||void 0===t||null===(t=t.$binding)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.unstyled:null==u?void 0:u.unstyled},theme:function(){var e;return null===(e=o.$instance)||void 0===e||null===(e=e.$primevueConfig)||void 0===e?void 0:e.theme},preset:function(){var e;return null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.dt},ptm:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gv._getPTValue(o.$instance,null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.pt,t,hv({},n))},ptmo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return gv._getPTValue(o.$instance,e,t,n,!1)},cx:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null!==(e=o.$instance)&&void 0!==e&&e.isUnstyled()?void 0:gv._getOptionValue(null===(t=o.$instance)||void 0===t||null===(t=t.$style)||void 0===t?void 0:t.classes,n,hv({},i))},sx:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?gv._getOptionValue(null===(e=o.$instance)||void 0===e||null===(e=e.$style)||void 0===e?void 0:e.inlineStyles,t,hv({},n)):void 0}},p),o.$instance=o._$instances[e],null===(a=(l=o.$instance)[n])||void 0===a||a.call(l,o,i,r,s),o["$".concat(e)]=o.$instance,gv._hook(e,n,o,i,r,s),o.$pd||(o.$pd={}),o.$pd[e]=hv(hv({},null===(c=o.$pd)||void 0===c?void 0:c[e]),{},{name:e,instance:o.$instance})};return{created:function(e,t,o,i){n("created",e,t,o,i)},beforeMount:function(e,t,o,i){e.$attrSelector=Bg("pd"),gv._loadStyles(e,t,o),n("beforeMount",e,t,o,i),function(e){var t,n,o,i,r,s=null===(t=e.$instance)||void 0===t?void 0:t.watch;null==s||null===(n=s.config)||void 0===n||n.call(e.$instance,null===(o=e.$instance)||void 0===o?void 0:o.$primevueConfig),cv.on("config:change",(function(t){var n,o=t.newValue,i=t.oldValue;return null==s||null===(n=s.config)||void 0===n?void 0:n.call(e.$instance,o,i)})),null==s||null===(i=s["config.ripple"])||void 0===i||i.call(e.$instance,null===(r=e.$instance)||void 0===r||null===(r=r.$primevueConfig)||void 0===r?void 0:r.ripple),cv.on("config:ripple:change",(function(t){var n,o=t.newValue,i=t.oldValue;return null==s||null===(n=s["config.ripple"])||void 0===n?void 0:n.call(e.$instance,o,i)}))}(e)},mounted:function(e,t,o,i){gv._loadStyles(e,t,o),n("mounted",e,t,o,i)},beforeUpdate:function(e,t,o,i){n("beforeUpdate",e,t,o,i)},updated:function(e,t,o,i){gv._loadStyles(e,t,o),n("updated",e,t,o,i)},beforeUnmount:function(e,t,o,i){n("beforeUnmount",e,t,o,i)},unmounted:function(e,t,o,i){var r;null===(r=e.$instance)||void 0===r||null===(r=r.scopedStyleEl)||void 0===r||null===(r=r.value)||void 0===r||r.remove(),n("unmounted",e,t,o,i)}}},extend:function(){var e=dv(gv._getMeta.apply(gv,arguments),2),t=e[0],n=e[1];return hv({extend:function(){var e=dv(gv._getMeta.apply(gv,arguments),2),t=e[0],o=e[1];return gv.extend(t,hv(hv(hv({},n),null==n?void 0:n.methods),o))}},gv._extend(t,n))}},vv=Pg.extend({name:"ripple-directive",theme:function(e){var t=e.dt;return"\n.p-ink {\n display: block;\n position: absolute;\n background: ".concat(t("ripple.background"),";\n border-radius: 100%;\n transform: scale(0);\n pointer-events: none;\n}\n\n.p-ink-active {\n animation: ripple 0.4s linear;\n}\n\n@keyframes ripple {\n 100% {\n opacity: 0;\n transform: scale(2.5);\n }\n}\n")},classes:{root:"p-ink"}});function yv(e){return(yv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bv(e){return function(e){if(Array.isArray(e))return _v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return _v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_v(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);ne.length)&&(t=e.length);for(var n=0,o=Array(t);n0||navigator.msMaxTouchPoints>0||o.hide(e),window.removeEventListener("resize",t)})),n.addEventListener("mouseleave",(function t(){o.hide(e),n.removeEventListener("mouseleave",t)})),this.bindScrollListener(e),jg.set("tooltip",n,e.$_ptooltipZIndex)}},show:function(e,t,n){var o=this;void 0!==n?this.timer=setTimeout((function(){return o.tooltipActions(e,t)}),n):this.tooltipActions(e,t)},tooltipRemoval:function(e){this.remove(e),this.unbindScrollListener(e)},hide:function(e,t){var n=this;clearTimeout(this.timer),void 0!==t?setTimeout((function(){return n.tooltipRemoval(e)}),t):this.tooltipRemoval(e)},getTooltipElement:function(e){return document.getElementById(e.$_ptooltipId)},create:function(e){var t=e.$_ptooltipModifiers,n=ug("div",{class:!this.isUnstyled()&&this.cx("arrow"),"p-bind":this.ptm("arrow",{context:t})}),o=ug("div",{class:!this.isUnstyled()&&this.cx("text"),"p-bind":this.ptm("text",{context:t})});e.$_ptooltipEscape?(o.innerHTML="",o.appendChild(document.createTextNode(e.$_ptooltipValue))):o.innerHTML=e.$_ptooltipValue;var i=ug("div",Nv(Nv({id:e.$_ptooltipIdAttr,role:"tooltip",style:{display:"inline-block",width:e.$_ptooltipFitContent?"fit-content":void 0,pointerEvents:!this.isUnstyled()&&e.$_ptooltipAutoHide&&"none"},class:[!this.isUnstyled()&&this.cx("root"),e.$_ptooltipClass]},this.$attrSelector,""),"p-bind",this.ptm("root",{context:t})),n,o);return document.body.appendChild(i),e.$_ptooltipId=i.id,this.$el=i,i},remove:function(e){if(e){var t=this.getTooltipElement(e);t&&t.parentElement&&(jg.clear(t),document.body.removeChild(t)),e.$_ptooltipId=null}},align:function(e){var t=e.$_ptooltipModifiers;t.top?(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignTop(e))):t.left?(this.alignLeft(e),this.isOutOfBounds(e)&&(this.alignRight(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignLeft(e))))):t.bottom?(this.alignBottom(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&this.alignBottom(e))):(this.alignRight(e),this.isOutOfBounds(e)&&(this.alignLeft(e),this.isOutOfBounds(e)&&(this.alignTop(e),this.isOutOfBounds(e)&&(this.alignBottom(e),this.isOutOfBounds(e)&&this.alignRight(e)))))},getHostOffset:function(e){var t=e.getBoundingClientRect();return{left:t.left+function(){let e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}(),top:t.top+function(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}()}},alignRight:function(e){this.preAlign(e,"right");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+ag(e),i=n.top+(mg(e)-mg(t))/2;t.style.left=o+"px",t.style.top=i+"px"},alignLeft:function(e){this.preAlign(e,"left");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left-ag(t),i=n.top+(mg(e)-mg(t))/2;t.style.left=o+"px",t.style.top=i+"px"},alignTop:function(e){this.preAlign(e,"top");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+(ag(e)-ag(t))/2,i=n.top-mg(t);t.style.left=o+"px",t.style.top=i+"px"},alignBottom:function(e){this.preAlign(e,"bottom");var t=this.getTooltipElement(e),n=this.getHostOffset(e),o=n.left+(ag(e)-ag(t))/2,i=n.top+mg(e);t.style.left=o+"px",t.style.top=i+"px"},preAlign:function(e,t){var n=this.getTooltipElement(e);n.style.left="-999px",n.style.top="-999px",sg(n,"p-tooltip-".concat(n.$_ptooltipPosition)),!this.isUnstyled()&&rg(n,"p-tooltip-".concat(t)),n.$_ptooltipPosition=t,n.setAttribute("data-p-position",t);var o=dg(n,'[data-pc-section="arrow"]');o.style.top="bottom"===t?"0":"right"===t||"left"===t||"right"!==t&&"left"!==t&&"top"!==t&&"bottom"!==t?"50%":null,o.style.bottom="top"===t?"0":null,o.style.left="right"===t||"right"!==t&&"left"!==t&&"top"!==t&&"bottom"!==t?"0":"top"===t||"bottom"===t?"50%":null,o.style.right="left"===t?"0":null},isOutOfBounds:function(e){var t=this.getTooltipElement(e),n=t.getBoundingClientRect(),o=n.top,i=n.left,r=ag(t),s=mg(t),a=function(){let e=window,t=document,n=t.documentElement,o=t.getElementsByTagName("body")[0];return{width:e.innerWidth||n.clientWidth||o.clientWidth,height:e.innerHeight||n.clientHeight||o.clientHeight}}();return i+r>a.width||i<0||o<0||o+s>a.height},getTarget:function(e){return ig(e,"p-inputwrapper")?dg(e,"input"):e},getModifiers:function(e){return e.modifiers&&Object.keys(e.modifiers).length?e.modifiers:e.arg&&"object"===Iv(e.arg)?Object.entries(e.arg).reduce((function(e,t){var n=Lv(t,2),o=n[0],i=n[1];return"event"!==o&&"position"!==o||(e[i]=!0),e}),{}):{}}}}),Dv={name:"Card",extends:{name:"BaseCard",extends:Jg,style:Pg.extend({name:"card",theme:function(e){var t=e.dt;return"\n.p-card {\n background: ".concat(t("card.background"),";\n color: ").concat(t("card.color"),";\n box-shadow: ").concat(t("card.shadow"),";\n border-radius: ").concat(t("card.border.radius"),";\n display: flex;\n flex-direction: column;\n}\n\n.p-card-caption {\n display: flex;\n flex-direction: column;\n gap: ").concat(t("card.caption.gap"),";\n}\n\n.p-card-body {\n padding: ").concat(t("card.body.padding"),";\n display: flex;\n flex-direction: column;\n gap: ").concat(t("card.body.gap"),";\n}\n\n.p-card-title {\n font-size: ").concat(t("card.title.font.size"),";\n font-weight: ").concat(t("card.title.font.weight"),";\n}\n\n.p-card-subtitle {\n color: ").concat(t("card.subtitle.color"),";\n}\n")},classes:{root:"p-card p-component",header:"p-card-header",body:"p-card-body",caption:"p-card-caption",title:"p-card-title",subtitle:"p-card-subtitle",content:"p-card-content",footer:"p-card-footer"}}),provide:function(){return{$pcCard:this,$parentInstance:this}}},inheritAttrs:!1};Dv.render=function(e,t,n,o,i,r){return $i(),Ui("div",nr({class:e.cx("root")},e.ptmi("root")),[e.$slots.header?($i(),Ui("div",nr({key:0,class:e.cx("header")},e.ptm("header")),[_o(e.$slots,"header")],16)):Ji("",!0),Zi("div",nr({class:e.cx("body")},e.ptm("body")),[e.$slots.title||e.$slots.subtitle?($i(),Ui("div",nr({key:0,class:e.cx("caption")},e.ptm("caption")),[e.$slots.title?($i(),Ui("div",nr({key:0,class:e.cx("title")},e.ptm("title")),[_o(e.$slots,"title")],16)):Ji("",!0),e.$slots.subtitle?($i(),Ui("div",nr({key:1,class:e.cx("subtitle")},e.ptm("subtitle")),[_o(e.$slots,"subtitle")],16)):Ji("",!0)],16)):Ji("",!0),Zi("div",nr({class:e.cx("content")},e.ptm("content")),[_o(e.$slots,"content")],16),e.$slots.footer?($i(),Ui("div",nr({key:1,class:e.cx("footer")},e.ptm("footer")),[_o(e.$slots,"footer")],16)):Ji("",!0)],16)],16)};const jv={class:"no-result-placeholder"},Mv={class:"no-result-placeholder-content"},Rv={key:0},$v={__name:"noResultsPlaceholder",props:{icon:{type:String,default:"",required:!1},iconSize:{type:String,default:"3rem",required:!1},title:{type:String,required:!0},message:{type:String,required:!1},buttonLabel:{type:String,default:"",required:!1}},emits:["action"],setup:e=>(t,n)=>($i(),Ui("div",jv,[Ki(hn(Dv),null,{content:Vn((()=>[Zi("div",Mv,[Zi("i",{class:Me(e.icon),style:Ne({"font-size":e.iconSize,"margin-bottom":".5rem"})},null,6),Zi("h3",null,Be(e.title),1),e.message?($i(),Ui("p",Rv,Be(e.message),1)):Ji("",!0),e.buttonLabel?($i(),zi(hn(Ev),{key:1,label:e.buttonLabel,onClick:n[0]||(n[0]=e=>t.$emit("action")),class:"p-button-text"},null,8,["label"])):Ji("",!0)])])),_:1})]))};var Gv=Pg.extend({name:"inputtext",theme:function(e){var t=e.dt;return"\n.p-inputtext {\n font-family: inherit;\n font-feature-settings: inherit;\n font-size: 1rem;\n color: ".concat(t("inputtext.color"),";\n background: ").concat(t("inputtext.background"),";\n padding: ").concat(t("inputtext.padding.y")," ").concat(t("inputtext.padding.x"),";\n border: 1px solid ").concat(t("inputtext.border.color"),";\n transition: background ").concat(t("inputtext.transition.duration"),", color ").concat(t("inputtext.transition.duration"),", border-color ").concat(t("inputtext.transition.duration"),", outline-color ").concat(t("inputtext.transition.duration"),", box-shadow ").concat(t("inputtext.transition.duration"),";\n appearance: none;\n border-radius: ").concat(t("inputtext.border.radius"),";\n outline-color: transparent;\n box-shadow: ").concat(t("inputtext.shadow"),";\n}\n\n.p-inputtext:enabled:hover {\n border-color: ").concat(t("inputtext.hover.border.color"),";\n}\n\n.p-inputtext:enabled:focus {\n border-color: ").concat(t("inputtext.focus.border.color"),";\n box-shadow: ").concat(t("inputtext.focus.ring.shadow"),";\n outline: ").concat(t("inputtext.focus.ring.width")," ").concat(t("inputtext.focus.ring.style")," ").concat(t("inputtext.focus.ring.color"),";\n outline-offset: ").concat(t("inputtext.focus.ring.offset"),";\n}\n\n.p-inputtext.p-invalid {\n border-color: ").concat(t("inputtext.invalid.border.color"),";\n}\n\n.p-inputtext.p-variant-filled {\n background: ").concat(t("inputtext.filled.background"),";\n}\n\n.p-inputtext.p-variant-filled:enabled:focus {\n background: ").concat(t("inputtext.filled.focus.background"),";\n}\n\n.p-inputtext:disabled {\n opacity: 1;\n background: ").concat(t("inputtext.disabled.background"),";\n color: ").concat(t("inputtext.disabled.color"),";\n}\n\n.p-inputtext::placeholder {\n color: ").concat(t("inputtext.placeholder.color"),";\n}\n\n.p-inputtext-sm {\n font-size: ").concat(t("inputtext.sm.font.size"),";\n padding: ").concat(t("inputtext.sm.padding.y")," ").concat(t("inputtext.sm.padding.x"),";\n}\n\n.p-inputtext-lg {\n font-size: ").concat(t("inputtext.lg.font.size"),";\n padding: ").concat(t("inputtext.lg.padding.y")," ").concat(t("inputtext.lg.padding.x"),";\n}\n\n.p-inputtext-fluid {\n width: 100%;\n}\n")},classes:{root:function(e){var t=e.instance,n=e.props;return["p-inputtext p-component",{"p-filled":t.filled,"p-inputtext-sm":"small"===n.size,"p-inputtext-lg":"large"===n.size,"p-invalid":n.invalid,"p-variant-filled":n.variant?"filled"===n.variant:"filled"===t.$primevue.config.inputStyle||"filled"===t.$primevue.config.inputVariant,"p-inputtext-fluid":t.hasFluid}]}}}),Bv={name:"InputText",extends:{name:"BaseInputText",extends:Jg,props:{modelValue:null,size:{type:String,default:null},invalid:{type:Boolean,default:!1},variant:{type:String,default:null},fluid:{type:Boolean,default:null}},style:Gv,provide:function(){return{$pcInputText:this,$parentInstance:this}}},inheritAttrs:!1,emits:["update:modelValue"],inject:{$pcFluid:{default:null}},methods:{getPTOptions:function(e){return("root"===e?this.ptmi:this.ptm)(e,{context:{filled:this.filled,disabled:this.$attrs.disabled||""===this.$attrs.disabled}})},onInput:function(e){this.$emit("update:modelValue",e.target.value)}},computed:{filled:function(){return null!=this.modelValue&&this.modelValue.toString().length>0},hasFluid:function(){return _m(this.fluid)?!!this.$pcFluid:this.fluid}}},Fv=["value","aria-invalid"];Bv.render=function(e,t,n,o,i,r){return $i(),Ui("input",nr({type:"text",class:e.cx("root"),value:e.modelValue,"aria-invalid":e.invalid||void 0,onInput:t[0]||(t[0]=function(){return r.onInput&&r.onInput.apply(r,arguments)})},r.getPTOptions("root")),null,16,Fv)};const Uv={class:"left flex-1"},zv={key:1,class:"edit"},Vv={key:2,class:"label"},Hv={class:"right toolbar"},Wv={key:0,class:"nodes"},Yv={__name:"group",props:{item:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup(e){const t=e,n=np(),o=pn(!1),i=pn(null),r=pn(""),s=e=>{var o,i;let r=t.item;if(!(null==(o=r.info)?void 0:o.is_edit)&&(null==(i=r.children)?void 0:i.length)>0){let e=y.canvas.graph._groups.find((e=>e.pos[0]==r.info.pos[0]&&e.pos[1]==r.info.pos[1]));e&&(e.show_nodes=!e.show_nodes,n.setGroups(y.canvas.graph._groups))}},a=async()=>{let e=t.item,i=y.canvas.graph._groups.find((t=>t.pos[0]==e.info.pos[0]&&t.pos[1]==e.info.pos[1]));i?(i.is_edit=!1,i.title=r.value,await n.setGroups(y.canvas.graph._groups),o.value=!1):o.value=!1};return(l,c)=>{var u,d,p;return $i(),Ui(Ii,null,[Zi("div",{class:Me("comfyui-easyuse-map-nodes-group"),onClick:s},[Zi("div",Uv,[e.item.children?($i(),Ui("i",{key:0,class:Me(["icon",e.item.info.show_nodes?"pi pi-folder-open":"pi pi-folder"]),style:Ne({color:e.item.info.color})},null,6)):Ji("",!0),(null==(u=e.item.info)?void 0:u.is_edit)?($i(),Ui("div",zv,[Ki(hn(Bv),{ref_key:"modifyRef",ref:i,modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=e=>r.value=e),variant:"outline",size:"small",type:"text",onBlur:a,onKeydown:[qr(a,["enter"]),qr(a,["esc"])],style:{width:"100%"}},null,8,["modelValue"])])):($i(),Ui("div",Vv,[Zi("span",{onDblclick:c[1]||(c[1]=Qr((s=>(async()=>{var e,s;if(o.value)return;let a=t.item,l=y.canvas.graph._groups.find((e=>e.pos[0]==a.info.pos[0]&&e.pos[1]==a.info.pos[1]));l&&(l.is_edit=!l.is_edit,r.value=l.is_edit?a.info.title:"",await n.setGroups(y.canvas.graph._groups),o.value=!0,null==(s=null==(e=i.value)?void 0:e[0])||s.$el.focus())})(e.item)),["stop"]))},Be(e.item.info.title),33)]))]),Zi("div",Hv,[(null==(d=e.item.children)?void 0:d.length)>0?($i(),zi(hn(Ev),{key:0,size:"small",icon:e.item.children.find((e=>e.mode==hn(j).ALWAYS))?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:c[2]||(c[2]=Qr((e=>l.$emit("changeMode")),["stop"])),onMousedown:c[3]||(c[3]=Qr((e=>l.$emit("mousedown")),["stop"])),onMouseup:c[4]||(c[4]=Qr((e=>l.$emit("mouseup")),["stop"]))},null,8,["icon"])):Ji("",!0)])]),(null==(p=e.item.children)?void 0:p.length)>0&&e.item.info.show_nodes?($i(),Ui("div",Wv,[_o(l.$slots,"default")])):Ji("",!0)],64)}}},Zv={key:1,class:"label error"},Kv={class:"right toolbar"},Xv={__name:"node",props:{node:{type:Object,default:{}}},emits:["mousedown","mouseup","changeMode"],setup:e=>(t,n)=>($i(),Ui("div",{class:Me(["comfyui-easyuse-map-nodes-node",{never:void 0!==e.node.mode&&e.node.mode==hn(j).NEVER},{bypass:void 0!==e.node.mode&&e.node.mode==hn(j).BYPASS}])},[void 0!==e.node.title?($i(),Ui("span",{key:0,class:"label",onDblclick:n[0]||(n[0]=Qr((t=>hn(Lp)(e.node.id)),["stop"]))},Be(e.node.title),33)):($i(),Ui("span",Zv,Be(e.node.type),1)),Zi("div",Kv,[Ki(hn(Ev),{size:"small",icon:e.node.mode==hn(j).ALWAYS?"pi pi-eye":"pi pi-eye-slash",text:"",rounded:"",severity:"secondary",onClick:n[1]||(n[1]=Qr((e=>t.$emit("changeMode")),["stop"])),onMousedown:n[2]||(n[2]=Qr((e=>t.$emit("mousedown")),["stop"])),onMouseup:n[3]||(n[3]=Qr((e=>t.$emit("mouseup")),["stop"]))},null,8,["icon"])])],2))},Qv={class:"title"},Jv={class:"toolbar"},qv={key:0},ey={key:1,class:"no_result",style:{height:"100%"}},ty="comfyui-easyuse-map-nodes",ny={__name:"nodesMap",setup(e){const t=np(),{groups_nodes:n,groups:o}=ws(t),i=pn(!1),r=e=>{i.value=!i.value,y.canvas.graph._groups.forEach((e=>{e.show_nodes=i.value})),t.setGroups(y.canvas.graph._groups)};let s,a=0,l=0,c=!1;const u=(e,n=!1)=>{if(c)return void(c=!1);const o=e.children.find((e=>e.mode==j.ALWAYS)),i=e.children.map((e=>e.id));y.canvas.graph._nodes.forEach((e=>{i.includes(e.id)&&(e.mode=o?n?j.NEVER:j.BYPASS:j.ALWAYS,e.graph.change())})),t.setNodes(y.canvas.graph._nodes)},d=(e,n=!1)=>{if(c)return void(c=!1);const o=e.mode==j.ALWAYS,i=y.canvas.graph._nodes.find((t=>t.id==e.id));i&&(i.mode=o?n?j.NEVER:j.BYPASS:j.ALWAYS,i.graph.change(),t.setNodes(y.canvas.graph._nodes))},p=(e,t="group")=>{a=(new Date).getTime(),clearTimeout(s),s=setTimeout((n=>{"group"==t?u(e,!0):d(e,!0)}),500)},f=e=>{l=(new Date).getTime(),l-a>500&&(c=!0),clearTimeout(s)};return(e,t)=>{var s,a;return $i(),Ui("div",{class:Me(ty)},[Zi("div",{class:Me(ty+"__header")},[Zi("div",Qv,Be(hn(V)("Nodes Map",!0)),1),Zi("div",Jv,[(null==(s=hn(o))?void 0:s.length)>0?Hn(($i(),zi(hn(Ev),{key:0,icon:i.value?"pi pi-angle-double-down":"pi pi-angle-double-up",text:"",rounded:"",severity:"secondary",onClick:r,size:"small"},null,8,["icon"])),[[hn(Pv),i.value?hn(V)("Collapse All"):hn(V)("Expand All"),void 0,{right:!0}]]):Ji("",!0)])],2),Zi("div",{class:Me(ty+"__content")},[(null==(a=hn(n))?void 0:a.length)>0?($i(),Ui("ol",qv,[($i(!0),Ui(Ii,null,bo(hn(n),((e,t)=>($i(),Ui("li",{key:t},[void 0!==e.children?($i(),zi(Yv,{key:0,item:e,onChangeMode:t=>u(e),onMousedown:t=>p(e,"group"),onMouseup:f},{default:Vn((()=>[($i(!0),Ui(Ii,null,bo(e.children,((e,t)=>($i(),zi(Xv,{key:t,node:e,onChangeMode:t=>d(e),onMousedown:t=>p(e,"node"),onMouseup:f},null,8,["node","onChangeMode","onMousedown"])))),128))])),_:2},1032,["item","onChangeMode","onMousedown"])):($i(),zi(Xv,{key:1,node:e.info,onChangeMode:t=>d(e.info),onMousedown:t=>p(e.info,"node"),onMouseup:f},null,8,["node","onChangeMode","onMousedown"]))])))),128))])):($i(),Ui("div",ey,[Ki($v,{icon:"pi pi-sitemap",title:hn(V)("No Nodes",!0),message:hn(V)("No nodes found in the map",!0)},null,8,["title","message"])]))],2)])}}},oy={__name:"index",setup(e){const t=np();return oo((e=>{t.watchGraph()})),ao((e=>{})),(e,t)=>($i(),Ui("div",{class:Me("comfyui-easyuse-map")},[Ki(ny)]))}},iy={__name:"App",setup(e){const t=e=>{y.extensionManager.registerSidebarTab({id:M,icon:"pi pi-sitemap",title:V("Nodes Map",!0),tooltip:V("Nodes Map",!0),type:"custom",render:e=>{e.style.height="100%",((...e)=>{ns().render(...e)})(function(e,t,n){const o=arguments.length;return 2===o?ue(t)&&!ie(t)?Vi(t)?Ki(e,null,[t]):Ki(e,t):Ki(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):3===o&&Vi(n)&&(n=[n]),Ki(e,t,n))}(oy,{}),e)}})};return oo((e=>{try{t()}catch(n){}})),(e,t)=>($i(),zi(hm))}};var ry="equals",sy="notEquals";function ay(e){return(ay="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function cy(e){for(var t=1;t{const t=ns().createApp(...e),{mount:n}=t;return t.mount=e=>{const o=function(e){if(le(e)){return document.querySelector(e)}return e}(e);if(!o)return;const i=t._component;ae(i)||i.render||i.template||(i.template=o.innerHTML),o.innerHTML="";const r=n(o,!1,function(e){if(e instanceof SVGElement)return"svg";if("function"==typeof MathMLElement&&e instanceof MathMLElement)return"mathml"}(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t})(iy);yy.use(my),yy.use(function(){const e=We(!0),t=e.run((()=>pn({})));let n=[],o=[];const i=rn({install(e){is(i),i._a=e,e.provide(rs,i),e.config.globalProperties.$pinia=i,o.forEach((e=>n.push(e))),o=[]},use(e){return this._a?n.push(e):o.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}()),yy.mount("#"+vy.id); From c1a85e3aa29ed070fb6632786767f1d5db7d5bef Mon Sep 17 00:00:00 2001 From: yolain Date: Fri, 16 Aug 2024 07:58:59 +0800 Subject: [PATCH 4/4] Compare comfyui revision>=2546 sets config.yaml to Web v2 by default --- __init__.py | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/__init__.py b/__init__.py index bb5324d..1f67474 100644 --- a/__init__.py +++ b/__init__.py @@ -54,38 +54,40 @@ for model in model_config: continue add_static_resource(path, path, limit=True) +# get comfyui revision +from .py.libs.utils import get_comfyui_revision + +comfyui_revision = get_comfyui_revision() +new_frontend_revision = 2546 +web_default_version = 'v2' if comfyui_revision >= new_frontend_revision else 'v1' # web directory config_path = os.path.join(cwd_path, "config.yaml") if os.path.isfile(config_path): with open(config_path, 'r') as f: data = yaml.load(f, Loader=yaml.FullLoader) - # if not data: - # data = {'WEB_VERSION': 'v1'} - # with open(config_path, 'w') as f: - # yaml.dump(data, f) - # if 'WEB_VERSION' not in data: - # data['WEB_VERSION'] = 'v1' - # with open(config_path, 'w') as f: - # yaml.dump(data, f) - if "WEB_VERSION" in data and data['WEB_VERSION'] == "v1": - del data['WEB_VERSION'] + if data and "WEB_VERSION" in data: + directory = f"web_version/{data['WEB_VERSION']}" with open(config_path, 'w') as f: yaml.dump(data, f) - directory = f"./web_version/v1" - elif "WEB_VERSION" in data: - directory = f"./web_version/{data['WEB_VERSION']}" + elif web_default_version != 'v1': + if not data: + data = {'WEB_VERSION': web_default_version} + elif 'WEB_VERSION' not in data: + data = {**data, 'WEB_VERSION': web_default_version} + with open(config_path, 'w') as f: + yaml.dump(data, f) + directory = f"web_version/{web_default_version}" else: - directory = f"./web_version/v1" + directory = f"web_version/v1" if not os.path.exists(os.path.join(cwd_path, directory)): - print(f"Web version {data['WEB_VERSION']} not found, using default") - directory = f"./web_version/v1" + print(f"web root {data['WEB_VERSION']} not found, using default") + directory = f"web_version/{web_default_version}" WEB_DIRECTORY = directory else: - # with open(config_path, 'w') as f: - # data = {'WEB_VERSION': 'v1'} - # yaml.dump(data, f) - WEB_DIRECTORY = "./web_version/v1" + directory = f"web_version/{web_default_version}" + WEB_DIRECTORY = directory __all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS', "WEB_DIRECTORY"] -print(f'\033[34mComfy-Easy-Use v{__version__}: \033[92mLoaded\033[0m') \ No newline at end of file +print(f'\033[34m[ComfyUI-Easy-Use] server: \033[0mv{__version__} \033[92mLoaded\033[0m') +print(f'\033[34m[ComfyUI-Easy-Use] web root: \033[0m{os.path.join(cwd_path, directory)} \033[92mLoaded\033[0m')