text: /**
   * Copyright (c) 2014, 2016, Oracle and/or its affiliates.
   * The Universal Permissive License (UPL), Version 1.0
   */
  "use strict";
  define(["ojs/ojcore","jquery","knockout","ojs/ojdatasource-common","ojs/ojmodel","ojs/ojknockout-model"],function(a,g,c){a.bc=function(a){this.fb=a;this.current=0;this.Init();this.ii=[];this.YV(10)};o_("CollectionPagingDataSource",a.bc,a);a.b.ta(a.bc,a.ym,"oj.CollectionPagingDataSource");a.bc.prototype.Init=function(){a.bc.u.Init.call(this)};a.b.g("CollectionPagingDataSource.prototype.Init",{Init:a.bc.prototype.Init});a.bc.prototype.jT=function(){return this.bn()?this.Hq:this.totalSize()-this.current};
  a.bc.prototype.Sv=function(){this.ii=Array(this.jT());var a=this;return this.fb.mx(this.current,this.current+this.ii.length).then(function(c){for(var e=0;e<c.length;e++)a.ii[e]=c[e];a.ZD();a.Dk=a.pa+a.ii.length-1})};a.bc.prototype.ZD=function(){if(void 0!==this.Kn){this.Kn.removeAll();for(var b=0;b<this.ii.length;b++)this.Kn.push(a.lb.map(this.ii[b]))}};a.bc.prototype.Uq=function(){return this.ii};a.b.g("CollectionPagingDataSource.prototype.getWindow",{Uq:a.bc.prototype.Uq});a.bc.prototype.gF=function(){void 0===
  this.Kn&&(this.Kn=c.observableArray(),this.ZD());return this.Kn};a.b.g("CollectionPagingDataSource.prototype.getWindowObservable",{gF:a.bc.prototype.gF});a.bc.prototype.getPage=function(){return this.ge};a.b.g("CollectionPagingDataSource.prototype.getPage",{getPage:a.bc.prototype.getPage});a.bc.prototype.setPage=function(b,c){c=c||{};b=parseInt(b,10);try{a.bc.u.handleEvent.call(this,a.ad.Q.BEFOREPAGE,{page:b,previousPage:this.ge})}catch(e){return Promise.reject(null)}this.pageSize=null!=c.pageSize?
  c.pageSize:this.pageSize;c.startIndex=b*this.pageSize;var f=this.ge;this.ge=b;this.pa=c.startIndex;var g=this;return new Promise(function(b,e){g.Bg(c).then(function(){a.bc.u.handleEvent.call(g,a.ad.Q.PAGE,{page:g.ge,previousPage:f});b(null)},function(){g.ge=f;g.pa=g.ge*g.pageSize;e(null)})})};a.b.g("CollectionPagingDataSource.prototype.setPage",{setPage:a.bc.prototype.setPage});a.bc.prototype.getStartItemIndex=function(){return this.pa};a.b.g("CollectionPagingDataSource.prototype.getStartItemIndex",
  {getStartItemIndex:a.bc.prototype.getStartItemIndex});a.bc.prototype.getEndItemIndex=function(){return this.Dk};a.b.g("CollectionPagingDataSource.prototype.getEndItemIndex",{getEndItemIndex:a.bc.prototype.getEndItemIndex});a.bc.prototype.getPageCount=function(){var a=this.totalSize();return-1==a?-1:Math.ceil(a/this.pageSize)};a.b.g("CollectionPagingDataSource.prototype.getPageCount",{getPageCount:a.bc.prototype.getPageCount});a.bc.prototype.fetch=function(a){var c=a||{};if(void 0!==c.pageSize&&void 0!==
  c.startIndex){if(!this.bn())return this.oK(null),Promise.resolve();this.Hq=c.startIndex+c.pageSize;var e=this;return this.Sv().then(function(){e.oK(null)})}return this.Bg(a)};a.b.g("CollectionPagingDataSource.prototype.fetch",{fetch:a.bc.prototype.fetch});a.bc.prototype.Bg=function(a){var c=a||{};void 0!==c.startIndex&&(this.current=c.startIndex);void 0!==c.pageSize&&(this.Hq=this.pageSize=c.pageSize);var e=this;return new Promise(function(a){try{e.fb.fetch({success:function(){e.Sv().then(function(){e.oK(c);
  a({data:e.Uq(),startIndex:e.current})})}})}catch(b){e.Sv().then(function(){e.oK(c);a({data:e.Uq(),startIndex:e.current})})}})};a.bc.prototype.oK=function(a){a=a||{};a.silent||this.handleEvent("sync",{data:this.Uq(),startIndex:this.current});a.success&&a.success()};a.bc.prototype.handleEvent=function(b,c){return a.bc.u.handleEvent.call(this,b,c)};a.bc.prototype.bn=function(){return this.current+this.Hq<this.totalSize()};a.bc.prototype.YV=function(a){this.Hq=this.pageSize=a};a.bc.prototype.size=function(){var a=
  this.Uq();return a?a.length:0};a.b.g("CollectionPagingDataSource.prototype.size",{size:a.bc.prototype.size});a.bc.prototype.totalSize=function(){return this.fb.length};a.b.g("CollectionPagingDataSource.prototype.totalSize",{totalSize:a.bc.prototype.totalSize});a.bc.prototype.totalSizeConfidence=function(){return"actual"};a.b.g("CollectionPagingDataSource.prototype.totalSizeConfidence",{totalSizeConfidence:a.bc.prototype.totalSizeConfidence});a.bc.prototype.getCapability=function(){return null};a.b.g("CollectionPagingDataSource.prototype.getCapability",
  {getCapability:a.bc.prototype.getCapability})});