### Setup Dequeueing Functionality Source: https://github.com/fivetran/dbt_netsuite/blob/main/docs/index.html Configures and returns a function for setting up dequeueing logic. It uses debouncing for redraw hints and allows for custom priority functions. The setup involves performance monitoring and conditional redrawing based on various cost and time metrics. ```javascript setupDequeueing:function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var i=r.debounce((function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()}),e.deqRedrawThreshold),a=e.priority||r.noop;n.beforeRender((function(a,l){for(var s=r.performanceNow(),c=n.averageRedrawTime,u=n.lastRedrawTime,d=[\]; ;){var f=r.performanceNow(),h=f-s,g=f-l;if(u=e.deqFastCost*m)break}else if(a){if(h>=e.deqCost*u||h>=e.deqAvgCost*c)break}else if(g>=e.deqNoDrawCost*o)break;var b=e.deq(t,p,A);if(!(b.length>0))break;for(var C=0;C0&&(e.onDeqd(t,d),!a&&e.shouldRedraw(t,d,p,A)&&i())}),a(t))}}} ``` -------------------------------- ### Register Touch Start Listener Source: https://github.com/fivetran/dbt_netsuite/blob/main/docs/index.html Handles the start of touch interactions, including multi-touch gestures like pinching and context menu taps. It captures initial touch positions and identifies elements for potential grabbing or tapping. ```javascript e.registerBinding(e.container,"touchstart",T=function(n){if(_(n)){e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var r=e.cy,o=e.touchData.now,i=e.touchData.earlier;if(n.touches[0]){var a=e.projectIntoViewport(n.touches[0].clientX,n.touches[0].clientY);o[0]=a[0],o[1]=a[1]}if(n.touches[1]&&(a=e.projectIntoViewport(n.touches[1].clientX,n.touches[1].clientY),o[2]=a[0],o[3]=a[1]),n.touches[2]&&(a=e.projectIntoViewport(n.touches[2].clientX,n.touches[2].clientY),o[4]=a[0],o[5]=a[1]),n.touches[1]){A(e.dragData.touchDragEles);var l=e.findContainerClientCoords();k=l[0],S=l[1],E=l[2],D=l[3],m=n.touches[0].clientX-k,b=n.touches[0].clientY-S,C=n.touches[1].clientX-k,v=n.touches[1].clientY-S,$=0<=m&&m<=E&&0<=C&&C<=E&&0<=b&&b<=D&&0<=v&&v<=D;var c=r.pan(),p=r.zoom();if(y=I(m,b,C,v),w=U(m,b,C,v),B=[((x=[(m+C)/2,(b+v)/2])[0]-c.x)/p,(x[1]-c.y)/p],w<4e4&&!n.touches[2]){var f=e.findNearestElement(o[0],o[1],!0,!0),h=e.findNearestElement(o[2],o[3],!0,!0);return f&&f.isNode()?(f.activate().emit({originalEvent:n,type:"cxttapstart",position:{x:o[0],y:o[1]}}),e.touchData.start=f):h&&h.isNode()?(h.activate().emit({originalEvent:n,type:"cxttapstart",position:{x:o[0],y:o[1]}}),e.touchData.start=h):r.emit({originalEvent:n,type:"cxttapstart",position:{x:o[0],y:o[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(n.touches[2]);else if(n.touches[1]);else if(n.touches[0]){var g=e.findNearestElements(o[0],o[1],!0,!0),T=g[0];if(null!=T&&(T.activate(),e.touchData.start=T,e.touchData.starts=g,e.nodeIsGrabbable(T))){var M=e.dragData.touchDragEles=[],z=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),T.selected()?(z=r.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),u(z,{addToList:M})):d(T,{addToList:M}),s(T);var O=function(e){return{originalEvent:n,type:e,position:{x:o[0],y:o[1]}}};T.emit(O("grabon")),z?z.forEach((function(e){e.emit(O("grab"))})):T.emit(O("grab"))}t(T,["touchstart","tapstart","vmousedown"],n,{position:{x:o[0],y:o[1]}}),null==T&&(e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||(t(e.touchData.start,["taphold"],n,{position:{x:o[0],y:o[1]}}),e.touchData.start||r.$(":selected").unselect())}),e.tapholdDuration)}if(n.touches.length>=1){for(var N=e.touchData.startPosition=[],j=0;j1&&o.sort(l(i,-1)),{uiView:r,viewConfig:o[0]}})),c=s.map((function(e){return e.viewConfig})),u=this._viewConfigs.filter((function(e){return!(0,r.RV)(c,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));s.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var d=s.concat(u);this._listeners.forEach((function(e){return e(d)})),a.uP.traceViewSync(d)} ``` -------------------------------- ### Get or set HTML content with jQuery Source: https://github.com/fivetran/dbt_netsuite/blob/main/docs/index.html The `html()` method gets the HTML contents of the first element in the set of matched elements or sets the HTML contents of every matched element. Use it to dynamically update or retrieve HTML markup. ```javascript B.fn.extend({html:function(e){return Y(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Me.test(e)&&!Ce[(me.exec(e)||["",""])[1].toLowerCase()]){e=B.htmlPrefilter(e);try{for(;n{ "use strict"; n.d(t,{D:()=>l}); var r=n(5615),o=n(2904),i=n(8769),a=n(332),l=function(){ function e(e){ this.transition=e } return e.prototype.buildHooksForPhase=function(e){ var t=this; return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(r._d,[]).filter(r.D_) }, e.prototype.buildHooks=function(e){ var t=this.transition,n=t.treeChanges(),o=this.getMatchingHooks(e,n,t); if(!o)return[]; var l,s={transition:t,current:t.options().current}; return o.map((function(o){return o.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var l=(0,r.X$)({bind:o.bind,traceData:{hookType:e.name,context:n}},s),c=e.criteriaMatchPath.scope===i.$.STATE?n.state.self:null,u=new a.P(t,c,o,l); return{hook:o,node:n,transitionHook:u}}))})).reduce(r._d,[]).sort((l=e.reverseSort,void 0===l&&(l=!1),function(e,t){var n=l?-1:1,r=(e.node.state.path.length-t.node.state.path.length)*n; return 0!==r?r:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook})) }, e.prototype.getMatchingHooks=function(e,t,n){ var a=e.hookPhase===i.G.CREATE,l=this.transition.router.transitionService; return(a?[l]:[this.transition,l]).map((function(t){return t.getHooks(e.name)})).filter((0,r.E3)(o.cy,"broken event named: "+e.name)).reduce(r._d,[]).filter((function(e){return e.matches(t,n)})) }, e}() } } ``` -------------------------------- ### Get Edge Count Source: https://github.com/fivetran/dbt_netsuite/blob/main/docs/index.html Returns the total number of edges in the graph. ```javascript i.prototype.edgeCount=function(){return this._edgeCount} ``` -------------------------------- ### Configure UI Router State Management Source: https://github.com/fivetran/dbt_netsuite/blob/main/docs/index.html Sets up state provider, decorators for state registry, and configures URL decoding. This is typically part of the application's main routing setup. ```javascript tateProvider=new c.v(b.stateRegistry,b.stateService),b.stateRegistry.decorator("views",i.AX),b.stateRegistry.decorator("onExit",u("onExit")),b.stateRegistry.decorator("onRetain",u("onRetain")),b.stateRegistry.decorator("onEnter",u("onEnter")),b.viewService._pluginapi._viewConfigFactory("ng1",(0,i.qj)()),b.urlService.config._decodeParams=!1;var t=b.locationService=b.locationConfig=new d(e);function n(e,n,r,o,i,a,l){return t._runtimeServices(i,e,o,n,r),delete b.router,delete b.$get,b}return d.monkeyPatchPathParameterType(b),b.router=b,b.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],b}C.$inject=["$locationProvider"] ``` -------------------------------- ### Get Symbol Source: https://github.com/fivetran/dbt_netsuite/blob/main/docs/index.html Retrieves the Symbol object. Used for accessing built-in symbols. ```javascript var r=n(9325).Symbol;e.exports=r ``` -------------------------------- ### AngularJS Bootstrapping Source: https://github.com/fivetran/dbt_netsuite/blob/main/docs/index.html Initiates the AngularJS application. It can be called directly or resumed later if deferred. Debugging information can be enabled via a global variable. ```javascript function De(t,n,r){P(r)||(r={}),r=$({strictDi:!1},r);var o=function(){if((t=a(t)).injector()){var o=t[0]===e.document?"document":ye(t);throw C("btstrpd","App already bootstrapped with this element '{0}'",o.replace(//,">"))}}(n=n||[]).unshift(["$provide",function(e){e.value("$rootElement",t)}]),r.debugInfoEnabled&&n.push(["$compileProvider",function(e){e.debugInfoEnabled(!0)}]),n.unshift("ng");var i=Kt(n,r.strictDi);return i.invoke(["$rootScope","$rootElement","$compile","$injector",function(e,t,n,r){e.$apply((function(){t.data("$injector",r),n(t)(e)}))}]),i}function $e(){e.name="NG_ENABLE_DEBUG_INFO!"+e.name,e.location.reload()}function _e(e){var t=v.element(e).injector();if(!t)throw C("test","no injector found for element argument to getTestability");return t.get("$$testability")}var Te=/[\[A-Z\]]/g;function Me(e,t){return t=t||"_",e.replace(Te,(function(e,n){return(n?t:"")+e.toLowerCase()}))}var ze=!1;function Oe(){At.legacyXHTMLReplacement=!0}function Ie(e,t,n){if(!e)throw C("areq","Argument '{0}' is {1}",t||"?",n||"required");return e}function Ue(e,t,n){return n&&Y(e)&&(e=e[e.length-1]),Ie(Q(e),t,"not a function, got "+(e&&"object"==typeof e?e.constructor.name||"Object":typeof e)),e}function Ne(e,t){if("hasOwnProperty"===e)throw C("badname","hasOwnProperty is not a valid {0} name",t)}function je(e){for(var t,n=e[0],r=e[e.length-1],o=1;n!==r&&(n=n.nextSibling);o++)(t||e[o]!==n)&&(t||(t=a.call(e,0,o)),t.push(n));return t||e}function qe(){return Object.create(null)}function Pe(e){if(null==e)return"";switch(typeof e){case"string":break;case"number":e=""+e;break;default:e=!N(e)||Y(e)||F(e)?he(e):e.toString()}return e}var Re=3;function We(e,t){if(Y(e)){t=t||[];for(var n=0,r=e.length;n{"use strict";var r=n(6857),o=n(8191).Graph,i=n(3988);function a(e,t){var n={};return r.reduce(t,(function(t,o){var i=0,a=0,l=t.length,c=r.last(o);return r.forEach(o,(function(t,u){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),A=d?e.node(d).order:l;(d||t===c)&&(r.forEach(o.slice(a,u+1),(function(t){r.forEach(e.predecessors(t),(function(r){var o=e.node(r),a=o.order;!(al)&&s(n,t,c)}))}))}return r.reduce(t,(function(t,n){var i,a=-1,l=0;return r.forEach(n,(function(r,s){if("border"===e.node(r).dummy){var c=e.predecessors(r);c.length&&(i=e.node(c[0]).order,o(n,l ``` -------------------------------- ### Get Connected Components Source: https://github.com/fivetran/dbt_netsuite/blob/main/docs/index.html Finds the connected components of a graph. Each component is a collection of nodes and edges that are connected to each other. ```javascript components:function(){ var e=this, t=e.cy(), n=e.spawn(), r=e.nodes().spawnSelf(), o=[], i=function(e,t){n.merge(e),r.unmerge(e),t.merge(e)}; if(r.empty())return e.spawn(); var a=function(){ var n=t.collection(); o.push(n); var a=r[0]; i(a,n), e.bfs({ directed:!1, roots:a, visit:function(e,t,r,o,a){i(e,n)}} ) }; do{a()}while(r.length>0); return o.map((function(e){ var t=e.connectedEdges().stdFilter((function(t){return e.anySame(t.source())&&e.anySame(t.target())})); return e.union(t) })) } ``` -------------------------------- ### ViewService: View Matching Logic Source: https://github.com/fivetran/dbt_netsuite/blob/main/docs/index.html Defines the logic for matching a view declaration with a UI view based on type, FQN, and context anchor. This is crucial for associating configurations with the correct views. ```javascript e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var o=n.viewDecl,i=o.$uiViewName.split(","),a=t.fqn.split(".");if(!(0,r.aI)(i,a.slice(0-i.length)))return!1;var l=1-i.length||void 0,s=a.slice(0,l).join("."),c=e[s].creationContext;return o.$uiViewContextAnchor===(c&&c.name)}}} ```