-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2-es2015.77695f4121a196c0697c.js
1 lines (1 loc) · 15.1 KB
/
2-es2015.77695f4121a196c0697c.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"8/JR":function(e,t,n){"use strict";var r=n("8T9/"),o=n("Ibf7");e.exports=function(e,t){var n=t||{},i={};return void 0===e&&(e={}),e.on=function(t,n){return i[t]?i[t].push(n):i[t]=[n],e},e.once=function(t,n){return n._once=!0,e.on(t,n),e},e.off=function(t,n){var r=arguments.length;if(1===r)delete i[t];else if(0===r)i={};else{var o=i[t];if(!o)return e;o.splice(o.indexOf(n),1)}return e},e.emit=function(){var t=r(arguments);return e.emitterSnapshot(t.shift()).apply(this,t)},e.emitterSnapshot=function(t){var a=(i[t]||[]).slice(0);return function(){var i=r(arguments),c=this||e;if("error"===t&&!1!==n.throws&&!a.length)throw 1===i.length?i[0]:i;return a.forEach((function(r){n.async?o(r,i,c):r.apply(c,i),r._once&&e.off(t,r)})),e}},e}},"8T9/":function(e,t){e.exports=function(e,t){return Array.prototype.slice.call(e,t)}},"9Ejp":function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"c",(function(){return g})),n.d(t,"b",(function(){return y}));var r=n("YS7c"),o=n.n(r),i=n("fXoL"),a=n("XNiG"),c=n("quSY"),s=n("pLZG"),u=n("lJxs");class l{constructor(e,t,n){this.name=e,this.drake=t,this.options=n,this.initEvents=!1}}const d={Cancel:"cancel",Cloned:"cloned",Drag:"drag",DragEnd:"dragend",Drop:"drop",Out:"out",Over:"over",Remove:"remove",Shadow:"shadow",DropModel:"dropModel",RemoveModel:"removeModel"},f=Object.keys(d).map(e=>d[e]),v=o.a||r;class h{constructor(e=v){this.build=e}}const p=(e,t,n)=>r=>r.pipe(Object(s.a)(({event:n,name:r})=>n===e&&(void 0===t||r===t)),Object(u.a)(({name:e,args:t})=>n(e,t))),m=(e,[t,n,r])=>({name:e,el:t,container:n,source:r});let g=(()=>{class e{constructor(e=null){this.drakeFactory=e,this.dispatch$=new a.a,this.drag=e=>this.dispatch$.pipe(p(d.Drag,e,(e,[t,n])=>({name:e,el:t,source:n}))),this.dragend=e=>this.dispatch$.pipe(p(d.DragEnd,e,(e,[t])=>({name:e,el:t}))),this.drop=e=>this.dispatch$.pipe(p(d.Drop,e,(e,[t,n,r,o])=>({name:e,el:t,target:n,source:r,sibling:o}))),this.elContainerSource=e=>t=>this.dispatch$.pipe(p(e,t,m)),this.cancel=this.elContainerSource(d.Cancel),this.remove=this.elContainerSource(d.Remove),this.shadow=this.elContainerSource(d.Shadow),this.over=this.elContainerSource(d.Over),this.out=this.elContainerSource(d.Out),this.cloned=e=>this.dispatch$.pipe(p(d.Cloned,e,(e,[t,n,r])=>({name:e,clone:t,original:n,cloneType:r}))),this.dropModel=e=>this.dispatch$.pipe(p(d.DropModel,e,(e,[t,n,r,o,i,a,c,s,u])=>({name:e,el:t,target:n,source:r,sibling:o,item:i,sourceModel:a,targetModel:c,sourceIndex:s,targetIndex:u}))),this.removeModel=e=>this.dispatch$.pipe(p(d.RemoveModel,e,(e,[t,n,r,o,i,a])=>({name:e,el:t,container:n,source:r,item:o,sourceModel:i,sourceIndex:a}))),this.groups={},null===this.drakeFactory&&(this.drakeFactory=new h)}add(e){if(this.find(e.name))throw new Error('Group named: "'+e.name+'" already exists.');return this.groups[e.name]=e,this.handleModels(e),this.setupEvents(e),e}find(e){return this.groups[e]}destroy(e){let t=this.find(e);t&&(t.drake&&t.drake.destroy(),delete this.groups[e])}createGroup(e,t){return this.add(new l(e,this.drakeFactory.build([],t),t))}handleModels({name:e,drake:t,options:n}){let r,o,i;t.on("remove",(n,r,i)=>{if(!t.models)return;let a=t.models[t.containers.indexOf(i)];a=a.slice(0);const c=a.splice(o,1)[0];this.dispatch$.next({event:d.RemoveModel,name:e,args:[n,r,i,c,a,o]})}),t.on("drag",(e,n)=>{t.models&&(r=e,o=this.domIndexOf(e,n))}),t.on("drop",(a,c,s,u)=>{if(!t.models||!c)return;i=this.domIndexOf(a,c);let l,f=t.models[t.containers.indexOf(s)],v=t.models[t.containers.indexOf(c)];if(c===s)f=f.slice(0),l=f.splice(o,1)[0],f.splice(i,0,l),v=f;else{let e=r!==a;if(l=f[o],e){if(!n.copyItem)throw new Error("If you have enabled `copy` on a group, you must provide a `copyItem` function.");l=n.copyItem(l)}if(e||(f=f.slice(0),f.splice(o,1)),v=v.slice(0),v.splice(i,0,l),e)try{c.removeChild(a)}catch(h){}}this.dispatch$.next({event:d.DropModel,name:e,args:[a,c,s,u,l,f,v,o,i]})})}setupEvents(e){if(e.initEvents)return;e.initEvents=!0;const t=e.name;f.forEach(n=>{e.drake.on(n,(...e)=>{this.dispatch$.next({event:n,name:t,args:e})})})}domIndexOf(e,t){return Array.prototype.indexOf.call(t.children,e)}}return e.\u0275fac=function(t){return new(t||e)(i["\u0275\u0275inject"](h,8))},e.\u0275prov=i["\u0275\u0275defineInjectable"]({token:e,factory:e.\u0275fac}),e})(),b=(()=>{class e{constructor(e,t){this.el=e,this.dragulaService=t,this.dragulaModelChange=new i.EventEmitter}get container(){return this.el&&this.el.nativeElement}ngOnChanges(e){if(e&&e.dragula){const{previousValue:t,currentValue:n}=e.dragula;let r=!!n;!!t&&this.teardown(t),r&&this.setup()}else if(e&&e.dragulaModel){const{previousValue:t,currentValue:n}=e.dragulaModel,{drake:r}=this.group;if(this.dragula&&r){r.models=r.models||[];let e=r.models.indexOf(t);-1!==e?(r.models.splice(e,1),n&&r.models.splice(e,0,n)):n&&r.models.push(n)}}}setup(){let e=this.dragulaService.find(this.dragula);e||(e=this.dragulaService.createGroup(this.dragula,{})),(e=>{this.dragulaModel&&(e.drake.models?e.drake.models.push(this.dragulaModel):e.drake.models=[this.dragulaModel])})(e),e.drake.containers.push(this.container),this.subscribe(this.dragula),this.group=e}subscribe(e){this.subs=new c.a,this.subs.add(this.dragulaService.dropModel(e).subscribe(({source:e,target:t,sourceModel:n,targetModel:r})=>{e===this.el.nativeElement?this.dragulaModelChange.emit(n):t===this.el.nativeElement&&this.dragulaModelChange.emit(r)})),this.subs.add(this.dragulaService.removeModel(e).subscribe(({source:e,sourceModel:t})=>{e===this.el.nativeElement&&this.dragulaModelChange.emit(t)}))}teardown(e){this.subs&&this.subs.unsubscribe();const t=this.dragulaService.find(e);if(t){const e=t.drake.containers.indexOf(this.el.nativeElement);if(-1!==e&&t.drake.containers.splice(e,1),this.dragulaModel&&t.drake&&t.drake.models){let e=t.drake.models.indexOf(this.dragulaModel);-1!==e&&t.drake.models.splice(e,1)}}}ngOnDestroy(){this.teardown(this.dragula)}}return e.\u0275fac=function(t){return new(t||e)(i["\u0275\u0275directiveInject"](i.ElementRef),i["\u0275\u0275directiveInject"](g))},e.\u0275dir=i["\u0275\u0275defineDirective"]({type:e,selectors:[["","dragula",""]],inputs:{dragula:"dragula",dragulaModel:"dragulaModel"},outputs:{dragulaModelChange:"dragulaModelChange"},features:[i["\u0275\u0275NgOnChangesFeature"]]}),e})(),y=(()=>{class e{static forRoot(){return{ngModule:e,providers:[g]}}}return e.\u0275mod=i["\u0275\u0275defineNgModule"]({type:e}),e.\u0275inj=i["\u0275\u0275defineInjector"]({factory:function(t){return new(t||e)}}),e})()},Gjsa:function(e,t){var n="function"==typeof setImmediate;e.exports=n?function(e){setImmediate(e)}:function(e){setTimeout(e,0)}},Ibf7:function(e,t,n){"use strict";var r=n("Gjsa");e.exports=function(e,t,n){e&&r((function(){e.apply(n||null,t||[])}))}},PzH3:function(e,t,n){"use strict";var r=n("bBst"),o=n("Ys8N"),i=global.document,a=function(e,t,n,r){return e.addEventListener(t,n,r)},c=function(e,t,n,r){return e.removeEventListener(t,n,r)},s=[];function u(e,t,n){var r=function(e,t,n){var r,o;for(r=0;r<s.length;r++)if((o=s[r]).element===e&&o.type===t&&o.fn===n)return r}(e,t,n);if(r){var o=s[r].wrapper;return s.splice(r,1),o}}global.addEventListener||(a=function(e,t,n){return e.attachEvent("on"+t,function(e,t,n){var r=u(e,t,n)||function(e,t,n){return function(t){var r=t||global.event;r.target=r.target||r.srcElement,r.preventDefault=r.preventDefault||function(){r.returnValue=!1},r.stopPropagation=r.stopPropagation||function(){r.cancelBubble=!0},r.which=r.which||r.keyCode,n.call(e,r)}}(e,0,n);return s.push({wrapper:r,element:e,type:t,fn:n}),r}(e,t,n))},c=function(e,t,n){var r=u(e,t,n);if(r)return e.detachEvent("on"+t,r)}),e.exports={add:a,remove:c,fabricate:function(e,t,n){var a=-1===o.indexOf(t)?new r(t,{detail:n}):function(){var e;return i.createEvent?(e=i.createEvent("Event")).initEvent(t,!0,!0):i.createEventObject&&(e=i.createEventObject()),e}();e.dispatchEvent?e.dispatchEvent(a):e.fireEvent("on"+t,a)}}},YS7c:function(e,t,n){"use strict";var r=n("8/JR"),o=n("PzH3"),i=n("n6yW"),a=document,c=a.documentElement;function s(e,t,n,r){global.navigator.pointerEnabled?o[t](e,{mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"}[n],r):global.navigator.msPointerEnabled?o[t](e,{mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"}[n],r):(o[t](e,{mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"}[n],r),o[t](e,n,r))}function u(e){if(void 0!==e.touches)return e.touches.length;if(void 0!==e.which&&0!==e.which)return e.which;if(void 0!==e.buttons)return e.buttons;var t=e.button;return void 0!==t?1&t?1:2&t?3:4&t?2:0:void 0}function l(e){var t=e.getBoundingClientRect();return{left:t.left+d("scrollLeft","pageXOffset"),top:t.top+d("scrollTop","pageYOffset")}}function d(e,t){return void 0!==global[t]?global[t]:c.clientHeight?c[e]:a.body[e]}function f(e,t,n){var r,o=(e=e||{}).className||"";return e.className+=" gu-hide",r=a.elementFromPoint(t,n),e.className=o,r}function v(){return!1}function h(){return!0}function p(e){return e.width||e.right-e.left}function m(e){return e.height||e.bottom-e.top}function g(e){return e.parentNode===a?null:e.parentNode}function b(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName||function e(t){return!!t&&"false"!==t.contentEditable&&("true"===t.contentEditable||e(g(t)))}(e)}function y(e){return e.nextElementSibling||function(){var t=e;do{t=t.nextSibling}while(t&&1!==t.nodeType);return t}()}function E(e,t){var n=function(e){return e.targetTouches&&e.targetTouches.length?e.targetTouches[0]:e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e}(t),r={pageX:"clientX",pageY:"clientY"};return e in r&&!(e in n)&&r[e]in n&&(e=r[e]),n[e]}e.exports=function(e,t){var n,d,w,S,C,M,x,O,k,I,N,T=arguments.length;1===T&&!1===Array.isArray(e)&&(t=e,e=[]);var D,Y=null,j=t||{};void 0===j.moves&&(j.moves=h),void 0===j.accepts&&(j.accepts=h),void 0===j.invalid&&(j.invalid=K),void 0===j.containers&&(j.containers=e||[]),void 0===j.isContainer&&(j.isContainer=v),void 0===j.copy&&(j.copy=!1),void 0===j.copySortSource&&(j.copySortSource=!1),void 0===j.revertOnSpill&&(j.revertOnSpill=!1),void 0===j.removeOnSpill&&(j.removeOnSpill=!1),void 0===j.direction&&(j.direction="vertical"),void 0===j.ignoreInputTextSelection&&(j.ignoreInputTextSelection=!0),void 0===j.mirrorContainer&&(j.mirrorContainer=a.body);var R=r({containers:j.containers,start:z,end:U,cancel:Q,remove:Z,destroy:F,canMove:V,dragging:!1});return!0===j.removeOnSpill&&R.on("over",oe).on("out",ie),$(),R;function X(e){return-1!==R.containers.indexOf(e)||j.isContainer(e)}function $(e){var t=e?"remove":"add";s(c,t,"mousedown",L),s(c,t,"mouseup",_)}function B(e){s(c,e?"remove":"add","mousemove",A)}function P(e){var t=e?"remove":"add";o[t](c,"selectstart",G),o[t](c,"click",G)}function F(){$(!0),_({})}function G(e){D&&e.preventDefault()}function L(e){if(M=e.clientX,x=e.clientY,1===u(e)&&!e.metaKey&&!e.ctrlKey){var t=e.target,n=J(t);n&&(D=n,B(),"mousedown"===e.type&&(b(t)?t.focus():e.preventDefault()))}}function A(e){if(D)if(0!==u(e)){if(!(void 0!==e.clientX&&Math.abs(e.clientX-M)<=(j.slideFactorX||0)&&void 0!==e.clientY&&Math.abs(e.clientY-x)<=(j.slideFactorY||0))){if(j.ignoreInputTextSelection){var t=E("clientX",e)||0,n=E("clientY",e)||0;if(b(a.elementFromPoint(t,n)))return}var r=D;B(!0),P(),U(),H(r);var o=l(w);S=E("pageX",e)-o.left,C=E("pageY",e)-o.top,i.add(I||w,"gu-transit"),ae(),re(e)}}else _({})}function J(e){if(!(R.dragging&&n||X(e))){for(var t=e;g(e)&&!1===X(g(e));){if(j.invalid(e,t))return;if(!(e=g(e)))return}var r=g(e);if(r&&!j.invalid(e,t)&&j.moves(e,r,t,y(e)))return{item:e,source:r}}}function V(e){return!!J(e)}function z(e){var t=J(e);t&&H(t)}function H(e){le(e.item,e.source)&&(I=e.item.cloneNode(!0),R.emit("cloned",I,e.item,"copy")),d=e.source,w=e.item,O=k=y(e.item),R.dragging=!0,R.emit("drag",w,d)}function K(){return!1}function U(){if(R.dragging){var e=I||w;q(e,g(e))}}function W(){D=!1,B(!0),P(!0)}function _(e){if(W(),R.dragging){var t=I||w,r=E("clientX",e)||0,o=E("clientY",e)||0,i=ne(f(n,r,o),r,o);i&&(I&&j.copySortSource||!I||i!==d)?q(t,i):j.removeOnSpill?Z():Q()}}function q(e,t){var n=g(e);I&&j.copySortSource&&t===d&&n.removeChild(w),te(t)?R.emit("cancel",e,d,d):R.emit("drop",e,t,d,k),ee()}function Z(){if(R.dragging){var e=I||w,t=g(e);t&&t.removeChild(e),R.emit(I?"cancel":"remove",e,t,d),ee()}}function Q(e){if(R.dragging){var t=arguments.length>0?e:j.revertOnSpill,n=I||w,r=g(n),o=te(r);!1===o&&t&&(I?r&&r.removeChild(I):d.insertBefore(n,O)),o||t?R.emit("cancel",n,d,d):R.emit("drop",n,r,d,k),ee()}}function ee(){var e=I||w;W(),ce(),e&&i.rm(e,"gu-transit"),N&&clearTimeout(N),R.dragging=!1,Y&&R.emit("out",e,Y,d),R.emit("dragend",e),d=w=I=O=k=N=Y=null}function te(e,t){var r;return r=void 0!==t?t:n?k:y(I||w),e===d&&r===O}function ne(e,t,n){for(var r=e;r&&!o();)r=g(r);return r;function o(){if(!1===X(r))return!1;var o=se(r,e),i=ue(r,o,t,n);return!!te(r,i)||j.accepts(w,r,d,i)}}function re(e){if(n){e.preventDefault();var t=E("clientX",e)||0,r=E("clientY",e)||0,o=r-C;n.style.left=t-S+"px",n.style.top=o+"px";var i=I||w,a=f(n,t,r),c=ne(a,t,r),s=null!==c&&c!==Y;(s||null===c)&&(Y&&h("out"),Y=c,s&&h("over"));var u=g(i);if(c!==d||!I||j.copySortSource){var l,v=se(c,a);if(null!==v)l=ue(c,v,t,r);else{if(!0!==j.revertOnSpill||I)return void(I&&u&&u.removeChild(i));l=O,c=d}(null===l&&s||l!==i&&l!==y(i))&&(k=l,c.insertBefore(i,l),R.emit("shadow",i,c,d))}else u&&u.removeChild(i)}function h(e){R.emit(e,i,Y,d)}}function oe(e){i.rm(e,"gu-hide")}function ie(e){R.dragging&&i.add(e,"gu-hide")}function ae(){if(!n){var e=w.getBoundingClientRect();(n=w.cloneNode(!0)).style.width=p(e)+"px",n.style.height=m(e)+"px",i.rm(n,"gu-transit"),i.add(n,"gu-mirror"),j.mirrorContainer.appendChild(n),s(c,"add","mousemove",re),i.add(j.mirrorContainer,"gu-unselectable"),R.emit("cloned",n,w,"mirror")}}function ce(){n&&(i.rm(j.mirrorContainer,"gu-unselectable"),s(c,"remove","mousemove",re),g(n).removeChild(n),n=null)}function se(e,t){for(var n=t;n!==e&&g(n)!==e;)n=g(n);return n===c?null:n}function ue(e,t,n,r){var o,i="horizontal"===j.direction;return t!==e?(o=t.getBoundingClientRect(),(i?n>o.left+p(o)/2:r>o.top+m(o)/2)?y(t):t):function(){var t,o,a,c=e.children.length;for(t=0;t<c;t++){if(a=(o=e.children[t]).getBoundingClientRect(),i&&a.left+a.width/2>n)return o;if(!i&&a.top+a.height/2>r)return o}return null}()}function le(e,t){return"boolean"==typeof j.copy?j.copy:j.copy(e,t)}}},Ys8N:function(e,t,n){"use strict";var r=[],o="",i=/^on/;for(o in global)i.test(o)&&r.push(o.slice(2));e.exports=r},bBst:function(e,t){var n=global.CustomEvent;e.exports=function(){try{var e=new n("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(t){}return!1}()?n:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}},n6yW:function(e,t,n){"use strict";var r={};function o(e){var t=r[e];return t?t.lastIndex=0:r[e]=t=new RegExp("(?:^|\\s)"+e+"(?:\\s|$)","g"),t}e.exports={add:function(e,t){var n=e.className;n.length?o(t).test(n)||(e.className+=" "+t):e.className=t},rm:function(e,t){e.className=e.className.replace(o(t)," ").trim()}}}}]);