<commit_before>Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d?this:a,b.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(d.prototype=this.prototype),e.prototype=new d,e}),define(["dojo/_base/declare","dojo/_base/lang","dijit/_Widget","dijit/_TemplatedMixin","dijit/_WidgetsInTemplateMixin","esri/dijit/Search","dojo/dom-construct","dijit/layout/ContentPane","dijit/TitlePane","dojox/widget/TitleGroup","dojo/on","dojo/Deferred","dojo/query","dojo/dom-style","dojo/NodeList-data"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){var o=function(a){return void 0===a||null===a||""===a},p=function(a,c,d){var e=g.toDom("<span class='drilldownResult'>"+a+"</span>");return m(e).data("result",b.mixin(c,{sourceIndex:d})),e},q=function(a,b){return!o(a)&&a.length>0&&b?"<span class='drilldownCount'>"+a.length+"</span>":""},r=function(a,b,c,d){var e=0,f=0,g=new j,k=a.Addresses;for(e=0,f=k.length;f>e;e+=1)g.addChild(new h({content:["<span class='drilldownResultIcon'></span>",p(k[e].address,k[e],d)]}));b.addChild(new i({title:q(k,c)+"<span class='drilldownTitle'>"+a.Description+"</span>",content:g,open:!1}))},s=function(a){return!o(a)&&a.length>1},t=function(a,b,c){var d,e,f=0,g=0,i=new j;if(s(a.Addresses)){for(d=a.Addresses,f=0,g=d.length;g>f;f++)s(d[f].Addresses)?r(d[f],i,b,c):(e=o(d[f].address)?p(d[f].Addresses[0].address,d[f].Addresses[0],c):p(d[f].address,d[f],c),i.addChild(new h({content:["<span class='drilldownResultIcon'></span>",e]})));i.startup()}else o(a.Addresses[0].address)?s(a.Addresses[0].Addresses)&&r(a.Addresses[0],i):i=new h({content:p(a.Addresses[0].address,a.Addresses[0])});return i},u=function(a,b,c){this.get("contentSet")===!1&&(this.set("content",t(a,b,c)),this.set("contentSet",!0))},v=function(a){var b=!1;return 1===a.length&&1===a[0].Addresses.length&&(o(a[0].Addresses[0].Addresses)&&(b=!0),o(a[0].Addresses[0].Addresses)||1!==a[0].Addresses[0].Addresses.length||(b=!0)),b};return a([c,d,e,f],{baseClass:"drilldown",widgetsInTemplate:!0,resultsElement:null,_titleGroups:[],showCounts:!1,constructor:function(b){a.safeMixin(this,b)},destroy:function(){this._clearPicklist(),this.inherited(arguments)},search:function(){var a=this,b=new l;return this.inherited(arguments).then(function(c){a._buildPickListUi(c),b.resolve()}),b.promise},clear:function(){this._clearPicklist(),this.inherited(arguments)},_hydrateResults:function(a){return a.PickListItems?a:this.inherited(arguments)},_formatResults:function(a,b,c){var d={activeSourceIndex:b,value:c,numResults:0,numErrors:0,errors:null,results:null},e={},f={},g=0;if(a&&!o(a[0].PickListItems)){if(b===this._allIndex){for(g=0;g<a.length;g++)o(this.sources[g].locator.locatorType)?d=this.inherited(arguments):o(a[g].PickListItems)||(f[g]=a[g],d.numResults+=a[g].PickListItems.length);return d.results=f,d.err=e,d}return o(this.activeSource.locator.locatorType)?this.inherited(arguments):(f[b]=a[0],d.numResults+=a[0].PickListItems.length,d.results=f,d.err=e,d)}return d.errors=a,d},_clearPicklist:function(){var a,b;if(this._titleGroups.length>0){for(a=0,b=this._titleGroups.length;b>a;a++)this._titleGroups[a].destroy();this._titleGroups=[],o(this.resultsElement)||n.set(this.resultsElement,"height",0)}},_showNoResults:function(){this._noResults(this.value),this._showNoResultsMenu()},_isSingleResult:function(a){var b,c,d,e=0;for(d in a)a.hasOwnProperty(d)&&(e++,c=d);return 1===e?(b=a[c].PickListItems,v(b)):!1},_createPremise:function(a,b,c,d,e){var f=new i({title:q(a.Addresses,b)+"<span class='drilldownTitle'>"+a.Description+"</span>",open:!1,contentSet:!1});return d?(f.set("open",!0),f.set("contentSet",!0),f.set("content",t(a,b,e))):f.own(f.on("click",c.bind(f,a,b,e))),f},_createResultsContainer:function(a,b,c){var d,e,f,h;return a?(f=g.create("div",{id:b+this.sources[b].name},c,"last"),e=g.create("div",{id:b},f,"last"),h=new j(null,e),this._titleGroups.push(h),d=new j,h.addChild(new i({title:this.sources[b].name,open:!1,content:d}))):(e=g.create("div",{id:b},c,"last"),d=new j(null,e)),d},_buildPickListUi:function(a){var b,c,d,e,f=this,h=0,i=0,j=!1,n=!1,p=new l;if(this._clearPicklist(),o(this.resultsElement)||g.destroy(this.resultsElement),this.resultsElement=g.create("div",{"class":"arcgisSearch searchGroup picklistResults"},this.domNode,"last"),f.activeSourceIndex!==this._allIndex&&this._isSingleResult(a))e=this._hydrateResult(a[f.activeSourceIndex].PickListItems[0].Addresses[0],f.activeSourceIndex,!1),this.select(e);else{if(!o(a)){for(d in a)if(a.hasOwnProperty(d))if(o(a[d])||o(a[d].PickListItems))j=!0;else if(b=a[d].PickListItems,i=b.length,i>0)for(c=this._createResultsContainer("all"===this.activeSourceIndex,d,this.resultsElement),this._titleGroups.push(c),n=!0,h=0;i>h;h+=1)c.addChild(this._createPremise(b[h],this.showCounts,u,1===i,d)),j=!1;else j=!0;p.resolve()}j&&!n&&this._showNoResults(),o(this.resultsElement)||k(this.resultsElement,".drilldownResult:click",function(){var a=m(this).data()[0],b=f._hydrateResult(a.result,a.result.sourceIndex,!1);f.select(b),f._clearPicklist()})}return p.promise}})});<commit_msg>Update from travis build of arcgis-dijit-drilldown<commit_after>Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d?this:a,b.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(d.prototype=this.prototype),e.prototype=new d,e}),define(["dojo/_base/declare","dojo/_base/lang","dijit/_Widget","dijit/_TemplatedMixin","dijit/_WidgetsInTemplateMixin","esri/dijit/Search","dojo/dom-construct","dijit/layout/ContentPane","dijit/TitlePane","dojox/widget/TitleGroup","dojo/on","dojo/Deferred","dojo/query","dojo/dom-style","dojo/NodeList-data"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){var o=function(a){return void 0===a||null===a||""===a},p=function(a,c,d){var e=g.toDom("<span class='drilldownResult'>"+a+"</span>");return m(e).data("result",b.mixin(c,{sourceIndex:d})),e},q=function(a,b){return!o(a)&&a.length>0&&b?"<span class='drilldownCount'>"+a.length+"</span>":""},r=function(a,b,c,d){var e=0,f=0,g=new j,k=a.Addresses;for(e=0,f=k.length;f>e;e+=1)g.addChild(new h({content:["<span class='drilldownResultIcon'></span>",p(k[e].address,k[e],d)]}));b.addChild(new i({title:q(k,c)+"<span class='drilldownTitle'>"+a.Description+"</span>",content:g,open:!1}))},s=function(a){return!o(a)&&a.length>1},t=function(a,b,c){var d,e,f=0,g=0,i=new j;if(s(a.Addresses)){for(d=a.Addresses,f=0,g=d.length;g>f;f++)s(d[f].Addresses)?r(d[f],i,b,c):(e=o(d[f].address)?p(d[f].Addresses[0].address,d[f].Addresses[0],c):p(d[f].address,d[f],c),i.addChild(new h({content:["<span class='drilldownResultIcon'></span>",e]})));i.startup()}else o(a.Addresses[0].address)?s(a.Addresses[0].Addresses)&&r(a.Addresses[0],i,c):i=new h({content:p(a.Addresses[0].address,a.Addresses[0],c)});return i},u=function(a,b,c){this.get("contentSet")===!1&&(this.set("content",t(a,b,c)),this.set("contentSet",!0))},v=function(a){var b=!1;return 1===a.length&&1===a[0].Addresses.length&&(o(a[0].Addresses[0].Addresses)&&(b=!0),o(a[0].Addresses[0].Addresses)||1!==a[0].Addresses[0].Addresses.length||(b=!0)),b};return a([c,d,e,f],{baseClass:"drilldown",widgetsInTemplate:!0,resultsElement:null,_titleGroups:[],showCounts:!1,constructor:function(b){a.safeMixin(this,b)},destroy:function(){this._clearPicklist(),this.inherited(arguments)},search:function(){var a=this,b=new l;return this.inherited(arguments).then(function(c){a._buildPickListUi(c),b.resolve()}),b.promise},clear:function(){this._clearPicklist(),this.inherited(arguments)},_hydrateResults:function(a){return a.PickListItems?a:this.inherited(arguments)},_formatResults:function(a,b,c){var d={activeSourceIndex:b,value:c,numResults:0,numErrors:0,errors:null,results:null},e={},f={},g=0;if(a&&!o(a[0].PickListItems)){if(b===this._allIndex){for(g=0;g<a.length;g++)o(this.sources[g].locator.locatorType)?d=this.inherited(arguments):o(a[g].PickListItems)||(f[g]=a[g],d.numResults+=a[g].PickListItems.length);return d.results=f,d.err=e,d}return o(this.activeSource.locator.locatorType)?this.inherited(arguments):(f[b]=a[0],d.numResults+=a[0].PickListItems.length,d.results=f,d.err=e,d)}return d.errors=a,d},_clearPicklist:function(){var a,b;if(this._titleGroups.length>0){for(a=0,b=this._titleGroups.length;b>a;a++)this._titleGroups[a].destroy();this._titleGroups=[],o(this.resultsElement)||n.set(this.resultsElement,"height",0)}},_showNoResults:function(){this._noResults(this.value),this._showNoResultsMenu()},_isSingleResult:function(a){var b,c,d,e=0;for(d in a)a.hasOwnProperty(d)&&(e++,c=d);return 1===e?(b=a[c].PickListItems,v(b)):!1},_createPremise:function(a,b,c,d,e){var f=new i({title:q(a.Addresses,b)+"<span class='drilldownTitle'>"+a.Description+"</span>",open:!1,contentSet:!1});return d?(f.set("open",!0),f.set("contentSet",!0),f.set("content",t(a,b,e))):f.own(f.on("click",c.bind(f,a,b,e))),f},_createResultsContainer:function(a,b,c){var d,e,f,h;return a?(f=g.create("div",{id:b+this.sources[b].name},c,"last"),e=g.create("div",{id:b},f,"last"),h=new j(null,e),this._titleGroups.push(h),d=new j,h.addChild(new i({title:this.sources[b].name,open:!1,content:d}))):(e=g.create("div",{id:b},c,"last"),d=new j(null,e)),d},_buildPickListUi:function(a){var b,c,d,e,f=this,h=0,i=0,j=!1,n=!1,p=new l;if(this._clearPicklist(),o(this.resultsElement)||g.destroy(this.resultsElement),this.resultsElement=g.create("div",{"class":"arcgisSearch searchGroup picklistResults"},this.domNode,"last"),f.activeSourceIndex!==this._allIndex&&this._isSingleResult(a))e=this._hydrateResult(a[f.activeSourceIndex].PickListItems[0].Addresses[0],f.activeSourceIndex,!1),this.select(e);else{if(!o(a)){for(d in a)if(a.hasOwnProperty(d))if(o(a[d])||o(a[d].PickListItems))j=!0;else if(b=a[d].PickListItems,i=b.length,i>0)for(c=this._createResultsContainer("all"===this.activeSourceIndex,d,this.resultsElement),this._titleGroups.push(c),n=!0,h=0;i>h;h+=1)c.addChild(this._createPremise(b[h],this.showCounts,u,1===i,d)),j=!1;else j=!0;p.resolve()}j&&!n&&this._showNoResults(),o(this.resultsElement)||k(this.resultsElement,".drilldownResult:click",function(){var a=m(this).data()[0],b=f._hydrateResult(a.result,a.result.sourceIndex,!1);f.select(b),f._clearPicklist()})}return p.promise}})});
{'fraction_non_alphanumeric': 0.2665287313081915, 'fraction_numerical': 0.01335465061600677, 'mean_word_length': 17.989285714285714, 'pattern_counts': {'":': 4, '<': 29, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '905152', 'n_tokens_mistral': 4468, 'n_tokens_neox': 4416, 'n_words': 154}