From 7c02beed2b970b3bb792a8c7f6fb5dc0a6c8a79e Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Tue, 10 Feb 2026 16:35:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E7=94=9F=E6=88=90=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=94=99=E8=AF=AF=E5=8E=9F=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- scripts/web/index.html | 2059 ++++------------------- src/agents/storyboard/index.ts | 15 +- src/lib/initDB.ts | 1 + src/router.ts | 110 +- src/routes/setting/getSetting.ts | 2 +- src/routes/setting/getVideoModelList.ts | 11 + src/routes/setting/updateModel.ts | 32 + src/routes/video/generateVideo.ts | 5 +- src/routes/video/getVideo.ts | 2 +- src/types/database.d.ts | 18 +- src/utils/ai/image/owned/other.ts | 33 +- src/utils/ai/video/owned/other.ts | 48 +- 13 files changed, 536 insertions(+), 1802 deletions(-) create mode 100644 src/routes/setting/getVideoModelList.ts create mode 100644 src/routes/setting/updateModel.ts diff --git a/package.json b/package.json index bd626dc..ccf8aa8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "toonflow-app", - "version": "1.0.6-dev", + "version": "1.0.6-dev2", "description": "Toonflow 是一款 AI 短剧漫剧工具,能够利用 AI 技术将小说自动转化为剧本,并结合 AI 生成的图片和视频,实现高效的短剧创作。", "author": "HBAI-Ltd ", "homepage": "https://github.com/HBAI-Ltd/Toonflow-app#readme", diff --git a/scripts/web/index.html b/scripts/web/index.html index 451b485..bcb2287 100644 --- a/scripts/web/index.html +++ b/scripts/web/index.html @@ -5,56 +5,56 @@ Toonflow - - + */function cte(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),i.push.apply(i,o)}return i}function R1(e){for(var n=1;n=0)&&(i[l]=e[l]);return i}function wSn(e,n){if(e==null)return{};var i=mSn(e,n),o,l;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(l=0;l=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}function LSn(e){return bSn(e)||CSn(e)||ySn(e)||xSn()}function bSn(e){if(Array.isArray(e))return zE(e)}function CSn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ySn(e,n){if(e){if(typeof e=="string")return zE(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return zE(e,n)}}function zE(e,n){(n==null||n>e.length)&&(n=e.length);for(var i=0,o=new Array(n);i"&&(n=n.substring(1)),e)try{if(e.matches)return e.matches(n);if(e.msMatchesSelector)return e.msMatchesSelector(n);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(n)}catch{return!1}return!1}}function ASn(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function iu(e,n,i,o){if(e){i=i||document;do{if(n!=null&&(n[0]===">"?e.parentNode===i&&xy(e,n):xy(e,n))||o&&e===i)return e;if(e===i)break}while(e=ASn(e))}return null}var ute=/\s+/g;function kr(e,n,i){if(e&&n)if(e.classList)e.classList[i?"add":"remove"](n);else{var o=(" "+e.className+" ").replace(ute," ").replace(" "+n+" "," ");e.className=(o+(i?" "+n:"")).replace(ute," ")}}function Ji(e,n,i){var o=e&&e.style;if(o){if(i===void 0)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),n===void 0?i:i[n];!(n in o)&&n.indexOf("webkit")===-1&&(n="-webkit-"+n),o[n]=i+(typeof i=="string"?"":"px")}}function kf(e,n){var i="";if(typeof e=="string")i=e;else do{var o=Ji(e,"transform");o&&o!=="none"&&(i=o+" "+i)}while(!n&&(e=e.parentNode));var l=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return l&&new l(i)}function z8e(e,n,i){if(e){var o=e.getElementsByTagName(n),l=0,r=o.length;if(i)for(;l=r,!s)return o;if(o===S1())break;o=a4(o,!1)}return!1}function t8(e,n,i,o){for(var l=0,r=0,s=e.children;r2&&arguments[2]!==void 0?arguments[2]:{},l=o.evt,r=wSn(o,PSn);D5.pluginEvent.bind(co)(n,i,R1({dragEl:Mi,parentEl:Lr,ghostEl:Ho,rootEl:rr,nextEl:Ak,lastDownEl:Ob,cloneEl:br,cloneHidden:_h,dragStarted:s9,putSortable:Ss,activeSortable:co.active,originalEvent:l,oldIndex:j0,oldDraggableIndex:J9,newIndex:Vc,newDraggableIndex:Gh,hideGhostForTarget:I8e,unhideGhostForTarget:N8e,cloneNowHidden:function(){_h=!0},cloneNowShown:function(){_h=!1},dispatchSortableEvent:function(a){ja({sortable:i,name:a,originalEvent:l})}},r))};function ja(e){r9(R1({putSortable:Ss,cloneEl:br,targetEl:Mi,rootEl:rr,oldIndex:j0,oldDraggableIndex:J9,newIndex:Vc,newDraggableIndex:Gh},e))}var Mi,Lr,Ho,rr,Ak,Ob,br,_h,j0,Vc,J9,Gh,ww,Ss,u0=!1,jy=!1,My=[],bk,eu,jT,MT,vte,gte,s9,J3,Q9,$9=!1,Lw=!1,Vb,qs,AT=[],PE=!1,Ay=[],lS=typeof document<"u",bw=H8e,mte=W5||fh?"cssFloat":"float",ESn=lS&&!MSn&&!H8e&&"draggable"in document.createElement("div"),O8e=function(){if(lS){if(fh)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),V8e=function(n,i){var o=Ji(n),l=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=t8(n,0,i),s=t8(n,1,i),a=r&&Ji(r),c=s&&Ji(s),d=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+sr(r).width,u=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+sr(s).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&a.float!=="none"){var h=a.float==="left"?"left":"right";return s&&(c.clear==="both"||c.clear===h)?"vertical":"horizontal"}return r&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||d>=l&&o[mte]==="none"||s&&o[mte]==="none"&&d+u>l)?"vertical":"horizontal"},OSn=function(n,i,o){var l=o?n.left:n.top,r=o?n.right:n.bottom,s=o?n.width:n.height,a=o?i.left:i.top,c=o?i.right:i.bottom,d=o?i.width:i.height;return l===a||r===c||l+s/2===a+d/2},VSn=function(n,i){var o;return My.some(function(l){var r=l[ia].options.emptyInsertThreshold;if(!(!r||hF(l))){var s=sr(l),a=n>=s.left-r&&n<=s.right+r,c=i>=s.top-r&&i<=s.bottom+r;if(a&&c)return o=l}}),o},B8e=function(n){function i(r,s){return function(a,c,d,u){var h=a.options.group.name&&c.options.group.name&&a.options.group.name===c.options.group.name;if(r==null&&(s||h))return!0;if(r==null||r===!1)return!1;if(s&&r==="clone")return r;if(typeof r=="function")return i(r(a,c,d,u),s)(a,c,d,u);var g=(s?a:c).options.group.name;return r===!0||typeof r=="string"&&r===g||r.join&&r.indexOf(g)>-1}}var o={},l=n.group;(!l||Eb(l)!="object")&&(l={name:l}),o.name=l.name,o.checkPull=i(l.pull,!0),o.checkPut=i(l.put),o.revertClone=l.revertClone,n.group=o},I8e=function(){!O8e&&Ho&&Ji(Ho,"display","none")},N8e=function(){!O8e&&Ho&&Ji(Ho,"display","")};lS&&document.addEventListener("click",function(e){if(jy)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),jy=!1,!1},!0);var Ck=function(n){if(Mi){n=n.touches?n.touches[0]:n;var i=VSn(n.clientX,n.clientY);if(i){var o={};for(var l in n)n.hasOwnProperty(l)&&(o[l]=n[l]);o.target=o.rootEl=i,o.preventDefault=void 0,o.stopPropagation=void 0,i[ia]._onDragOver(o)}}},BSn=function(n){Mi&&Mi.parentNode[ia]._isOutsideThisEl(n.target)};function co(e,n){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=n=Kd({},n),e[ia]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return V8e(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,a){s.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:co.supportPointer!==!1&&"PointerEvent"in window&&!q9,emptyInsertThreshold:5};D5.initializePlugins(this,e,i);for(var o in i)!(o in n)&&(n[o]=i[o]);B8e(n);for(var l in this)l.charAt(0)==="_"&&typeof this[l]=="function"&&(this[l]=this[l].bind(this));this.nativeDraggable=n.forceFallback?!1:ESn,this.nativeDraggable&&(this.options.touchStartThreshold=1),n.supportPointer?Ko(e,"pointerdown",this._onTapStart):(Ko(e,"mousedown",this._onTapStart),Ko(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ko(e,"dragover",this),Ko(e,"dragenter",this)),My.push(this.el),n.store&&n.store.get&&this.sort(n.store.get(this)||[]),Kd(this,HSn())}co.prototype={constructor:co,_isOutsideThisEl:function(n){!this.el.contains(n)&&n!==this.el&&(J3=null)},_getDirection:function(n,i){return typeof this.options.direction=="function"?this.options.direction.call(this,n,i,Mi):this.options.direction},_onTapStart:function(n){if(n.cancelable){var i=this,o=this.el,l=this.options,r=l.preventOnFilter,s=n.type,a=n.touches&&n.touches[0]||n.pointerType&&n.pointerType==="touch"&&n,c=(a||n).target,d=n.target.shadowRoot&&(n.path&&n.path[0]||n.composedPath&&n.composedPath()[0])||c,u=l.filter;if(GSn(o),!Mi&&!(/mousedown|pointerdown/.test(s)&&n.button!==0||l.disabled)&&!d.isContentEditable&&!(!this.nativeDraggable&&q9&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=iu(c,l.draggable,o,!1),!(c&&c.animated)&&Ob!==c)){if(j0=yr(c),J9=yr(c,l.draggable),typeof u=="function"){if(u.call(this,n,c,this)){ja({sortable:i,rootEl:d,name:"filter",targetEl:c,toEl:o,fromEl:o}),Ka("filter",i,{evt:n}),r&&n.cancelable&&n.preventDefault();return}}else if(u&&(u=u.split(",").some(function(h){if(h=iu(d,h.trim(),o,!1),h)return ja({sortable:i,rootEl:h,name:"filter",targetEl:c,fromEl:o,toEl:o}),Ka("filter",i,{evt:n}),!0}),u)){r&&n.cancelable&&n.preventDefault();return}l.handle&&!iu(d,l.handle,o,!1)||this._prepareDragStart(n,a,c)}}},_prepareDragStart:function(n,i,o){var l=this,r=l.el,s=l.options,a=r.ownerDocument,c;if(o&&!Mi&&o.parentNode===r){var d=sr(o);if(rr=r,Mi=o,Lr=Mi.parentNode,Ak=Mi.nextSibling,Ob=o,ww=s.group,co.dragged=Mi,bk={target:Mi,clientX:(i||n).clientX,clientY:(i||n).clientY},vte=bk.clientX-d.left,gte=bk.clientY-d.top,this._lastX=(i||n).clientX,this._lastY=(i||n).clientY,Mi.style["will-change"]="all",c=function(){if(Ka("delayEnded",l,{evt:n}),co.eventCanceled){l._onDrop();return}l._disableDelayedDragEvents(),!dte&&l.nativeDraggable&&(Mi.draggable=!0),l._triggerDragStart(n,i),ja({sortable:l,name:"choose",originalEvent:n}),kr(Mi,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){z8e(Mi,u.trim(),ST)}),Ko(a,"dragover",Ck),Ko(a,"mousemove",Ck),Ko(a,"touchmove",Ck),Ko(a,"mouseup",l._onDrop),Ko(a,"touchend",l._onDrop),Ko(a,"touchcancel",l._onDrop),dte&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Mi.draggable=!0),Ka("delayStart",this,{evt:n}),s.delay&&(!s.delayOnTouchOnly||i)&&(!this.nativeDraggable||!(W5||fh))){if(co.eventCanceled){this._onDrop();return}Ko(a,"mouseup",l._disableDelayedDrag),Ko(a,"touchend",l._disableDelayedDrag),Ko(a,"touchcancel",l._disableDelayedDrag),Ko(a,"mousemove",l._delayedDragTouchMoveHandler),Ko(a,"touchmove",l._delayedDragTouchMoveHandler),s.supportPointer&&Ko(a,"pointermove",l._delayedDragTouchMoveHandler),l._dragStartTimer=setTimeout(c,s.delay)}else c()}},_delayedDragTouchMoveHandler:function(n){var i=n.touches?n.touches[0]:n;Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Mi&&ST(Mi),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var n=this.el.ownerDocument;No(n,"mouseup",this._disableDelayedDrag),No(n,"touchend",this._disableDelayedDrag),No(n,"touchcancel",this._disableDelayedDrag),No(n,"mousemove",this._delayedDragTouchMoveHandler),No(n,"touchmove",this._delayedDragTouchMoveHandler),No(n,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(n,i){i=i||n.pointerType=="touch"&&n,!this.nativeDraggable||i?this.options.supportPointer?Ko(document,"pointermove",this._onTouchMove):i?Ko(document,"touchmove",this._onTouchMove):Ko(document,"mousemove",this._onTouchMove):(Ko(Mi,"dragend",this),Ko(rr,"dragstart",this._onDragStart));try{document.selection?Bb(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(n,i){if(u0=!1,rr&&Mi){Ka("dragStarted",this,{evt:i}),this.nativeDraggable&&Ko(document,"dragover",BSn);var o=this.options;!n&&kr(Mi,o.dragClass,!1),kr(Mi,o.ghostClass,!0),co.active=this,n&&this._appendGhost(),ja({sortable:this,name:"start",originalEvent:i})}else this._nulling()},_emulateDragOver:function(){if(eu){this._lastX=eu.clientX,this._lastY=eu.clientY,I8e();for(var n=document.elementFromPoint(eu.clientX,eu.clientY),i=n;n&&n.shadowRoot&&(n=n.shadowRoot.elementFromPoint(eu.clientX,eu.clientY),n!==i);)i=n;if(Mi.parentNode[ia]._isOutsideThisEl(n),i)do{if(i[ia]){var o=void 0;if(o=i[ia]._onDragOver({clientX:eu.clientX,clientY:eu.clientY,target:n,rootEl:i}),o&&!this.options.dragoverBubble)break}n=i}while(i=i.parentNode);N8e()}},_onTouchMove:function(n){if(bk){var i=this.options,o=i.fallbackTolerance,l=i.fallbackOffset,r=n.touches?n.touches[0]:n,s=Ho&&kf(Ho,!0),a=Ho&&s&&s.a,c=Ho&&s&&s.d,d=bw&&qs&&kte(qs),u=(r.clientX-bk.clientX+l.x)/(a||1)+(d?d[0]-AT[0]:0)/(a||1),h=(r.clientY-bk.clientY+l.y)/(c||1)+(d?d[1]-AT[1]:0)/(c||1);if(!co.active&&!u0){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))=0&&(ja({rootEl:Lr,name:"add",toEl:Lr,fromEl:rr,originalEvent:n}),ja({sortable:this,name:"remove",toEl:Lr,originalEvent:n}),ja({rootEl:Lr,name:"sort",toEl:Lr,fromEl:rr,originalEvent:n}),ja({sortable:this,name:"sort",toEl:Lr,originalEvent:n})),Ss&&Ss.save()):Vc!==j0&&Vc>=0&&(ja({sortable:this,name:"update",toEl:Lr,originalEvent:n}),ja({sortable:this,name:"sort",toEl:Lr,originalEvent:n})),co.active&&((Vc==null||Vc===-1)&&(Vc=j0,Gh=J9),ja({sortable:this,name:"end",toEl:Lr,originalEvent:n}),this.save()))),this._nulling()},_nulling:function(){Ka("nulling",this),rr=Mi=Lr=Ho=Ak=br=Ob=_h=bk=eu=s9=Vc=Gh=j0=J9=J3=Q9=Ss=ww=co.dragged=co.ghost=co.clone=co.active=null,Ay.forEach(function(n){n.checked=!0}),Ay.length=jT=MT=0},handleEvent:function(n){switch(n.type){case"drop":case"dragend":this._onDrop(n);break;case"dragenter":case"dragover":Mi&&(this._onDragOver(n),ISn(n));break;case"selectstart":n.preventDefault();break}},toArray:function(){for(var n=[],i,o=this.el.children,l=0,r=o.length,s=this.options;lo.right+l||e.clientX<=o.right&&e.clientY>o.bottom&&e.clientX>=o.left:e.clientX>o.right&&e.clientY>o.top||e.clientX<=o.right&&e.clientY>o.bottom+l}function ZSn(e,n,i,o,l,r,s,a){var c=o?e.clientY:e.clientX,d=o?i.height:i.width,u=o?i.top:i.left,h=o?i.bottom:i.right,g=!1;if(!s){if(a&&Vbu+d*r/2:ch-Vb)return-Q9}else if(c>u+d*(1-l)/2&&ch-d*r/2)?c>u+d/2?1:-1:0}function XSn(e){return yr(Mi)1&&(Ao.forEach(function(a){r.addAnimationState({target:a,rect:Ja?sr(a):s}),yT(a),a.fromRect=s,o.removeAnimationState(a)}),Ja=!1,QSn(!this.options.removeCloneOnHide,l))},dragOverCompleted:function(i){var o=i.sortable,l=i.isOwner,r=i.insertion,s=i.activeSortable,a=i.parentEl,c=i.putSortable,d=this.options;if(r){if(l&&s._hideClone(),Ig=!1,d.animation&&Ao.length>1&&(Ja||!l&&!s.options.sort&&!c)){var u=sr(Ul,!1,!0,!0);Ao.forEach(function(g){g!==Ul&&(fte(g,u),a.appendChild(g))}),Ja=!0}if(!l)if(Ja||xw(),Ao.length>1){var h=yw;s._showClone(o),s.options.animation&&!yw&&h&&Oc.forEach(function(g){s.addAnimationState({target:g,rect:Ng}),g.fromRect=Ng,g.thisAnimationDuration=null})}else s._showClone(o)}},dragOverAnimationCapture:function(i){var o=i.dragRect,l=i.isOwner,r=i.activeSortable;if(Ao.forEach(function(a){a.thisAnimationDuration=null}),r.options.animation&&!l&&r.multiDrag.isMultiDrag){Ng=Kd({},o);var s=kf(Ul,!0);Ng.top-=s.f,Ng.left-=s.e}},dragOverAnimationComplete:function(){Ja&&(Ja=!1,xw())},drop:function(i){var o=i.originalEvent,l=i.rootEl,r=i.parentEl,s=i.sortable,a=i.dispatchSortableEvent,c=i.oldIndex,d=i.putSortable,u=d||this.sortable;if(o){var h=this.options,g=r.children;if(!Q3)if(h.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),kr(Ul,h.selectedClass,!~Ao.indexOf(Ul)),~Ao.indexOf(Ul))Ao.splice(Ao.indexOf(Ul),1),Bg=null,r9({sortable:s,rootEl:l,name:"deselect",targetEl:Ul});else{if(Ao.push(Ul),r9({sortable:s,rootEl:l,name:"select",targetEl:Ul}),o.shiftKey&&Bg&&s.el.contains(Bg)){var v=yr(Bg),m=yr(Ul);if(~v&&~m&&v!==m){var k,f;for(m>v?(f=v,k=m):(f=m,k=v+1);f1){var w=sr(Ul),L=yr(Ul,":not(."+this.options.selectedClass+")");if(!Ig&&h.animation&&(Ul.thisAnimationDuration=null),u.captureAnimationState(),!Ig&&(h.animation&&(Ul.fromRect=w,Ao.forEach(function(C){if(C.thisAnimationDuration=null,C!==Ul){var y=Ja?sr(C):w;C.fromRect=y,u.addAnimationState({target:C,rect:y})}})),xw(),Ao.forEach(function(C){g[L]?r.insertBefore(C,g[L]):r.appendChild(C),L++}),c===yr(Ul))){var b=!1;Ao.forEach(function(C){if(C.sortableIndex!==yr(C)){b=!0;return}}),b&&a("update")}Ao.forEach(function(C){yT(C)}),u.animateAll()}tu=u}(l===r||d&&d.lastPutMode!=="clone")&&Oc.forEach(function(C){C.parentNode&&C.parentNode.removeChild(C)})}},nullingGlobal:function(){this.isMultiDrag=Q3=!1,Oc.length=0},destroyGlobal:function(){this._deselectMultiDrag(),No(document,"pointerup",this._deselectMultiDrag),No(document,"mouseup",this._deselectMultiDrag),No(document,"touchend",this._deselectMultiDrag),No(document,"keydown",this._checkKeyDown),No(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(i){if(!(typeof Q3<"u"&&Q3)&&tu===this.sortable&&!(i&&iu(i.target,this.options.draggable,this.sortable.el,!1))&&!(i&&i.button!==0))for(;Ao.length;){var o=Ao[0];kr(o,this.options.selectedClass,!1),Ao.shift(),r9({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:o})}},_checkKeyDown:function(i){i.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(i){i.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},Kd(e,{pluginName:"multiDrag",utils:{select:function(i){var o=i.parentNode[ia];!o||!o.options.multiDrag||~Ao.indexOf(i)||(tu&&tu!==o&&(tu.multiDrag._deselectMultiDrag(),tu=o),kr(i,o.options.selectedClass,!0),Ao.push(i))},deselect:function(i){var o=i.parentNode[ia],l=Ao.indexOf(i);!o||!o.options.multiDrag||!~l||(kr(i,o.options.selectedClass,!1),Ao.splice(l,1))}},eventProperties:function(){var i=this,o=[],l=[];return Ao.forEach(function(r){o.push({multiDragElement:r,index:r.sortableIndex});var s;Ja&&r!==Ul?s=-1:Ja?s=yr(r,":not(."+i.options.selectedClass+")"):s=yr(r),l.push({multiDragElement:r,index:s})}),{items:LSn(Ao),clones:[].concat(Oc),oldIndicies:o,newIndicies:l}},optionListeners:{multiDragKey:function(i){return i=i.toLowerCase(),i==="ctrl"?i="Control":i.length>1&&(i=i.charAt(0).toUpperCase()+i.substr(1)),i}}})}function QSn(e,n){Ao.forEach(function(i,o){var l=n.children[i.sortableIndex+(e?Number(o):0)];l?n.insertBefore(i,l):n.appendChild(i)})}function Lte(e,n){Oc.forEach(function(i,o){var l=n.children[i.sortableIndex+(e?Number(o):0)];l?n.insertBefore(i,l):n.appendChild(i)})}function xw(){Ao.forEach(function(e){e!==Ul&&e.parentNode&&e.parentNode.removeChild(e)})}co.mount(new YSn);co.mount(vF,fF);const $Sn=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:JSn,Sortable:co,Swap:qSn,default:co},Symbol.toStringTag,{value:"Module"})),_Sn=GO($Sn);(function(e,n){(function(o,l){e.exports=l(vSn,_Sn)})(typeof self<"u"?self:ho,function(i,o){return function(l){var r={};function s(a){if(r[a])return r[a].exports;var c=r[a]={i:a,l:!1,exports:{}};return l[a].call(c.exports,c,c.exports,s),c.l=!0,c.exports}return s.m=l,s.c=r,s.d=function(a,c,d){s.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},s.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},s.t=function(a,c){if(c&1&&(a=s(a)),c&8||c&4&&typeof a=="object"&&a&&a.__esModule)return a;var d=Object.create(null);if(s.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),c&2&&typeof a!="string")for(var u in a)s.d(d,u,(function(h){return a[h]}).bind(null,u));return d},s.n=function(a){var c=a&&a.__esModule?function(){return a.default}:function(){return a};return s.d(c,"a",c),c},s.o=function(a,c){return Object.prototype.hasOwnProperty.call(a,c)},s.p="",s(s.s="fb15")}({"00ee":function(l,r,s){var a=s("b622"),c=a("toStringTag"),d={};d[c]="z",l.exports=String(d)==="[object z]"},"0366":function(l,r,s){var a=s("1c0b");l.exports=function(c,d,u){if(a(c),d===void 0)return c;switch(u){case 0:return function(){return c.call(d)};case 1:return function(h){return c.call(d,h)};case 2:return function(h,g){return c.call(d,h,g)};case 3:return function(h,g,v){return c.call(d,h,g,v)}}return function(){return c.apply(d,arguments)}}},"057f":function(l,r,s){var a=s("fc6a"),c=s("241c").f,d={}.toString,u=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],h=function(g){try{return c(g)}catch{return u.slice()}};l.exports.f=function(v){return u&&d.call(v)=="[object Window]"?h(v):c(a(v))}},"06cf":function(l,r,s){var a=s("83ab"),c=s("d1e7"),d=s("5c6c"),u=s("fc6a"),h=s("c04e"),g=s("5135"),v=s("0cfb"),m=Object.getOwnPropertyDescriptor;r.f=a?m:function(f,w){if(f=u(f),w=h(w,!0),v)try{return m(f,w)}catch{}if(g(f,w))return d(!c.f.call(f,w),f[w])}},"0cfb":function(l,r,s){var a=s("83ab"),c=s("d039"),d=s("cc12");l.exports=!a&&!c(function(){return Object.defineProperty(d("div"),"a",{get:function(){return 7}}).a!=7})},"13d5":function(l,r,s){var a=s("23e7"),c=s("d58f").left,d=s("a640"),u=s("ae40"),h=d("reduce"),g=u("reduce",{1:0});a({target:"Array",proto:!0,forced:!h||!g},{reduce:function(m){return c(this,m,arguments.length,arguments.length>1?arguments[1]:void 0)}})},"14c3":function(l,r,s){var a=s("c6b6"),c=s("9263");l.exports=function(d,u){var h=d.exec;if(typeof h=="function"){var g=h.call(d,u);if(typeof g!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return g}if(a(d)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return c.call(d,u)}},"159b":function(l,r,s){var a=s("da84"),c=s("fdbc"),d=s("17c2"),u=s("9112");for(var h in c){var g=a[h],v=g&&g.prototype;if(v&&v.forEach!==d)try{u(v,"forEach",d)}catch{v.forEach=d}}},"17c2":function(l,r,s){var a=s("b727").forEach,c=s("a640"),d=s("ae40"),u=c("forEach"),h=d("forEach");l.exports=!u||!h?function(v){return a(this,v,arguments.length>1?arguments[1]:void 0)}:[].forEach},"1be4":function(l,r,s){var a=s("d066");l.exports=a("document","documentElement")},"1c0b":function(l,r){l.exports=function(s){if(typeof s!="function")throw TypeError(String(s)+" is not a function");return s}},"1c7e":function(l,r,s){var a=s("b622"),c=a("iterator"),d=!1;try{var u=0,h={next:function(){return{done:!!u++}},return:function(){d=!0}};h[c]=function(){return this},Array.from(h,function(){throw 2})}catch{}l.exports=function(g,v){if(!v&&!d)return!1;var m=!1;try{var k={};k[c]=function(){return{next:function(){return{done:m=!0}}}},g(k)}catch{}return m}},"1d80":function(l,r){l.exports=function(s){if(s==null)throw TypeError("Can't call method on "+s);return s}},"1dde":function(l,r,s){var a=s("d039"),c=s("b622"),d=s("2d00"),u=c("species");l.exports=function(h){return d>=51||!a(function(){var g=[],v=g.constructor={};return v[u]=function(){return{foo:1}},g[h](Boolean).foo!==1})}},"23cb":function(l,r,s){var a=s("a691"),c=Math.max,d=Math.min;l.exports=function(u,h){var g=a(u);return g<0?c(g+h,0):d(g,h)}},"23e7":function(l,r,s){var a=s("da84"),c=s("06cf").f,d=s("9112"),u=s("6eeb"),h=s("ce4e"),g=s("e893"),v=s("94ca");l.exports=function(m,k){var f=m.target,w=m.global,L=m.stat,b,C,y,x,M,S;if(w?C=a:L?C=a[f]||h(f,{}):C=(a[f]||{}).prototype,C)for(y in k){if(M=k[y],m.noTargetGet?(S=c(C,y),x=S&&S.value):x=C[y],b=v(w?y:f+(L?".":"#")+y,m.forced),!b&&x!==void 0){if(typeof M==typeof x)continue;g(M,x)}(m.sham||x&&x.sham)&&d(M,"sham",!0),u(C,y,M,m)}}},"241c":function(l,r,s){var a=s("ca84"),c=s("7839"),d=c.concat("length","prototype");r.f=Object.getOwnPropertyNames||function(h){return a(h,d)}},"25f0":function(l,r,s){var a=s("6eeb"),c=s("825a"),d=s("d039"),u=s("ad6d"),h="toString",g=RegExp.prototype,v=g[h],m=d(function(){return v.call({source:"a",flags:"b"})!="/a/b"}),k=v.name!=h;(m||k)&&a(RegExp.prototype,h,function(){var w=c(this),L=String(w.source),b=w.flags,C=String(b===void 0&&w instanceof RegExp&&!("flags"in g)?u.call(w):b);return"/"+L+"/"+C},{unsafe:!0})},"2ca0":function(l,r,s){var a=s("23e7"),c=s("06cf").f,d=s("50c4"),u=s("5a34"),h=s("1d80"),g=s("ab13"),v=s("c430"),m="".startsWith,k=Math.min,f=g("startsWith"),w=!v&&!f&&!!function(){var L=c(String.prototype,"startsWith");return L&&!L.writable}();a({target:"String",proto:!0,forced:!w&&!f},{startsWith:function(b){var C=String(h(this));u(b);var y=d(k(arguments.length>1?arguments[1]:void 0,C.length)),x=String(b);return m?m.call(C,x,y):C.slice(y,y+x.length)===x}})},"2d00":function(l,r,s){var a=s("da84"),c=s("342f"),d=a.process,u=d&&d.versions,h=u&&u.v8,g,v;h?(g=h.split("."),v=g[0]+g[1]):c&&(g=c.match(/Edge\/(\d+)/),(!g||g[1]>=74)&&(g=c.match(/Chrome\/(\d+)/),g&&(v=g[1]))),l.exports=v&&+v},"342f":function(l,r,s){var a=s("d066");l.exports=a("navigator","userAgent")||""},"35a1":function(l,r,s){var a=s("f5df"),c=s("3f8c"),d=s("b622"),u=d("iterator");l.exports=function(h){if(h!=null)return h[u]||h["@@iterator"]||c[a(h)]}},"37e8":function(l,r,s){var a=s("83ab"),c=s("9bf2"),d=s("825a"),u=s("df75");l.exports=a?Object.defineProperties:function(g,v){d(g);for(var m=u(v),k=m.length,f=0,w;k>f;)c.f(g,w=m[f++],v[w]);return g}},"3bbe":function(l,r,s){var a=s("861d");l.exports=function(c){if(!a(c)&&c!==null)throw TypeError("Can't set "+String(c)+" as a prototype");return c}},"3ca3":function(l,r,s){var a=s("6547").charAt,c=s("69f3"),d=s("7dd0"),u="String Iterator",h=c.set,g=c.getterFor(u);d(String,"String",function(v){h(this,{type:u,string:String(v),index:0})},function(){var m=g(this),k=m.string,f=m.index,w;return f>=k.length?{value:void 0,done:!0}:(w=a(k,f),m.index+=w.length,{value:w,done:!1})})},"3f8c":function(l,r){l.exports={}},4160:function(l,r,s){var a=s("23e7"),c=s("17c2");a({target:"Array",proto:!0,forced:[].forEach!=c},{forEach:c})},"428f":function(l,r,s){var a=s("da84");l.exports=a},"44ad":function(l,r,s){var a=s("d039"),c=s("c6b6"),d="".split;l.exports=a(function(){return!Object("z").propertyIsEnumerable(0)})?function(u){return c(u)=="String"?d.call(u,""):Object(u)}:Object},"44d2":function(l,r,s){var a=s("b622"),c=s("7c73"),d=s("9bf2"),u=a("unscopables"),h=Array.prototype;h[u]==null&&d.f(h,u,{configurable:!0,value:c(null)}),l.exports=function(g){h[u][g]=!0}},"44e7":function(l,r,s){var a=s("861d"),c=s("c6b6"),d=s("b622"),u=d("match");l.exports=function(h){var g;return a(h)&&((g=h[u])!==void 0?!!g:c(h)=="RegExp")}},4930:function(l,r,s){var a=s("d039");l.exports=!!Object.getOwnPropertySymbols&&!a(function(){return!String(Symbol())})},"4d64":function(l,r,s){var a=s("fc6a"),c=s("50c4"),d=s("23cb"),u=function(h){return function(g,v,m){var k=a(g),f=c(k.length),w=d(m,f),L;if(h&&v!=v){for(;f>w;)if(L=k[w++],L!=L)return!0}else for(;f>w;w++)if((h||w in k)&&k[w]===v)return h||w||0;return!h&&-1}};l.exports={includes:u(!0),indexOf:u(!1)}},"4de4":function(l,r,s){var a=s("23e7"),c=s("b727").filter,d=s("1dde"),u=s("ae40"),h=d("filter"),g=u("filter");a({target:"Array",proto:!0,forced:!h||!g},{filter:function(m){return c(this,m,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(l,r,s){var a=s("0366"),c=s("7b0b"),d=s("9bdd"),u=s("e95a"),h=s("50c4"),g=s("8418"),v=s("35a1");l.exports=function(k){var f=c(k),w=typeof this=="function"?this:Array,L=arguments.length,b=L>1?arguments[1]:void 0,C=b!==void 0,y=v(f),x=0,M,S,W,H,O,D;if(C&&(b=a(b,L>2?arguments[2]:void 0,2)),y!=null&&!(w==Array&&u(y)))for(H=y.call(f),O=H.next,S=new w;!(W=O.call(H)).done;x++)D=C?d(H,b,[W.value,x],!0):W.value,g(S,x,D);else for(M=h(f.length),S=new w(M);M>x;x++)D=C?b(f[x],x):f[x],g(S,x,D);return S.length=x,S}},"4fad":function(l,r,s){var a=s("23e7"),c=s("6f53").entries;a({target:"Object",stat:!0},{entries:function(u){return c(u)}})},"50c4":function(l,r,s){var a=s("a691"),c=Math.min;l.exports=function(d){return d>0?c(a(d),9007199254740991):0}},5135:function(l,r){var s={}.hasOwnProperty;l.exports=function(a,c){return s.call(a,c)}},5319:function(l,r,s){var a=s("d784"),c=s("825a"),d=s("7b0b"),u=s("50c4"),h=s("a691"),g=s("1d80"),v=s("8aa5"),m=s("14c3"),k=Math.max,f=Math.min,w=Math.floor,L=/\$([$&'`]|\d\d?|<[^>]*>)/g,b=/\$([$&'`]|\d\d?)/g,C=function(y){return y===void 0?y:String(y)};a("replace",2,function(y,x,M,S){var W=S.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,H=S.REPLACE_KEEPS_$0,O=W?"$":"$0";return[function(V,F){var B=g(this),T=V==null?void 0:V[y];return T!==void 0?T.call(V,B,F):x.call(String(B),V,F)},function(z,V){if(!W&&H||typeof V=="string"&&V.indexOf(O)===-1){var F=M(x,z,this,V);if(F.done)return F.value}var B=c(z),T=String(this),E=typeof V=="function";E||(V=String(V));var X=B.global;if(X){var Z=B.unicode;B.lastIndex=0}for(var R=[];;){var q=m(B,T);if(q===null||(R.push(q),!X))break;var Y=String(q[0]);Y===""&&(B.lastIndex=v(T,u(B.lastIndex),Z))}for(var K="",Q=0,p=0;p=Q&&(K+=T.slice(Q,oe)+ee,Q=oe+J.length)}return K+T.slice(Q)}];function D(z,V,F,B,T,E){var X=F+z.length,Z=B.length,R=b;return T!==void 0&&(T=d(T),R=L),x.call(E,R,function(q,Y){var K;switch(Y.charAt(0)){case"$":return"$";case"&":return z;case"`":return V.slice(0,F);case"'":return V.slice(X);case"<":K=T[Y.slice(1,-1)];break;default:var Q=+Y;if(Q===0)return q;if(Q>Z){var p=w(Q/10);return p===0?q:p<=Z?B[p-1]===void 0?Y.charAt(1):B[p-1]+Y.charAt(1):q}K=B[Q-1]}return K===void 0?"":K})}})},5692:function(l,r,s){var a=s("c430"),c=s("c6cd");(l.exports=function(d,u){return c[d]||(c[d]=u!==void 0?u:{})})("versions",[]).push({version:"3.6.5",mode:a?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(l,r,s){var a=s("d066"),c=s("241c"),d=s("7418"),u=s("825a");l.exports=a("Reflect","ownKeys")||function(g){var v=c.f(u(g)),m=d.f;return m?v.concat(m(g)):v}},"5a34":function(l,r,s){var a=s("44e7");l.exports=function(c){if(a(c))throw TypeError("The method doesn't accept regular expressions");return c}},"5c6c":function(l,r){l.exports=function(s,a){return{enumerable:!(s&1),configurable:!(s&2),writable:!(s&4),value:a}}},"5db7":function(l,r,s){var a=s("23e7"),c=s("a2bf"),d=s("7b0b"),u=s("50c4"),h=s("1c0b"),g=s("65f0");a({target:"Array",proto:!0},{flatMap:function(m){var k=d(this),f=u(k.length),w;return h(m),w=g(k,0),w.length=c(w,k,k,f,0,1,m,arguments.length>1?arguments[1]:void 0),w}})},6547:function(l,r,s){var a=s("a691"),c=s("1d80"),d=function(u){return function(h,g){var v=String(c(h)),m=a(g),k=v.length,f,w;return m<0||m>=k?u?"":void 0:(f=v.charCodeAt(m),f<55296||f>56319||m+1===k||(w=v.charCodeAt(m+1))<56320||w>57343?u?v.charAt(m):f:u?v.slice(m,m+2):(f-55296<<10)+(w-56320)+65536)}};l.exports={codeAt:d(!1),charAt:d(!0)}},"65f0":function(l,r,s){var a=s("861d"),c=s("e8b5"),d=s("b622"),u=d("species");l.exports=function(h,g){var v;return c(h)&&(v=h.constructor,typeof v=="function"&&(v===Array||c(v.prototype))?v=void 0:a(v)&&(v=v[u],v===null&&(v=void 0))),new(v===void 0?Array:v)(g===0?0:g)}},"69f3":function(l,r,s){var a=s("7f9a"),c=s("da84"),d=s("861d"),u=s("9112"),h=s("5135"),g=s("f772"),v=s("d012"),m=c.WeakMap,k,f,w,L=function(W){return w(W)?f(W):k(W,{})},b=function(W){return function(H){var O;if(!d(H)||(O=f(H)).type!==W)throw TypeError("Incompatible receiver, "+W+" required");return O}};if(a){var C=new m,y=C.get,x=C.has,M=C.set;k=function(W,H){return M.call(C,W,H),H},f=function(W){return y.call(C,W)||{}},w=function(W){return x.call(C,W)}}else{var S=g("state");v[S]=!0,k=function(W,H){return u(W,S,H),H},f=function(W){return h(W,S)?W[S]:{}},w=function(W){return h(W,S)}}l.exports={set:k,get:f,has:w,enforce:L,getterFor:b}},"6eeb":function(l,r,s){var a=s("da84"),c=s("9112"),d=s("5135"),u=s("ce4e"),h=s("8925"),g=s("69f3"),v=g.get,m=g.enforce,k=String(String).split("String");(l.exports=function(f,w,L,b){var C=b?!!b.unsafe:!1,y=b?!!b.enumerable:!1,x=b?!!b.noTargetGet:!1;if(typeof L=="function"&&(typeof w=="string"&&!d(L,"name")&&c(L,"name",w),m(L).source=k.join(typeof w=="string"?w:"")),f===a){y?f[w]=L:u(w,L);return}else C?!x&&f[w]&&(y=!0):delete f[w];y?f[w]=L:c(f,w,L)})(Function.prototype,"toString",function(){return typeof this=="function"&&v(this).source||h(this)})},"6f53":function(l,r,s){var a=s("83ab"),c=s("df75"),d=s("fc6a"),u=s("d1e7").f,h=function(g){return function(v){for(var m=d(v),k=c(m),f=k.length,w=0,L=[],b;f>w;)b=k[w++],(!a||u.call(m,b))&&L.push(g?[b,m[b]]:m[b]);return L}};l.exports={entries:h(!0),values:h(!1)}},"73d9":function(l,r,s){var a=s("44d2");a("flatMap")},7418:function(l,r){r.f=Object.getOwnPropertySymbols},"746f":function(l,r,s){var a=s("428f"),c=s("5135"),d=s("e538"),u=s("9bf2").f;l.exports=function(h){var g=a.Symbol||(a.Symbol={});c(g,h)||u(g,h,{value:d.f(h)})}},7839:function(l,r){l.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(l,r,s){var a=s("1d80");l.exports=function(c){return Object(a(c))}},"7c73":function(l,r,s){var a=s("825a"),c=s("37e8"),d=s("7839"),u=s("d012"),h=s("1be4"),g=s("cc12"),v=s("f772"),m=">",k="<",f="prototype",w="script",L=v("IE_PROTO"),b=function(){},C=function(W){return k+w+m+W+k+"/"+w+m},y=function(W){W.write(C("")),W.close();var H=W.parentWindow.Object;return W=null,H},x=function(){var W=g("iframe"),H="java"+w+":",O;return W.style.display="none",h.appendChild(W),W.src=String(H),O=W.contentWindow.document,O.open(),O.write(C("document.F=Object")),O.close(),O.F},M,S=function(){try{M=document.domain&&new ActiveXObject("htmlfile")}catch{}S=M?y(M):x();for(var W=d.length;W--;)delete S[f][d[W]];return S()};u[L]=!0,l.exports=Object.create||function(H,O){var D;return H!==null?(b[f]=a(H),D=new b,b[f]=null,D[L]=H):D=S(),O===void 0?D:c(D,O)}},"7dd0":function(l,r,s){var a=s("23e7"),c=s("9ed3"),d=s("e163"),u=s("d2bb"),h=s("d44e"),g=s("9112"),v=s("6eeb"),m=s("b622"),k=s("c430"),f=s("3f8c"),w=s("ae93"),L=w.IteratorPrototype,b=w.BUGGY_SAFARI_ITERATORS,C=m("iterator"),y="keys",x="values",M="entries",S=function(){return this};l.exports=function(W,H,O,D,z,V,F){c(O,H,D);var B=function(p){if(p===z&&R)return R;if(!b&&p in X)return X[p];switch(p){case y:return function(){return new O(this,p)};case x:return function(){return new O(this,p)};case M:return function(){return new O(this,p)}}return function(){return new O(this)}},T=H+" Iterator",E=!1,X=W.prototype,Z=X[C]||X["@@iterator"]||z&&X[z],R=!b&&Z||B(z),q=H=="Array"&&X.entries||Z,Y,K,Q;if(q&&(Y=d(q.call(new W)),L!==Object.prototype&&Y.next&&(!k&&d(Y)!==L&&(u?u(Y,L):typeof Y[C]!="function"&&g(Y,C,S)),h(Y,T,!0,!0),k&&(f[T]=S))),z==x&&Z&&Z.name!==x&&(E=!0,R=function(){return Z.call(this)}),(!k||F)&&X[C]!==R&&g(X,C,R),f[H]=R,z)if(K={values:B(x),keys:V?R:B(y),entries:B(M)},F)for(Q in K)(b||E||!(Q in X))&&v(X,Q,K[Q]);else a({target:H,proto:!0,forced:b||E},K);return K}},"7f9a":function(l,r,s){var a=s("da84"),c=s("8925"),d=a.WeakMap;l.exports=typeof d=="function"&&/native code/.test(c(d))},"825a":function(l,r,s){var a=s("861d");l.exports=function(c){if(!a(c))throw TypeError(String(c)+" is not an object");return c}},"83ab":function(l,r,s){var a=s("d039");l.exports=!a(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},8418:function(l,r,s){var a=s("c04e"),c=s("9bf2"),d=s("5c6c");l.exports=function(u,h,g){var v=a(h);v in u?c.f(u,v,d(0,g)):u[v]=g}},"861d":function(l,r){l.exports=function(s){return typeof s=="object"?s!==null:typeof s=="function"}},8875:function(l,r,s){var a,c,d;(function(u,h){c=[],a=h,d=typeof a=="function"?a.apply(r,c):a,d!==void 0&&(l.exports=d)})(typeof self<"u"?self:this,function(){function u(){var h=Object.getOwnPropertyDescriptor(document,"currentScript");if(!h&&"currentScript"in document&&document.currentScript||h&&h.get!==u&&document.currentScript)return document.currentScript;try{throw new Error}catch(M){var g=/.*at [^(]*\((.*):(.+):(.+)\)$/ig,v=/@([^@]*):(\d+):(\d+)\s*$/ig,m=g.exec(M.stack)||v.exec(M.stack),k=m&&m[1]||!1,f=m&&m[2]||!1,w=document.location.href.replace(document.location.hash,""),L,b,C,y=document.getElementsByTagName("script");k===w&&(L=document.documentElement.outerHTML,b=new RegExp("(?:[^\\n]+?\\n){0,"+(f-2)+"}[^<]* +
diff --git a/src/agents/storyboard/index.ts b/src/agents/storyboard/index.ts index a555c7e..308985f 100644 --- a/src/agents/storyboard/index.ts +++ b/src/agents/storyboard/index.ts @@ -6,6 +6,8 @@ import { z } from "zod"; import type { DB } from "@/types/database"; import generateImageTool from "./generateImageTool"; import imageSplitting from "./imageSplitting"; +import path from "path"; +import sharp from "sharp"; // ==================== 类型定义 ==================== @@ -240,9 +242,11 @@ ${sections.join("\n\n")} const skipped: number[] = []; for (const item of shots) { - const exists = this.shots.some((f) => f.segmentId === item.segmentIndex); + const resultIndex = item.segmentIndex - 1; + + const exists = this.shots.some((f) => f.segmentId === resultIndex); if (exists) { - skipped.push(item.segmentIndex); + skipped.push(resultIndex); continue; } // 分配独立的分镜ID @@ -250,15 +254,15 @@ ${sections.join("\n\n")} const shotId = this.shotIdCounter; this.shots.push({ id: shotId, - segmentId: item.segmentIndex, + segmentId: resultIndex, title: `分镜 ${shotId}`, x: 0, y: 0, cells: item.prompts.map((prompt) => ({ id: u.uuid(), prompt })), - fragmentContent: this.segments[item.segmentIndex]?.description, + fragmentContent: this.segments[resultIndex]?.description, assetsTags: item.assetsTags, }); - added.push({ id: shotId, segmentIndex: item.segmentIndex }); + added.push({ id: shotId, segmentIndex: resultIndex }); } const addedInfo = added.map((a) => `分镜${a.id}(片段${a.segmentIndex})`).join(", "); @@ -442,7 +446,6 @@ ${sections.join("\n\n")} this.scriptId, this.projectId, ); - // 通知前端正在分割图片 this.emit("shotImageGenerateProgress", { shotId, status: "splitting", message: "正在分割宫格图片为单张镜头图" }); diff --git a/src/lib/initDB.ts b/src/lib/initDB.ts index d281a3f..ec89e5e 100644 --- a/src/lib/initDB.ts +++ b/src/lib/initDB.ts @@ -151,6 +151,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => table.text("firstFrame"); table.text("storyboardImgs"); table.text("model"); + table.text("errorReason"); table.integer("time"); table.integer("state"); table.integer("scriptId"); diff --git a/src/router.ts b/src/router.ts index b0c9207..ae73206 100644 --- a/src/router.ts +++ b/src/router.ts @@ -1,4 +1,4 @@ -// @routes-hash df8fc2bdd69f6bbf900ca75396098390 +// @routes-hash 3cfad40b3c8658b442ab766a9323d740 import { Express } from "express"; import route1 from "./routes/assets/addAssets"; @@ -50,32 +50,34 @@ import route46 from "./routes/setting/delModel"; import route47 from "./routes/setting/getAiModelMap"; import route48 from "./routes/setting/getLog"; import route49 from "./routes/setting/getSetting"; -import route50 from "./routes/setting/updeteModel"; -import route51 from "./routes/storyboard/batchSuperScoreImage"; -import route52 from "./routes/storyboard/chatStoryboard"; -import route53 from "./routes/storyboard/generateShotImage"; -import route54 from "./routes/storyboard/generateStoryboardApi"; -import route55 from "./routes/storyboard/generateVideoPrompt"; -import route56 from "./routes/storyboard/getStoryboard"; -import route57 from "./routes/storyboard/keepStoryboard"; -import route58 from "./routes/storyboard/saveStoryboard"; -import route59 from "./routes/storyboard/uploadImage"; -import route60 from "./routes/task/getTaskApi"; -import route61 from "./routes/task/taskDetails"; -import route62 from "./routes/user/getUser"; -import route63 from "./routes/video/addVideo"; -import route64 from "./routes/video/addVideoConfig"; -import route65 from "./routes/video/deleteVideoConfig"; -import route66 from "./routes/video/generatePrompt"; -import route67 from "./routes/video/generateVideo"; -import route68 from "./routes/video/getManufacturer"; -import route69 from "./routes/video/getVideo"; -import route70 from "./routes/video/getVideoConfigs"; -import route71 from "./routes/video/getVideoModel"; -import route72 from "./routes/video/getVideoStoryboards"; -import route73 from "./routes/video/reviseVideoStoryboards"; -import route74 from "./routes/video/saveVideo"; -import route75 from "./routes/video/upDateVideoConfig"; +import route50 from "./routes/setting/getVideoModelList"; +import route51 from "./routes/setting/updateModel"; +import route52 from "./routes/setting/updeteModel"; +import route53 from "./routes/storyboard/batchSuperScoreImage"; +import route54 from "./routes/storyboard/chatStoryboard"; +import route55 from "./routes/storyboard/generateShotImage"; +import route56 from "./routes/storyboard/generateStoryboardApi"; +import route57 from "./routes/storyboard/generateVideoPrompt"; +import route58 from "./routes/storyboard/getStoryboard"; +import route59 from "./routes/storyboard/keepStoryboard"; +import route60 from "./routes/storyboard/saveStoryboard"; +import route61 from "./routes/storyboard/uploadImage"; +import route62 from "./routes/task/getTaskApi"; +import route63 from "./routes/task/taskDetails"; +import route64 from "./routes/user/getUser"; +import route65 from "./routes/video/addVideo"; +import route66 from "./routes/video/addVideoConfig"; +import route67 from "./routes/video/deleteVideoConfig"; +import route68 from "./routes/video/generatePrompt"; +import route69 from "./routes/video/generateVideo"; +import route70 from "./routes/video/getManufacturer"; +import route71 from "./routes/video/getVideo"; +import route72 from "./routes/video/getVideoConfigs"; +import route73 from "./routes/video/getVideoModel"; +import route74 from "./routes/video/getVideoStoryboards"; +import route75 from "./routes/video/reviseVideoStoryboards"; +import route76 from "./routes/video/saveVideo"; +import route77 from "./routes/video/upDateVideoConfig"; export default async (app: Express) => { app.use("/assets/addAssets", route1); @@ -127,30 +129,32 @@ export default async (app: Express) => { app.use("/setting/getAiModelMap", route47); app.use("/setting/getLog", route48); app.use("/setting/getSetting", route49); - app.use("/setting/updeteModel", route50); - app.use("/storyboard/batchSuperScoreImage", route51); - app.use("/storyboard/chatStoryboard", route52); - app.use("/storyboard/generateShotImage", route53); - app.use("/storyboard/generateStoryboardApi", route54); - app.use("/storyboard/generateVideoPrompt", route55); - app.use("/storyboard/getStoryboard", route56); - app.use("/storyboard/keepStoryboard", route57); - app.use("/storyboard/saveStoryboard", route58); - app.use("/storyboard/uploadImage", route59); - app.use("/task/getTaskApi", route60); - app.use("/task/taskDetails", route61); - app.use("/user/getUser", route62); - app.use("/video/addVideo", route63); - app.use("/video/addVideoConfig", route64); - app.use("/video/deleteVideoConfig", route65); - app.use("/video/generatePrompt", route66); - app.use("/video/generateVideo", route67); - app.use("/video/getManufacturer", route68); - app.use("/video/getVideo", route69); - app.use("/video/getVideoConfigs", route70); - app.use("/video/getVideoModel", route71); - app.use("/video/getVideoStoryboards", route72); - app.use("/video/reviseVideoStoryboards", route73); - app.use("/video/saveVideo", route74); - app.use("/video/upDateVideoConfig", route75); + app.use("/setting/getVideoModelList", route50); + app.use("/setting/updateModel", route51); + app.use("/setting/updeteModel", route52); + app.use("/storyboard/batchSuperScoreImage", route53); + app.use("/storyboard/chatStoryboard", route54); + app.use("/storyboard/generateShotImage", route55); + app.use("/storyboard/generateStoryboardApi", route56); + app.use("/storyboard/generateVideoPrompt", route57); + app.use("/storyboard/getStoryboard", route58); + app.use("/storyboard/keepStoryboard", route59); + app.use("/storyboard/saveStoryboard", route60); + app.use("/storyboard/uploadImage", route61); + app.use("/task/getTaskApi", route62); + app.use("/task/taskDetails", route63); + app.use("/user/getUser", route64); + app.use("/video/addVideo", route65); + app.use("/video/addVideoConfig", route66); + app.use("/video/deleteVideoConfig", route67); + app.use("/video/generatePrompt", route68); + app.use("/video/generateVideo", route69); + app.use("/video/getManufacturer", route70); + app.use("/video/getVideo", route71); + app.use("/video/getVideoConfigs", route72); + app.use("/video/getVideoModel", route73); + app.use("/video/getVideoStoryboards", route74); + app.use("/video/reviseVideoStoryboards", route75); + app.use("/video/saveVideo", route76); + app.use("/video/upDateVideoConfig", route77); } diff --git a/src/routes/setting/getSetting.ts b/src/routes/setting/getSetting.ts index e004d7a..fb7a6a9 100644 --- a/src/routes/setting/getSetting.ts +++ b/src/routes/setting/getSetting.ts @@ -5,7 +5,7 @@ const router = express.Router(); export default router.post("/", async (req, res) => { const userId = 1; - const configData = await u.db("t_config").where("userId", userId).select("*"); + const configData = await u.db("t_config").where("type","<>","video").where("userId", userId).select("*"); res.status(200).send(success(configData)); }); diff --git a/src/routes/setting/getVideoModelList.ts b/src/routes/setting/getVideoModelList.ts new file mode 100644 index 0000000..4ec6c82 --- /dev/null +++ b/src/routes/setting/getVideoModelList.ts @@ -0,0 +1,11 @@ +import express from "express"; +import u from "@/utils"; +import { success } from "@/lib/responseFormat"; +const router = express.Router(); + +export default router.post("/", async (req, res) => { + const userId = 1; + const configData = await u.db("t_config").where("type","video").where("userId", userId).select("*"); + + res.status(200).send(success(configData)); +}); diff --git a/src/routes/setting/updateModel.ts b/src/routes/setting/updateModel.ts new file mode 100644 index 0000000..421a06d --- /dev/null +++ b/src/routes/setting/updateModel.ts @@ -0,0 +1,32 @@ +import express from "express"; +import u from "@/utils"; +import { z } from "zod"; +import { success } from "@/lib/responseFormat"; +import { validateFields } from "@/middleware/middleware"; +const router = express.Router(); + +export default router.post( + "/", + validateFields({ + id: z.number(), + type: z.enum(["text", "video", "image"]), + model: z.string(), + baseUrl: z.string(), + modelType: z.string(), + apiKey: z.string(), + manufacturer: z.string(), + }), + async (req, res) => { + const { id, type, model, baseUrl, apiKey, manufacturer, modelType } = req.body; + + await u.db("t_config").where("id", id).update({ + type, + model, + baseUrl, + apiKey, + manufacturer, + modelType, + }); + res.status(200).send(success("编辑成功")); + }, +); diff --git a/src/routes/video/generateVideo.ts b/src/routes/video/generateVideo.ts index fd976d6..e0b1b5b 100644 --- a/src/routes/video/generateVideo.ts +++ b/src/routes/video/generateVideo.ts @@ -196,7 +196,10 @@ ${prompt} } } catch (err) { console.error(`视频生成失败 videoId=${videoId}:`, err); - await u.db("t_video").where("id", videoId).update({ state: -1 }); + await u + .db("t_video") + .where("id", videoId) + .update({ state: -1, errorReason: u.error(err).message }); } } diff --git a/src/routes/video/getVideo.ts b/src/routes/video/getVideo.ts index 14acde3..a381cb0 100644 --- a/src/routes/video/getVideo.ts +++ b/src/routes/video/getVideo.ts @@ -28,7 +28,7 @@ export default router.post( qb.whereIn("id", specifyIds); } }) - .select("id", "configId", "time", "resolution", "prompt", "firstFrame", "filePath", "storyboardImgs", "model", "scriptId", "state"); + .select("id", "configId", "time", "resolution", "prompt", "firstFrame", "filePath", "storyboardImgs", "model", "scriptId", "state","errorReason"); // const videoIds: number[] = videos.map((video: any) => (typeof video.id === "string" ? parseInt(video.id) : video.id)); // let tempAssets: TempAsset[] = await u diff --git a/src/types/database.d.ts b/src/types/database.d.ts index e19087b..2877e0d 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,6 +1,20 @@ -// @db-hash b175910ce89abacc2636f298095b06c3 +// @db-hash 5de69fa13b58ac3b447664cb6faa9e8a //该文件由脚本自动生成,请勿手动修改 +export interface _t_video_old_20260210 { + 'aiConfigId'?: number | null; + 'configId'?: number | null; + 'filePath'?: string | null; + 'firstFrame'?: string | null; + 'id'?: number; + 'model'?: string | null; + 'prompt'?: string | null; + 'resolution'?: string | null; + 'scriptId'?: number | null; + 'state'?: number | null; + 'storyboardImgs'?: string | null; + 'time'?: number | null; +} export interface t_aiModelMap { 'configId'?: number | null; 'id'?: number; @@ -125,6 +139,7 @@ export interface t_user { export interface t_video { 'aiConfigId'?: number | null; 'configId'?: number | null; + 'errorReason'?: string | null; 'filePath'?: string | null; 'firstFrame'?: string | null; 'id'?: number; @@ -156,6 +171,7 @@ export interface t_videoConfig { } export interface DB { + "_t_video_old_20260210": _t_video_old_20260210; "t_aiModelMap": t_aiModelMap; "t_assets": t_assets; "t_chatHistory": t_chatHistory; diff --git a/src/utils/ai/image/owned/other.ts b/src/utils/ai/image/owned/other.ts index 83e1df6..067a0f5 100644 --- a/src/utils/ai/image/owned/other.ts +++ b/src/utils/ai/image/owned/other.ts @@ -1,6 +1,7 @@ import "../type"; import { generateImage, generateText, ModelMessage } from "ai"; import { createOpenAICompatible } from "@ai-sdk/openai-compatible"; +import axios from "axios"; export default async (input: ImageConfig, config: AIConfig): Promise => { if (!config.model) throw new Error("缺少Model名称"); @@ -67,11 +68,26 @@ export default async (input: ImageConfig, config: AIConfig): Promise => console.error(JSON.stringify(result.response, null, 2)); throw new Error("图片生成失败"); } - const match = result.text.match(/base64,([A-Za-z0-9+/=]+)/); - const base64Str = match && match[1] ? match[1] : result.text; - - // 返回生成的图片 base64 - return "data:image/jpeg;base64," + base64Str!; + const mdMatch = result.text.match(/^!\[.*?\]\((.+?)\)$/); + if (mdMatch) { + const imgInfo = mdMatch[1]; + const base64InMd = imgInfo.match(/data:image\/[a-z]+;base64,(.+)/); + if (base64InMd) { + return imgInfo; + } else { + return await urlToBase64(imgInfo); + } + } + const base64Match = result.text.match(/base64,([A-Za-z0-9+/=]+)/); + if (base64Match) { + return "data:image/jpeg;base64," + base64Match[1]; + } + // 检查是否为图片直链 url + if (/^https?:\/\/.*\.(png|jpg|jpeg|gif|webp|bmp)$/i.test(result.text)) { + return await urlToBase64(result.text); + } + // 默认情况 + return result.text; } } else { const { image } = await generateImage({ @@ -87,3 +103,10 @@ export default async (input: ImageConfig, config: AIConfig): Promise => return image.base64; } }; + +async function urlToBase64(url: string): Promise { + const res = await axios.get(url, { responseType: "arraybuffer" }); + const base64 = Buffer.from(res.data).toString("base64"); + const mimeType = res.headers["content-type"] || "image/png"; + return `data:${mimeType};base64,${base64}`; +} diff --git a/src/utils/ai/video/owned/other.ts b/src/utils/ai/video/owned/other.ts index f148e19..3d4004d 100644 --- a/src/utils/ai/video/owned/other.ts +++ b/src/utils/ai/video/owned/other.ts @@ -4,11 +4,12 @@ import sharp from "sharp"; import FormData from "form-data"; import { pollTask, validateVideoConfig } from "@/utils/ai/utils"; import { createOpenAI } from "@ai-sdk/openai"; -import { experimental_generateVideo as generateVideo } from "ai"; + export default async (input: VideoConfig, config: AIConfig) => { if (!config.apiKey) throw new Error("缺少API Key"); if (!config.baseURL) throw new Error("缺少baseURL"); // const { owned, images, hasTextType } = validateVideoConfig(input, config); + const [requestUrl, queryUrl] = config.baseURL.split("|"); const authorization = `Bearer ${config.apiKey}`; @@ -20,39 +21,30 @@ export default async (input: VideoConfig, config: AIConfig) => { // 根据 aspectRatio 设置 size const sizeMap: Record = { - "16:9": "1280x720", - "9:16": "720x1280", + "16:9": "1920x1080", + "9:16": "1080x1920", }; formData.append("size", sizeMap[input.aspectRatio] || "1920x1080"); - if (input.imageBase64 && input.imageBase64.length) { const base64Data = input.imageBase64[0]!.replace(/^data:image\/\w+;base64,/, ""); const buffer = Buffer.from(base64Data, "base64"); formData.append("input_reference", buffer, { filename: "image.jpg", contentType: "image/jpeg" }); } - - const body = { - model: "sora-2-all", - messages: [ - { - role: "user", - content: [ - { - type: "text", - text: input.prompt, - }, - ], - }, - ], - }; - const { data } = await axios.post( - "https://api2.aigcbest.top/v1/chat/completions", - { ...body }, - { - headers: { "Content-Type": "application/json", Authorization: authorization }, - }, - ); - - + const { data } = await axios.post(requestUrl, formData, { + headers: { "Content-Type": "application/json", Authorization: authorization, ...formData.getHeaders() }, + }); if (data.status === "FAILED") throw new Error(`任务提交失败: ${data.errorMessage || "未知错误"}`); + const taskId = data.id; + return await pollTask(async () => { + const { data } = await axios.get(`${queryUrl.replace("{id}", taskId)}`, { + headers: { Authorization: authorization }, + }); + + if (data.status === "SUCCESS") { + return data.results?.length ? { completed: true, url: data.results[0].url } : { completed: false, error: "任务成功但未返回视频链接" }; + } + if (data.status === "FAILED") return { completed: false, error: `任务失败: ${data.errorMessage || "未知错误"}` }; + if (data.status === "QUEUED" || data.status === "RUNNING") return { completed: false }; + return { completed: false, error: `未知状态: ${data.status}` }; + }); }; From 78c673eaed1433d263f52347dac7375ab7c9cdb4 Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Tue, 10 Feb 2026 16:37:08 +0800 Subject: [PATCH 2/2] no message --- src/lib/fixDB.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/fixDB.ts b/src/lib/fixDB.ts index 285f906..d09991f 100644 --- a/src/lib/fixDB.ts +++ b/src/lib/fixDB.ts @@ -26,6 +26,7 @@ export default async (knex: Knex): Promise => { await addColumn("t_video", "aiConfigId", "integer"); await addColumn("t_config", "modelType", "text"); await addColumn("t_videoConfig", "audioEnabled", "integer"); + await addColumn("t_videoConfig", "errorReason", "text"); //更正字段 await alterColumnType("t_config", "modelType", "text");